X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f75cb6c75a8f08c7058170ca477698acb53328e..3baaf31317b1380ba9f33f8a23ff04bd20356d63:/samples/scrollsub/scrollsub.cpp diff --git a/samples/scrollsub/scrollsub.cpp b/samples/scrollsub/scrollsub.cpp index 9f649a562a..c53f93744b 100644 --- a/samples/scrollsub/scrollsub.cpp +++ b/samples/scrollsub/scrollsub.cpp @@ -112,6 +112,7 @@ public: void OnAbout( wxCommandEvent &event ); void OnQuit( wxCommandEvent &event ); + void OnFullScreen( wxCommandEvent &event ); wxScrolledWindow *m_scrolled; wxTextCtrl *m_log; @@ -307,7 +308,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) // Has the region on screen been exposed? if (IsExposed(0,0,100,25)) { - wxLogMessage( "Redraw first cell" ); + wxLogMessage( wxT("Redraw first cell") ); dc.DrawRectangle( 0, 0, 100, 25 ); dc.DrawText( "First Cell", 5, 5 ); } @@ -322,7 +323,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) // Has the region on screen been exposed? if (IsExposed(200,0,100,25)) { - wxLogMessage( "Redraw second cell" ); + wxLogMessage( wxT("Redraw second cell") ); dc.DrawRectangle( 200, 0, 100, 25 ); dc.DrawText( "Second Cell", 205, 5 ); } @@ -340,13 +341,15 @@ void MyCanvas::ScrollWindow( int dx, int dy, const wxRect *rect ) // MyFrame const int ID_QUIT = 108; -const int ID_ABOUT = 109; +const int ID_FULL = 109; +const int ID_ABOUT = 110; IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame ) BEGIN_EVENT_TABLE(MyFrame,wxFrame) EVT_MENU (ID_ABOUT, MyFrame::OnAbout) EVT_MENU (ID_QUIT, MyFrame::OnQuit) + EVT_MENU (ID_FULL, MyFrame::OnFullScreen) END_EVENT_TABLE() MyFrame::MyFrame() @@ -354,7 +357,8 @@ MyFrame::MyFrame() wxPoint(20,20), wxSize(470,500) ) { wxMenu *file_menu = new wxMenu(); - file_menu->Append( ID_ABOUT, "&About.."); + file_menu->Append( ID_ABOUT, "&About..."); + file_menu->Append( ID_FULL, "&Full screen on/off"); file_menu->Append( ID_QUIT, "E&xit\tAlt-X"); wxMenuBar *menu_bar = new wxMenuBar(); @@ -386,6 +390,11 @@ void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) Close( TRUE ); } +void MyFrame::OnFullScreen( wxCommandEvent &WXUNUSED(event) ) +{ + ShowFullScreen( !IsFullScreen(), wxFULLSCREEN_NOBORDER|wxFULLSCREEN_NOCAPTION ); +} + void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) { (void)wxMessageBox( "wxScroll demo II\n"