]>
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.
42 SetStatusText( _T("Welcome to Styles!") );
43 #endif // wxUSE_STATUSBAR
46 image
.LoadFile( _T("marble.jpg"), wxBITMAP_TYPE_JPEG
);
48 wxBitmap
bitmap( image
);
49 #ifdef __WXUNIVERSAL__
50 SetBackground( bitmap
, 0, wxTILE
);
53 new wxStaticText( this, wxID_ANY
, _T("This is text"), wxPoint( 20,50 ) );
55 new wxCheckBox( this, wxID_ANY
, _T("This is a checkbox"), wxPoint( 20,70 ) );
58 void MyFrame::CreateMyMenuBar()
60 wxMenu
*file_menu
= new wxMenu
;
61 file_menu
->Append( ID_ABOUT
, _T("About..."), _T("Program info") );
62 file_menu
->AppendSeparator();
63 file_menu
->Append( ID_QUIT
, _T("Quit..."), _T("Quit program") );
65 wxMenuBar
*menu_bar
= new wxMenuBar();
66 menu_bar
->Append( file_menu
, _T("&File") );
68 SetMenuBar( menu_bar
);
71 void MyFrame::OnAbout( wxCommandEvent
&WXUNUSED(event
) )
75 void MyFrame::OnQuit( wxCommandEvent
&WXUNUSED(event
) )
80 void MyFrame::OnCloseWindow( wxCloseEvent
&WXUNUSED(event
) )
85 //------------------------------------------------------------------------------
87 //------------------------------------------------------------------------------
97 wxInitAllImageHandlers();
99 SetVendorName(_T("Free world"));
100 SetAppName(_T("Styles"));
102 MyFrame
*frame
= new MyFrame( NULL
, wxID_ANY
, _T("Styles"), wxPoint(20,20), wxSize(500,340) );