]>
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"
19 // Include private headers
22 //------------------------------------------------------------------------------
24 //------------------------------------------------------------------------------
26 BEGIN_EVENT_TABLE(MyFrame
,wxFrame
)
27 EVT_MENU(ID_ABOUT
, MyFrame::OnAbout
)
28 EVT_MENU(ID_QUIT
, MyFrame::OnQuit
)
29 EVT_CLOSE(MyFrame::OnCloseWindow
)
32 MyFrame::MyFrame( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
33 const wxPoint
&position
, const wxSize
& size
, long style
) :
34 wxFrame( parent
, id
, title
, position
, size
, style
)
36 // Create menu and status bar.
39 SetStatusText( "Welcome to Styles!" );
43 image
.LoadFile( "marble.jpg", wxBITMAP_TYPE_JPEG
);
45 wxBitmap
bitmap( image
);
46 SetBackground( bitmap
, 0, wxTILE
);
48 new wxStaticText( this, -1, "This is text", wxPoint( 20,50 ) );
50 new wxCheckBox( this, -1, "This is a checkbox", wxPoint( 20,70 ) );
53 void MyFrame::CreateMyMenuBar()
55 wxMenu
*file_menu
= new wxMenu
;
56 file_menu
->Append( ID_ABOUT
, "About...", "Program info" );
57 file_menu
->AppendSeparator();
58 file_menu
->Append( ID_QUIT
, "Quit...", "Quit program" );
60 wxMenuBar
*menu_bar
= new wxMenuBar();
61 menu_bar
->Append( file_menu
, "&File" );
63 SetMenuBar( menu_bar
);
66 void MyFrame::OnAbout( wxCommandEvent
&event
)
70 void MyFrame::OnQuit( wxCommandEvent
&event
)
75 void MyFrame::OnCloseWindow( wxCloseEvent
&event
)
80 //------------------------------------------------------------------------------
82 //------------------------------------------------------------------------------
92 wxInitAllImageHandlers();
94 SetVendorName("Free world");
97 MyFrame
*frame
= new MyFrame( NULL
, -1, "Styles", wxPoint(20,20), wxSize(500,340) );