X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ebcf581f6e8355224b00bc5b2d70b12e761b750..639848874998378be6823c5243641eb643a0b0bf:/samples/mobile/styles/styles.cpp diff --git a/samples/mobile/styles/styles.cpp b/samples/mobile/styles/styles.cpp index f1023b27e5..45dd662332 100644 --- a/samples/mobile/styles/styles.cpp +++ b/samples/mobile/styles/styles.cpp @@ -2,13 +2,9 @@ // Name: styles.cpp // Author: Robert Roebling // Created: 04/07/02 -// Copyright: +// Copyright: ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "styles.cpp" -#endif - // For compilers that support precompilation #include "wx/wxprec.h" @@ -16,6 +12,8 @@ #pragma hdrstop #endif +#include "wx/image.h" + // Include private headers #include "styles.h" @@ -35,44 +33,47 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title, { // Create menu and status bar. CreateMyMenuBar(); +#if wxUSE_STATUSBAR CreateStatusBar(1); - SetStatusText( "Welcome to Styles!" ); - - + SetStatusText( _T("Welcome to Styles!") ); +#endif // wxUSE_STATUSBAR + wxImage image; - image.LoadFile( "marble.jpg", wxBITMAP_TYPE_JPEG ); - + image.LoadFile( _T("marble.jpg"), wxBITMAP_TYPE_JPEG ); + wxBitmap bitmap( image ); +#ifdef __WXUNIVERSAL__ SetBackground( bitmap, 0, wxTILE ); - - new wxStaticText( this, -1, "This is text", wxPoint( 20,50 ) ); - - new wxCheckBox( this, -1, "This is a checkbox", wxPoint( 20,70 ) ); +#endif + + new wxStaticText( this, wxID_ANY, _T("This is text"), wxPoint( 20,50 ) ); + + new wxCheckBox( this, wxID_ANY, _T("This is a checkbox"), wxPoint( 20,70 ) ); } void MyFrame::CreateMyMenuBar() { wxMenu *file_menu = new wxMenu; - file_menu->Append( ID_ABOUT, "About...", "Program info" ); + file_menu->Append( ID_ABOUT, _T("About..."), _T("Program info") ); file_menu->AppendSeparator(); - file_menu->Append( ID_QUIT, "Quit...", "Quit program" ); + file_menu->Append( ID_QUIT, _T("Quit..."), _T("Quit program") ); wxMenuBar *menu_bar = new wxMenuBar(); - menu_bar->Append( file_menu, "&File" ); - + menu_bar->Append( file_menu, _T("&File") ); + SetMenuBar( menu_bar ); } -void MyFrame::OnAbout( wxCommandEvent &event ) +void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) { } -void MyFrame::OnQuit( wxCommandEvent &event ) +void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) { - Close( TRUE ); + Close( true ); } -void MyFrame::OnCloseWindow( wxCloseEvent &event ) +void MyFrame::OnCloseWindow( wxCloseEvent &WXUNUSED(event) ) { Destroy(); } @@ -83,21 +84,17 @@ void MyFrame::OnCloseWindow( wxCloseEvent &event ) IMPLEMENT_APP(MyApp) -MyApp::MyApp() -{ -} - bool MyApp::OnInit() { wxInitAllImageHandlers(); - SetVendorName("Free world"); - SetAppName("Styles"); - - MyFrame *frame = new MyFrame( NULL, -1, "Styles", wxPoint(20,20), wxSize(500,340) ); - frame->Show( TRUE ); - - return TRUE; + SetVendorName(_T("Free world")); + SetAppName(_T("Styles")); + + MyFrame *frame = new MyFrame( NULL, wxID_ANY, _T("Styles"), wxPoint(20,20), wxSize(500,340) ); + frame->Show( true ); + + return true; } int MyApp::OnExit()