@@ -42,9 +42,18 @@ class gbtLayoutNodesPanel : public wxPanel {
4242 int NodeSize () const { return m_nodeSize->GetValue (); }
4343 int TerminalSpacing () const { return m_terminalSpacing->GetValue (); }
4444
45- int ChanceToken () const { return m_chanceToken->GetSelection (); }
46- int PlayerToken () const { return m_playerToken->GetSelection (); }
47- int TerminalToken () const { return m_terminalToken->GetSelection (); }
45+ NodeTokenStyle GetChanceToken () const
46+ {
47+ return static_cast <NodeTokenStyle>(m_chanceToken->GetSelection ());
48+ }
49+ NodeTokenStyle GetPlayerToken () const
50+ {
51+ return static_cast <NodeTokenStyle>(m_playerToken->GetSelection ());
52+ }
53+ NodeTokenStyle GetTerminalToken () const
54+ {
55+ return static_cast <NodeTokenStyle>(m_terminalToken->GetSelection ());
56+ }
4857};
4958
5059gbtLayoutNodesPanel::gbtLayoutNodesPanel (wxWindow *p_parent, const gbtStyle &p_settings)
@@ -62,20 +71,20 @@ gbtLayoutNodesPanel::gbtLayoutNodesPanel(wxWindow *p_parent, const gbtStyle &p_s
6271 tokenSizer->Add (new wxStaticText (this , wxID_STATIC, _ (" Indicate chance nodes with" )), 0 ,
6372 wxALL | wxALIGN_CENTER_VERTICAL, 5 );
6473 m_chanceToken = new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 5 , tokenChoices);
65- m_chanceToken->SetSelection (p_settings.ChanceToken ());
74+ m_chanceToken->SetSelection (p_settings.GetChanceToken ());
6675 tokenSizer->Add (m_chanceToken, 1 , wxALL | wxEXPAND, 5 );
6776
6877 tokenSizer->Add (new wxStaticText (this , wxID_STATIC, _ (" Indicate player nodes with" )), 0 ,
6978 wxALL | wxALIGN_CENTER_VERTICAL, 5 );
7079 m_playerToken = new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 5 , tokenChoices);
71- m_playerToken->SetSelection (p_settings.PlayerToken ());
80+ m_playerToken->SetSelection (p_settings.GetPlayerToken ());
7281 tokenSizer->Add (m_playerToken, 1 , wxALL | wxEXPAND, 5 );
7382
7483 tokenSizer->Add (new wxStaticText (this , wxID_STATIC, _ (" Indicate terminal nodes with" )), 0 ,
7584 wxALL | wxALIGN_CENTER_VERTICAL, 5 );
7685 m_terminalToken =
7786 new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 5 , tokenChoices);
78- m_terminalToken->SetSelection (p_settings.TerminalToken ());
87+ m_terminalToken->SetSelection (p_settings.GetTerminalToken ());
7988 tokenSizer->Add (m_terminalToken, 1 , wxALL | wxEXPAND, 5 );
8089
8190 nodeSizer->Add (tokenSizer, 1 , wxALL | wxEXPAND, 5 );
@@ -92,7 +101,7 @@ gbtLayoutNodesPanel::gbtLayoutNodesPanel(wxWindow *p_parent, const gbtStyle &p_s
92101 const int NODE_LENGTH_MIN = 5 ;
93102 const int NODE_LENGTH_MAX = 100 ;
94103
95- m_nodeSize = new wxSpinCtrl (this , wxID_ANY, wxString::Format (_T (" %d" ), p_settings.NodeSize ()),
104+ m_nodeSize = new wxSpinCtrl (this , wxID_ANY, wxString::Format (_T (" %d" ), p_settings.GetNodeSize ()),
96105 wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, NODE_LENGTH_MIN,
97106 NODE_LENGTH_MAX);
98107 gridSizer->Add (m_nodeSize, 1 , wxEXPAND | wxALL, 5 );
@@ -125,11 +134,17 @@ class gbtLayoutBranchesPanel : public wxPanel {
125134public:
126135 gbtLayoutBranchesPanel (wxWindow *p_parent, const gbtStyle &);
127136
128- int BranchLength () const { return m_branchLength->GetValue (); }
129- int TineLength () const { return m_tineLength->GetValue (); }
137+ int GetBranchLength () const { return m_branchLength->GetValue (); }
138+ int GetTineLength () const { return m_tineLength->GetValue (); }
130139
131- int BranchStyle () const { return m_branchStyle->GetSelection (); }
132- int BranchLabels () const { return m_branchLabels->GetSelection (); }
140+ BranchLineStyle GetBranchStyle () const
141+ {
142+ return static_cast <BranchLineStyle>(m_branchStyle->GetSelection ());
143+ }
144+ BranchLabelOrientationStyle GetBranchLabels () const
145+ {
146+ return static_cast <BranchLabelOrientationStyle>(m_branchLabels->GetSelection ());
147+ }
133148};
134149
135150gbtLayoutBranchesPanel::gbtLayoutBranchesPanel (wxWindow *p_parent, const gbtStyle &p_settings)
@@ -152,14 +167,14 @@ gbtLayoutBranchesPanel::gbtLayoutBranchesPanel(wxWindow *p_parent, const gbtStyl
152167 wxString styleChoices[] = {_ (" using straight lines between nodes" ),
153168 _ (" with a tine for branch labels" )};
154169 m_branchStyle = new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 2 , styleChoices);
155- m_branchStyle->SetSelection (p_settings.BranchStyle ());
170+ m_branchStyle->SetSelection (p_settings.GetBranchStyle ());
156171 styleSizer->Add (m_branchStyle, 1 , wxALL | wxEXPAND, 5 );
157172
158173 styleSizer->Add (new wxStaticText (this , wxID_STATIC, _ (" Draw labels" )), 1 ,
159174 wxALL | wxALIGN_CENTER_VERTICAL, 5 );
160175 wxString labelChoices[] = {_ (" horizontally" ), _ (" rotated parallel to the branch" )};
161176 m_branchLabels = new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 2 , labelChoices);
162- m_branchLabels->SetSelection (p_settings.BranchLabels ());
177+ m_branchLabels->SetSelection (p_settings.GetBranchLabels ());
163178 styleSizer->Add (m_branchLabels, 1 , wxALL | wxEXPAND, 5 );
164179
165180 styleBoxSizer->Add (styleSizer, 1 , wxALL | wxEXPAND, 5 );
@@ -173,14 +188,14 @@ gbtLayoutBranchesPanel::gbtLayoutBranchesPanel(wxWindow *p_parent, const gbtStyl
173188 gridSizer->Add (new wxStaticText (this , wxID_ANY, _ (" size of branch fork" )), 0 ,
174189 wxALIGN_CENTER_VERTICAL | wxALL, 5 );
175190 m_branchLength = new wxSpinCtrl (
176- this , wxID_ANY, wxString::Format (_T (" %d" ), p_settings.BranchLength ()), wxDefaultPosition,
191+ this , wxID_ANY, wxString::Format (_T (" %d" ), p_settings.GetBranchLength ()), wxDefaultPosition,
177192 wxDefaultSize, wxSP_ARROW_KEYS, BRANCH_LENGTH_MIN, BRANCH_LENGTH_MAX);
178193 gridSizer->Add (m_branchLength, 1 , wxALL | wxEXPAND, 5 );
179194
180195 gridSizer->Add (new wxStaticText (this , wxID_ANY, _ (" size of branch tine" )), 1 ,
181196 wxALIGN_CENTER_VERTICAL | wxALL, 5 );
182197 m_tineLength = new wxSpinCtrl (
183- this , wxID_ANY, wxString::Format (_T (" %d" ), p_settings.TineLength ()), wxDefaultPosition,
198+ this , wxID_ANY, wxString::Format (_T (" %d" ), p_settings.GetTineLength ()), wxDefaultPosition,
184199 wxDefaultSize, wxSP_ARROW_KEYS, TINE_LENGTH_MIN, TINE_LENGTH_MAX);
185200 gridSizer->Add (m_tineLength, 1 , wxALL | wxEXPAND, 5 );
186201
@@ -200,8 +215,14 @@ class gbtLayoutInfosetsPanel : public wxPanel {
200215public:
201216 gbtLayoutInfosetsPanel (wxWindow *p_parent, const gbtStyle &);
202217
203- int InfosetConnect () const { return m_infosetConnect->GetSelection (); }
204- int InfosetJoin () const { return m_infosetJoin->GetSelection (); }
218+ InfosetConnectStyle GetInfosetConnect () const
219+ {
220+ return static_cast <InfosetConnectStyle>(m_infosetConnect->GetSelection ());
221+ }
222+ InfosetJoinStyle GetInfosetJoin () const
223+ {
224+ return static_cast <InfosetJoinStyle>(m_infosetJoin->GetSelection ());
225+ }
205226};
206227
207228gbtLayoutInfosetsPanel::gbtLayoutInfosetsPanel (wxWindow *p_parent, const gbtStyle &p_settings)
@@ -219,14 +240,14 @@ gbtLayoutInfosetsPanel::gbtLayoutInfosetsPanel(wxWindow *p_parent, const gbtStyl
219240 _ (" only when on the same level" ), _ (" regardless of level" )};
220241 m_infosetConnect =
221242 new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 3 , connectChoices);
222- m_infosetConnect->SetSelection (p_settings.InfosetConnect ());
243+ m_infosetConnect->SetSelection (p_settings.GetInfosetConnect ());
223244 styleSizer->Add (m_infosetConnect, 0 , wxALL, 5 );
224245
225246 styleSizer->Add (new wxStaticText (this , wxID_STATIC, _ (" Draw information set connections" )), 0 ,
226247 wxALL | wxALIGN_CENTER_VERTICAL, 5 );
227248 wxString joinChoices[] = {_ (" using lines" ), _ (" using bubbles" )};
228249 m_infosetJoin = new wxChoice (this , wxID_ANY, wxDefaultPosition, wxDefaultSize, 2 , joinChoices);
229- m_infosetJoin->SetSelection (p_settings.InfosetJoin ());
250+ m_infosetJoin->SetSelection (p_settings.GetInfosetJoin ());
230251 styleSizer->Add (m_infosetJoin, 0 , wxALL | wxEXPAND, 5 );
231252 infosetSizer->Add (styleSizer, 0 , wxALL | wxALIGN_CENTER, 5 );
232253 topSizer->Add (infosetSizer, 0 , wxALL, 5 );
@@ -277,19 +298,19 @@ void gbtLayoutDialog::GetSettings(gbtStyle &p_settings)
277298 auto *nodes = dynamic_cast <gbtLayoutNodesPanel *>(m_notebook->GetPage (0 ));
278299 p_settings.SetNodeSize (nodes->NodeSize ());
279300 p_settings.SetTerminalSpacing (nodes->TerminalSpacing ());
280- p_settings.SetChanceToken (nodes->ChanceToken ());
281- p_settings.SetPlayerToken (nodes->PlayerToken ());
282- p_settings.SetTerminalToken (nodes->TerminalToken ());
301+ p_settings.SetChanceToken (nodes->GetChanceToken ());
302+ p_settings.SetPlayerToken (nodes->GetPlayerToken ());
303+ p_settings.SetTerminalToken (nodes->GetTerminalToken ());
283304
284305 auto *branches = dynamic_cast <gbtLayoutBranchesPanel *>(m_notebook->GetPage (1 ));
285- p_settings.SetBranchLength (branches->BranchLength ());
286- p_settings.SetTineLength (branches->TineLength ());
287- p_settings.SetBranchStyle (branches->BranchStyle ());
288- p_settings.SetBranchLabels (branches->BranchLabels ());
306+ p_settings.SetBranchLength (branches->GetBranchLength ());
307+ p_settings.SetTineLength (branches->GetTineLength ());
308+ p_settings.SetBranchStyle (branches->GetBranchStyle ());
309+ p_settings.SetBranchLabels (branches->GetBranchLabels ());
289310
290311 auto *infosets = dynamic_cast <gbtLayoutInfosetsPanel *>(m_notebook->GetPage (2 ));
291- p_settings.SetInfosetConnect (infosets->InfosetConnect ());
292- p_settings.SetInfosetJoin (infosets->InfosetJoin ());
312+ p_settings.SetInfosetConnect (infosets->GetInfosetConnect ());
313+ p_settings.SetInfosetJoin (infosets->GetInfosetJoin ());
293314}
294315
295316void gbtLayoutDialog::OnSetDefaults (wxCommandEvent &)
0 commit comments