1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#include "wxQuestionMain.h"
//helper functions
enum wxbuildinfoformat {
short_f, long_f };
wxString wxbuildinfo(wxbuildinfoformat format)
{
wxString wxbuild(wxVERSION_STRING);
if (format == long_f )
{
#if defined(__WXMSW__)
wxbuild << _T("-Windows");
#elif defined(__WXMAC__)
wxbuild << _T("-Mac");
#elif defined(__UNIX__)
wxbuild << _T("-Linux");
#endif
#if wxUSE_UNICODE
wxbuild << _T("-Unicode build");
#else
wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
}
return wxbuild;
}
BEGIN_EVENT_TABLE(wxQuestionDialog, wxDialog)
EVT_CLOSE(wxQuestionDialog::OnClose)
EVT_BUTTON(idBtnGo, wxQuestionDialog::OnGo)
END_EVENT_TABLE()
wxQuestionDialog::wxQuestionDialog(wxDialog *dlg, const wxString &title)
: wxDialog(dlg, -1, title)
{
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer(wxHORIZONTAL);
m_staticText1 = new wxStaticText(this, wxID_ANY, wxT("Welcome To\nwxWidgets"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText1->SetFont(wxFont(20, 74, 90, 90, false, wxT("Arial")));
bSizer1->Add(m_staticText1, 0, wxALL|wxEXPAND, 5);
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer(wxVERTICAL);
wxPoint textCtrl1Position(5,5); //Position
wxSize textCtrl1size(120,25); //Size
textCtrl1 = new wxTextCtrl(this, wxID_ANY, "hi", wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, "textCtrl1"); //Create textCtrl
bSizer2->Add(textCtrl1, 0, wxALL|wxEXPAND, 5); //Add to sizer
m_staticline1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL);
bSizer2->Add(m_staticline1, 0, wxALL|wxEXPAND, 5);
BtnGo = new wxButton(this, idBtnGo, wxT("&Go"), wxDefaultPosition, wxDefaultSize, 0);
bSizer2->Add(BtnGo, 0, wxALL, 5);
bSizer1->Add(bSizer2, 1, wxEXPAND, 5);
this->SetSizer(bSizer1);
this->Layout();
bSizer1->Fit(this);
}
wxQuestionDialog::~wxQuestionDialog()
{
}
void wxQuestionDialog::OnClose(wxCloseEvent &event)
{
Destroy();
}
void wxQuestionDialog::OnGo(wxCommandEvent &event)
{
somefunction();
}
|