From 3d8dea7e2e10502846e18189a8d894e27effdb23 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Dec 2000 12:04:19 +0000 Subject: [PATCH 1/1] merged in the small changes from the 2.2 branch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/mdi/mdi.cpp | 12 ++++++++++++ samples/mdi/mdi.h | 2 ++ src/msw/mdi.cpp | 26 +++++++++++++++----------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index e3d07b8180..eb98b73dee 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -86,6 +86,13 @@ BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame) EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) + EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) + EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) + + EVT_UPDATE_UI(MDI_REFRESH, MyChild::OnUpdateRefresh) + + EVT_SIZE(MyChild::OnSize) + EVT_MOVE(MyChild::OnMove) EVT_CLOSE(MyChild::OnClose) END_EVENT_TABLE() @@ -421,6 +428,11 @@ void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event)) Close(TRUE); } +void MyChild::OnUpdateRefresh(wxUpdateUIEvent& event) +{ + event.Enable( canvas && canvas->IsDirty() ); +} + void MyChild::OnRefresh(wxCommandEvent& WXUNUSED(event)) { if ( canvas ) diff --git a/samples/mdi/mdi.h b/samples/mdi/mdi.h index b05f205a02..cea871baf8 100644 --- a/samples/mdi/mdi.h +++ b/samples/mdi/mdi.h @@ -68,6 +68,8 @@ public: void OnQuit(wxCommandEvent& event); void OnClose(wxCloseEvent& event); + void OnUpdateRefresh(wxUpdateUIEvent& event); + DECLARE_EVENT_TABLE() }; diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 2b9ff86e5e..2aa8a208f7 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -163,25 +163,29 @@ bool wxMDIParentFrame::Create(wxWindow *parent, long style, const wxString& name) { - m_defaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON : wxDEFAULT_MDIPARENTFRAME_ICON); + m_defaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON + ? wxSTD_MDIPARENTFRAME_ICON + : wxDEFAULT_MDIPARENTFRAME_ICON); m_clientWindow = NULL; m_currentChild = NULL; - if (style & wxFRAME_NO_WINDOW_MENU) - m_windowMenu = (wxMenu*) NULL; - else + // this style can be used to prevent a window from having the standard MDI + // "Window" menu + if ( style & wxFRAME_NO_WINDOW_MENU ) + { + m_windowMenu = (wxMenu *)NULL; + } + else // normal case: we have the window menu, so construct it { - // m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), wxT("wxWindowMenu")); m_windowMenu = new wxMenu; - - m_windowMenu->Append(4002, wxT("&Cascade")); - m_windowMenu->Append(4001, wxT("Tile &Horizontally")); - m_windowMenu->Append(4005, wxT("Tile &Vertically")); + m_windowMenu->Append(IDM_WINDOWCASCADE, wxT("&Cascade")); + m_windowMenu->Append(IDM_WINDOWTILEHOR, wxT("Tile &Horizontally")); + m_windowMenu->Append(IDM_WINDOWTILEVERT, wxT("Tile &Vertically")); m_windowMenu->AppendSeparator(); - m_windowMenu->Append(4003, wxT("&Arrange Icons")); - m_windowMenu->Append(4004, wxT("&Next")); + m_windowMenu->Append(IDM_WINDOWICONS, wxT("&Arrange Icons")); + m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next")); } m_parentFrameActive = TRUE; -- 2.45.2