]>
git.saurik.com Git - wxWidgets.git/blob - samples/mobile/styles/styles.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Author: Robert Roebling
6 /////////////////////////////////////////////////////////////////////////////
8 // For compilers that support precompilation
17 // Include private headers
20 //------------------------------------------------------------------------------
22 //------------------------------------------------------------------------------
24 BEGIN_EVENT_TABLE(MyFrame
,wxFrame
)
25 EVT_MENU(ID_ABOUT
, MyFrame::OnAbout
)
26 EVT_MENU(ID_QUIT
, MyFrame::OnQuit
)
27 EVT_CLOSE(MyFrame::OnCloseWindow
)
30 MyFrame::MyFrame( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
31 const wxPoint
&position
, const wxSize
& size
, long style
) :
32 wxFrame( parent
, id
, title
, position
, size
, style
)
34 // Create menu and status bar.
38 SetStatusText( _T("Welcome to Styles!") );
39 #endif // wxUSE_STATUSBAR
42 image
.LoadFile( _T("marble.jpg"), wxBITMAP_TYPE_JPEG
);
44 wxBitmap
bitmap( image
);
45 #ifdef __WXUNIVERSAL__
46 SetBackground( bitmap
, 0, wxTILE
);
49 new wxStaticText( this, wxID_ANY
, _T("This is text"), wxPoint( 20,50 ) );
51 new wxCheckBox( this, wxID_ANY
, _T("This is a checkbox"), wxPoint( 20,70 ) );
54 void MyFrame::CreateMyMenuBar()
56 wxMenu
*file_menu
= new wxMenu
;
57 file_menu
->Append( ID_ABOUT
, _T("About..."), _T("Program info") );
58 file_menu
->AppendSeparator();
59 file_menu
->Append( ID_QUIT
, _T("Quit..."), _T("Quit program") );
61 wxMenuBar
*menu_bar
= new wxMenuBar();
62 menu_bar
->Append( file_menu
, _T("&File") );
64 SetMenuBar( menu_bar
);
67 void MyFrame::OnAbout( wxCommandEvent
&WXUNUSED(event
) )
71 void MyFrame::OnQuit( wxCommandEvent
&WXUNUSED(event
) )
76 void MyFrame::OnCloseWindow( wxCloseEvent
&WXUNUSED(event
) )
81 //------------------------------------------------------------------------------
83 //------------------------------------------------------------------------------
89 wxInitAllImageHandlers();
91 SetVendorName(_T("Free world"));
92 SetAppName(_T("Styles"));
94 MyFrame
*frame
= new MyFrame( NULL
, wxID_ANY
, _T("Styles"), wxPoint(20,20), wxSize(500,340) );