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
|
BEGIN_EVENT_TABLE(AboutTest, wxDialog)
EVT_CLOSE(AboutTest::OnClose)
EVT_BUTTON(wxID_CLOSE, AboutTest::CloseClick)
END_EVENT_TABLE()
AboutTest::AboutTest(wxWindow *parent, wxWindowID id,
const wxString &title, const wxPoint &position,
const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
void AboutTest::CreateGUIControls()
{
m_Close = new wxButton(this, wxID_CLOSE, wxT("Close"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxMemoryInputStream istream(test_logo_png, sizeof test_logo_png);
wxImage iTestLogo(istream, wxBITMAP_TYPE_PNG);
sbTestLogo = new wxStaticBitmap(this, ID_LOGO,
wxBitmap(iTestLogo), wxDefaultPosition, wxDefaultSize, 0);
std::string Text = std::string("") +
"Test SVN revision " + svn_rev_str + "\n"
"Copyright (c) 2010+ Team\n"
"\n"
"Just an example"
;
Message = new wxStaticText(this, ID_MESSAGE,
wxString::FromAscii(Text.c_str()),
wxDefaultPosition, wxDefaultSize, 0);
Message->Wrap(this->GetSize().GetWidth());
sMain = new wxBoxSizer(wxVERTICAL);
sMainHor = new wxBoxSizer(wxHORIZONTAL);
sMainHor->Add(sbTestLogo);
sInfo = new wxBoxSizer(wxVERTICAL);
sInfo->Add(Message, 1, wxEXPAND|wxALL, 5);
sMainHor->Add(sInfo);
sMain->Add(sMainHor, 1, wxEXPAND);
sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND);
this->SetSizer(sMain);
sMain->Layout();
Fit();
CenterOnParent();
} |