12CONSTRAINT_RULES_LIST_BASE::CONSTRAINT_RULES_LIST_BASE( wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString&
name ) : wxPanel( parent, id, pos, size, style,
name )
14 wxBoxSizer* mainSizer;
15 mainSizer =
new wxBoxSizer( wxVERTICAL );
17 m_list =
new wxListCtrl(
this, wxID_ANY, wxDefaultPosition, wxSize( -1,140 ), wxLC_REPORT|wxLC_SINGLE_SEL );
18 m_list->SetToolTip(
_(
"The rules for this constraint, in the order they are read. Select one to load it into the form below.") );
20 mainSizer->Add(
m_list, 1, wxBOTTOM|wxEXPAND, 4 );
22 m_emptyLabel =
new wxStaticText(
this, wxID_ANY,
_(
"No rules yet."), wxDefaultPosition, wxDefaultSize, 0 );
26 wxBoxSizer* tableButtons;
27 tableButtons =
new wxBoxSizer( wxHORIZONTAL );
29 m_upBtn =
new wxButton(
this, wxID_ANY,
_(
"Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
30 m_upBtn->SetToolTip(
_(
"Move the selected rule one place earlier. Rules are read from top to bottom and the last one that matches decides the value, so a rule lower down wins.") );
32 tableButtons->Add(
m_upBtn, 0, wxRIGHT, 4 );
34 m_downBtn =
new wxButton(
this, wxID_ANY,
_(
"Move Down"), wxDefaultPosition, wxDefaultSize, 0 );
35 m_downBtn->SetToolTip(
_(
"Move the selected rule one place later. Rules are read from top to bottom and the last one that matches decides the value, so a rule lower down wins.") );
37 tableButtons->Add(
m_downBtn, 0, wxRIGHT, 4 );
39 m_duplicateBtn =
new wxButton(
this, wxID_ANY,
_(
"Duplicate"), wxDefaultPosition, wxDefaultSize, 0 );
40 m_duplicateBtn->SetToolTip(
_(
"Copy the selected rule and place the copy after it.") );
44 m_removeBtn =
new wxButton(
this, wxID_ANY,
_(
"Remove"), wxDefaultPosition, wxDefaultSize, 0 );
45 m_removeBtn->SetToolTip(
_(
"Delete the selected rule.") );
50 mainSizer->Add( tableButtons, 0, wxBOTTOM, 4 );
52 m_editorHost =
new wxPanel(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
61 wxBoxSizer* formButtons;
62 formButtons =
new wxBoxSizer( wxHORIZONTAL );
64 m_primaryBtn =
new wxButton(
this, wxID_ANY,
_(
"Add Rule"), wxDefaultPosition, wxDefaultSize, 0 );
67 m_newBtn =
new wxButton(
this, wxID_ANY,
_(
"New Rule"), wxDefaultPosition, wxDefaultSize, 0 );
68 m_newBtn->SetToolTip(
_(
"Empty the form so another rule can be written. Anything typed and not added is discarded.") );
70 formButtons->Add(
m_newBtn, 0, wxRIGHT, 4 );
73 mainSizer->Add( formButtons, 0, wxBOTTOM|wxTOP, 6 );
76 this->SetSizer( mainSizer );
78 mainSizer->Fit(
this );
CONSTRAINT_RULES_LIST_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)