From 35960bbf2200d71e7ba5c8891f982c85585be064 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Sep 2004 22:36:01 +0000 Subject: [PATCH] added tests for EVT_ICONIZE/MAXIMIZE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 098505621e..4fea525155 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -177,6 +177,8 @@ public: void OnEnableAll(wxCommandEvent& event); void OnIdle( wxIdleEvent& event ); + void OnIconized( wxIconizeEvent& event ); + void OnMaximized( wxMaximizeEvent& event ); void OnSize( wxSizeEvent& event ); void OnMove( wxMoveEvent& event ); @@ -641,7 +643,6 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); button->SetDefault(); - button->SetForegroundColour(*wxBLUE); #if wxUSE_TOOLTIPS @@ -650,6 +651,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, _T("&Disable"), wxPoint(20,170) ); m_checkbox->SetValue(false); + button->MoveAfterInTabOrder(m_checkbox); #if wxUSE_TOOLTIPS m_checkbox->SetToolTip( _T("Click here to disable the listbox") ); #endif // wxUSE_TOOLTIPS @@ -1519,6 +1521,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(CONTROLS_ENABLE_ALL, MyFrame::OnEnableAll) + EVT_ICONIZE(MyFrame::OnIconized) + EVT_MAXIMIZE(MyFrame::OnMaximized) EVT_SIZE(MyFrame::OnSize) EVT_MOVE(MyFrame::OnMove) @@ -1642,6 +1646,18 @@ void MyFrame::OnMove( wxMoveEvent& event ) event.Skip(); } +void MyFrame::OnIconized( wxIconizeEvent& event ) +{ + wxLogMessage(_T("Frame %s"), event.Iconized() ? _T("iconized") + : _T("restored")); + event.Skip(); +} + +void MyFrame::OnMaximized( wxMaximizeEvent& WXUNUSED(event) ) +{ + wxLogMessage(_T("Frame maximized")); +} + void MyFrame::OnSize( wxSizeEvent& event ) { #if wxUSE_STATUSBAR -- 2.45.2