]>
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 SetBackground( bitmap
, 0, wxTILE
);
49 new wxStaticText( this, -1, "This is text", wxPoint( 20,50 ) );
51 new wxCheckBox( this, -1, "This is a checkbox", wxPoint( 20,70 ) );
54 void MyFrame::CreateMyMenuBar()
56 wxMenu
*file_menu
= new wxMenu
;
57 file_menu
->Append( ID_ABOUT
, "About...", "Program info" );
58 file_menu
->AppendSeparator();
59 file_menu
->Append( ID_QUIT
, "Quit...", "Quit program" );
61 wxMenuBar
*menu_bar
= new wxMenuBar();
62 menu_bar
->Append( file_menu
, "&File" );
64 SetMenuBar( menu_bar
);
67 void MyFrame::OnAbout( wxCommandEvent
&event
)
71 void MyFrame::OnQuit( wxCommandEvent
&event
)
76 void MyFrame::OnCloseWindow( wxCloseEvent
&event
)
81 //------------------------------------------------------------------------------
83 //------------------------------------------------------------------------------
93 wxInitAllImageHandlers();
95 SetVendorName("Free world");
98 MyFrame
*frame
= new MyFrame( NULL
, -1, "Styles", wxPoint(20,20), wxSize(500,340) );