|
| 1 | + |
| 2 | + |
| 3 | +#include "wx/wxprec.h" |
| 4 | + |
| 5 | +#ifdef __BORLANDC__ |
| 6 | +#pragma hdrstop |
| 7 | +#endif //__BORLANDC__ |
| 8 | + |
| 9 | +#ifndef WX_PRECOMP |
| 10 | +#include <wx/wx.h> |
| 11 | +#endif //WX_PRECOMP |
| 12 | +#include "wx/utils.h" |
| 13 | +#include "AboutDialog.h" |
| 14 | +/////////////////////////////////////////////////////////////////////////// |
| 15 | + |
| 16 | +BEGIN_EVENT_TABLE(AboutDialog, wxDialog) |
| 17 | + EVT_BUTTON(linkButtonPress, AboutDialog::onLinkButton) |
| 18 | + EVT_BUTTON(closeButtonPress,AboutDialog::onClose) |
| 19 | +END_EVENT_TABLE() |
| 20 | + |
| 21 | +AboutDialog::AboutDialog( wxWindow* parent, int id, wxString title, wxPoint pos, wxSize size, int style ) : wxDialog( parent, id, title, pos, size, style ) |
| 22 | +{ |
| 23 | + wxBoxSizer* mainSizer; |
| 24 | + mainSizer = new wxBoxSizer( wxVERTICAL ); |
| 25 | + |
| 26 | + wxStaticBoxSizer* aboutSizer; |
| 27 | + aboutSizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, wxT("About:") ), wxHORIZONTAL ); |
| 28 | + |
| 29 | + logoBitmap = new wxStaticBitmap( this, ID_DEFAULT, wxBitmap( wxT("about.dat"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 ); |
| 30 | + aboutSizer->Add( logoBitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); |
| 31 | + |
| 32 | + wxBoxSizer* infoSizer; |
| 33 | + infoSizer = new wxBoxSizer( wxVERTICAL ); |
| 34 | + |
| 35 | + infoStaticText = new wxStaticText( this, ID_DEFAULT, wxT("Pillow 0.1a \n Billconan Studio 2006 \n Blog:http://billconan.blogspot.com"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 36 | + infoSizer->Add( infoStaticText, 1, wxALL, 5 ); |
| 37 | + |
| 38 | + linkButton = new wxButton( this, linkButtonPress, wxT("Go to the site!"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 39 | + infoSizer->Add( linkButton, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); |
| 40 | + |
| 41 | + aboutSizer->Add( infoSizer, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); |
| 42 | + |
| 43 | + mainSizer->Add( aboutSizer, 1, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); |
| 44 | + |
| 45 | + wxBoxSizer* buttonSizer; |
| 46 | + buttonSizer = new wxBoxSizer( wxVERTICAL ); |
| 47 | + |
| 48 | + closeButton = new wxButton( this, closeButtonPress, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 49 | + buttonSizer->Add( closeButton, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); |
| 50 | + |
| 51 | + mainSizer->Add( buttonSizer, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); |
| 52 | + |
| 53 | + this->SetSizer( mainSizer ); |
| 54 | + this->Layout(); |
| 55 | + this->Fit(); |
| 56 | +} |
| 57 | + |
| 58 | +void AboutDialog::onLinkButton(wxCommandEvent& event) |
| 59 | +{ |
| 60 | + wxLaunchDefaultBrowser(_T("http://billconan.blogspot.com")); |
| 61 | + event; |
| 62 | +}; |
| 63 | + |
| 64 | +void AboutDialog::onClose(wxCommandEvent& event) |
| 65 | +{ |
| 66 | + Close(); |
| 67 | + event; |
| 68 | +}; |
| 69 | + |
| 70 | +//AboutDialog::~AboutDialog(void){} |
0 commit comments