33 #include <boost/format.hpp>
36 #include <boost/regex.hpp>
63 wxDialog(parent, -1, _T(""),
65 path_(path), name_(_T("")){
67 createContents(
this,
true,
true);
69 SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
114 TransferDataFromWindow();
116 if (
name_ == _T(
"")) {
118 fmt %
"operation module";
125 const char* regExp =
"\\w+";
126 boost::regex expression(regExp);
127 boost::match_results<string::const_iterator> what;
128 if (!boost::regex_match(modName, what, expression)) {
143 string msg = fmt.str();
176 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
178 wxBoxSizer *item1 =
new wxBoxSizer( wxHORIZONTAL );
180 wxStaticText *item2 =
new wxStaticText( parent,
ID_TEXT, wxT(
"Name of the module:"), wxDefaultPosition, wxDefaultSize, 0 );
181 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
183 wxTextCtrl *item3 =
new wxTextCtrl( parent,
ID_MODULE_NAME, wxT(
""), wxDefaultPosition, wxSize(80,-1), wxTE_PROCESS_ENTER );
184 item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
186 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
188 wxBoxSizer *item4 =
new wxBoxSizer( wxHORIZONTAL );
190 wxButton *item5 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
191 item4->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
193 wxButton *item6 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
194 item4->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
196 item0->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
200 parent->SetSizer( item0 );
202 item0->SetSizeHints( parent );