]>
git.saurik.com Git - wxWidgets.git/blob - samples/wxtest/test.cpp
1 /////////////////////////////////////////////////////////////////////////////
6 /////////////////////////////////////////////////////////////////////////////
9 #pragma implementation "test.cpp"
12 // For compilers that support precompilation
13 #include "wx/wxprec.h"
19 // Include private headers
22 // WDR: class implementations
24 //----------------------------------------------------------------------------
26 //----------------------------------------------------------------------------
28 // WDR: event table for MyDialog
30 BEGIN_EVENT_TABLE(MyDialog
,wxDialog
)
33 MyDialog::MyDialog( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
34 const wxPoint
&position
, const wxSize
& size
, long style
) :
35 wxDialog( parent
, id
, title
, position
, size
, style
|wxRESIZE_BORDER
)
37 MyDialogFunc( this, TRUE
);
42 bool MyDialog::Validate()
47 bool MyDialog::TransferDataToWindow()
52 bool MyDialog::TransferDataFromWindow()
57 // WDR: handler implementations for MyDialog
60 //------------------------------------------------------------------------------
62 //------------------------------------------------------------------------------
64 // WDR: event table for MyFrame
66 BEGIN_EVENT_TABLE(MyFrame
,wxFrame
)
67 EVT_MENU(ID_ABOUT
, MyFrame::OnAbout
)
68 EVT_MENU(ID_QUIT
, MyFrame::OnQuit
)
69 EVT_CLOSE(MyFrame::OnCloseWindow
)
70 EVT_MENU( ID_TEST
, MyFrame::OnTest
)
73 MyFrame::MyFrame( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
74 const wxPoint
&position
, const wxSize
& size
, long style
) :
75 wxFrame( parent
, id
, title
, position
, size
, style
)
80 SetStatusText( _T("Welcome!") );
82 // insert main window here
85 void MyFrame::CreateMyMenuBar()
88 wxApp::s_macAboutMenuItemId
= ID_ABOUT
;
91 SetMenuBar( MyMenuBarFunc() );
94 // WDR: handler implementations for MyFrame
96 void MyFrame::OnTest( wxCommandEvent
&WXUNUSED(event
) )
98 MyDialog
dialog( this, -1, _T("Test") );
102 void MyFrame::OnAbout( wxCommandEvent
&WXUNUSED(event
) )
104 wxMessageDialog
dialog( this, _T("Welcome to SuperApp 1.0\n(C)opyright Joe Hacker"),
105 _T("About SuperApp"), wxOK
|wxICON_INFORMATION
);
109 void MyFrame::OnQuit( wxCommandEvent
&WXUNUSED(event
) )
114 void MyFrame::OnCloseWindow( wxCloseEvent
&WXUNUSED(event
) )
116 // if ! saved changes -> return
121 //------------------------------------------------------------------------------
123 //------------------------------------------------------------------------------
133 MyFrame
*frame
= new MyFrame( NULL
, -1, _T("SuperApp"), wxPoint(20,20), wxSize(500,340) );