]>
git.saurik.com Git - wxWidgets.git/blob - samples/mobile/styles/styles.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Author: Robert Roebling
6 /////////////////////////////////////////////////////////////////////////////
9 #pragma implementation "styles.cpp"
12 // For compilers that support precompilation
13 #include "wx/wxprec.h"
21 // Include private headers
24 //------------------------------------------------------------------------------
26 //------------------------------------------------------------------------------
28 BEGIN_EVENT_TABLE(MyFrame
,wxFrame
)
29 EVT_MENU(ID_ABOUT
, MyFrame::OnAbout
)
30 EVT_MENU(ID_QUIT
, MyFrame::OnQuit
)
31 EVT_CLOSE(MyFrame::OnCloseWindow
)
34 MyFrame::MyFrame( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
35 const wxPoint
&position
, const wxSize
& size
, long style
) :
36 wxFrame( parent
, id
, title
, position
, size
, style
)
38 // Create menu and status bar.
41 SetStatusText( "Welcome to Styles!" );
44 image
.LoadFile( "marble.jpg", wxBITMAP_TYPE_JPEG
);
46 wxBitmap
bitmap( image
);
47 #ifdef __WXUNIVERSAL__
48 SetBackground( bitmap
, 0, wxTILE
);
51 new wxStaticText( this, -1, "This is text", wxPoint( 20,50 ) );
53 new wxCheckBox( this, -1, "This is a checkbox", wxPoint( 20,70 ) );
56 void MyFrame::CreateMyMenuBar()
58 wxMenu
*file_menu
= new wxMenu
;
59 file_menu
->Append( ID_ABOUT
, "About...", "Program info" );
60 file_menu
->AppendSeparator();
61 file_menu
->Append( ID_QUIT
, "Quit...", "Quit program" );
63 wxMenuBar
*menu_bar
= new wxMenuBar();
64 menu_bar
->Append( file_menu
, "&File" );
66 SetMenuBar( menu_bar
);
69 void MyFrame::OnAbout( wxCommandEvent
&event
)
73 void MyFrame::OnQuit( wxCommandEvent
&event
)
78 void MyFrame::OnCloseWindow( wxCloseEvent
&event
)
83 //------------------------------------------------------------------------------
85 //------------------------------------------------------------------------------
95 wxInitAllImageHandlers();
97 SetVendorName("Free world");
100 MyFrame
*frame
= new MyFrame( NULL
, -1, "Styles", wxPoint(20,20), wxSize(500,340) );