| 10 | /////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | ActionDialogBase::ActionDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) |
| 13 | { |
| 14 | this->SetSizeHints( wxDefaultSize, wxDefaultSize ); |
| 15 | |
| 16 | wxBoxSizer* mainSizer; |
| 17 | mainSizer = new wxBoxSizer( wxVERTICAL ); |
| 18 | |
| 19 | m_questionText = new wxStaticText( this, wxID_ANY, wxT("Question"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL ); |
| 20 | m_questionText->Wrap( -1 ); |
| 21 | mainSizer->Add( m_questionText, 1, wxALL|wxEXPAND, 5 ); |
| 22 | |
| 23 | wxBoxSizer* buttonSizer; |
| 24 | buttonSizer = new wxBoxSizer( wxHORIZONTAL ); |
| 25 | |
| 26 | m_cancelButton = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 27 | buttonSizer->Add( m_cancelButton, 1, wxALL|wxEXPAND, 5 ); |
| 28 | |
| 29 | m_okButton = new wxButton( this, wxID_ANY, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 30 | buttonSizer->Add( m_okButton, 1, wxALL|wxEXPAND, 5 ); |
| 31 | |
| 32 | |
| 33 | mainSizer->Add( buttonSizer, 1, wxEXPAND, 5 ); |
| 34 | |
| 35 | |
| 36 | this->SetSizer( mainSizer ); |
| 37 | this->Layout(); |
| 38 | mainSizer->Fit( this ); |
| 39 | |
| 40 | this->Centre( wxBOTH ); |
| 41 | |
| 42 | // Connect Events |
| 43 | m_cancelButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ActionDialogBase::onClickCancel ), NULL, this ); |
| 44 | m_okButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ActionDialogBase::onClickOK ), NULL, this ); |
| 45 | } |
| 46 | |
| 47 | ActionDialogBase::~ActionDialogBase() |
| 48 | { |