33 #include <wx/statline.h>
34 #include <wx/valgen.h>
55 parameter_(parameter) {
57 createContents(
this,
true,
true);
63 FindWindow(ID_NAME)->SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
64 FindWindow(ID_TYPE)->SetValidator(wxTextValidator(wxFILTER_ASCII, &type_));
66 wxTextValidator(wxFILTER_ASCII, &value_));
68 TransferDataToWindow();
84 TransferDataFromWindow();
86 name_ = name_.Trim(
true).Trim(
false);
87 type_ = type_.Trim(
true).Trim(
false);
88 value_ = value_.Trim(
true).Trim(
false);
91 if (name_.IsEmpty()) {
92 wxString message = _T(
"Name field must not be empty.");
98 if (type_.IsEmpty()) {
99 wxString message = _T(
"Type field must not be empty.");
117 wxWindow *parent,
bool call_fit,
bool set_sizer) {
119 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
121 wxFlexGridSizer *item1 =
new wxFlexGridSizer( 2, 0, 0 );
123 wxStaticText *item2 =
new wxStaticText( parent, ID_LABEL_NAME, wxT(
"Name:"), wxDefaultPosition, wxDefaultSize, 0 );
124 item1->Add( item2, 0, wxALIGN_RIGHT|wxALL, 5 );
126 wxTextCtrl *item3 =
new wxTextCtrl( parent, ID_NAME, wxT(
""), wxDefaultPosition, wxSize(200,-1), 0 );
127 item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
129 wxStaticText *item4 =
new wxStaticText( parent, ID_LABEL_TYPE, wxT(
"Type:"), wxDefaultPosition, wxDefaultSize, 0 );
130 item1->Add( item4, 0, wxALIGN_RIGHT|wxALL, 5 );
132 wxTextCtrl *item5 =
new wxTextCtrl( parent, ID_TYPE, wxT(
""), wxDefaultPosition, wxSize(80,-1), 0 );
133 item1->Add( item5, 0, wxGROW|wxALL, 5 );
135 wxStaticText *item6 =
new wxStaticText( parent, ID_LABEL_VALUE, wxT(
"Value:"), wxDefaultPosition, wxDefaultSize, 0 );
136 item1->Add( item6, 0, wxALIGN_RIGHT|wxALL, 5 );
138 wxTextCtrl *item7 =
new wxTextCtrl( parent, ID_VALUE, wxT(
""), wxDefaultPosition, wxSize(80,-1), 0 );
139 item1->Add( item7, 0, wxGROW|wxALL, 5 );
141 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
143 wxStaticLine *item8 =
new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
144 item0->Add( item8, 0, wxGROW|wxALL, 5 );
146 wxBoxSizer *item9 =
new wxBoxSizer( wxHORIZONTAL );
148 wxButton *item10 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
149 item9->Add( item10, 0, wxALIGN_CENTER, 5 );
151 wxButton *item11 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
152 item9->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
154 item0->Add( item9, 0, wxALL, 5 );
158 parent->SetSizer( item0 );
160 item0->SetSizeHints( parent );