34 #include <wx/statline.h>
41 #if wxCHECK_VERSION(3, 0, 0)
42 #define wxSAVE wxFD_SAVE
61 lineReader_(lineReader) {
63 createContents(
this,
true,
true);
64 cmdList_ =
dynamic_cast<wxListBox*
>(
FindWindow(ID_LIST));
112 GetParent()->Close();
134 wxString title = _T(
"Save Command History");
135 wxString filters = _T(
"Command history logs (*.log)|*.log|All files|*.*");
137 this, title, _T(
""), _T(
"commands.log"), filters, wxSAVE);
139 if (dialog.ShowModal() == wxID_CANCEL) {
145 std::ofstream file(filename.c_str());
147 wxString message = _T(
"Error saving file '.");
148 message.Append(dialog.GetPath());
149 message.Append(_T(
"'."));
156 for (
size_t i = 0; i < cmdCount; i++) {
157 std::string command =
159 file << command << std::endl;
178 wxWindow *parent,
bool call_fit,
bool set_sizer) {
180 wxFlexGridSizer *item0 =
new wxFlexGridSizer( 1, 0, 0 );
181 item0->AddGrowableCol( 0 );
182 item0->AddGrowableRow( 0 );
184 wxString *strs1 = (wxString*) NULL;
185 wxListBox *item1 =
new wxListBox( parent,
ID_LIST, wxDefaultPosition, wxSize(300,300), 0, strs1, wxLB_SINGLE );
186 item0->Add( item1, 0, wxGROW|wxALL, 5 );
188 wxStaticLine *item2 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
189 item0->Add( item2, 0, wxGROW|wxALL, 5 );
191 wxBoxSizer *item3 =
new wxBoxSizer( wxHORIZONTAL );
193 wxButton *item4 =
new wxButton( parent,
ID_SAVE, wxT(
"&Save"), wxDefaultPosition, wxDefaultSize, 0 );
194 item3->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
196 wxStaticLine *item5 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL );
197 item3->Add( item5, 0, wxGROW|wxALL, 5 );
199 wxButton *item6 =
new wxButton( parent,
ID_CLOSE, wxT(
"&Close"), wxDefaultPosition, wxDefaultSize, 0 );
200 item3->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
202 item0->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
206 parent->SetSizer( item0 );
208 item0->SetSizeHints( parent );