]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/mdi.cpp
More make install tweaks.
[wxWidgets.git] / src / os2 / mdi.cpp
index 33756f07928a7226a154bb9f406b1a2f6307d840..1fccebacb2b32ee3b88f82158db372053a6ed091 100644 (file)
@@ -37,8 +37,6 @@
 extern wxWindowList wxModelessWindows;      // from dialog.cpp
 extern wxMenu *wxCurrentPopupMenu;
 
 extern wxWindowList wxModelessWindows;      // from dialog.cpp
 extern wxMenu *wxCurrentPopupMenu;
 
-extern wxChar wxMDIFrameClassName[];
-extern wxChar wxMDIChildFrameClassName[];
 extern wxWindow *wxWndHook;                 // from window.cpp
 
 extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
 extern wxWindow *wxWndHook;                 // from window.cpp
 
 extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
@@ -82,9 +80,17 @@ inline bool IsMdiCommandId(int id)
     return (id >= wxFIRST_MDI_CHILD) && (id <= wxLAST_MDI_CHILD);
 }
 
     return (id >= wxFIRST_MDI_CHILD) && (id <= wxLAST_MDI_CHILD);
 }
 
+// unpack the parameters of WM_MDIACTIVATE message
 static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam,
                               WXWORD *activate, WXHWND *hwndAct, WXHWND *hwndDeact);
 
 static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam,
                               WXWORD *activate, WXHWND *hwndAct, WXHWND *hwndDeact);
 
+// return the HMENU of the MDI menu
+static inline HMENU GetMDIWindowMenu(wxMDIParentFrame *frame)
+{
+    wxMenu *menu = frame->GetWindowMenu();
+    return menu ? GetHmenuOf(menu) : 0;
+}
+
 // ===========================================================================
 // implementation
 // ===========================================================================
 // ===========================================================================
 // implementation
 // ===========================================================================
@@ -93,11 +99,9 @@ static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam,
 // wxWin macros
 // ---------------------------------------------------------------------------
 
 // wxWin macros
 // ---------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARY
     IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
     IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
     IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
     IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
     IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
     IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
-#endif // USE_SHARED_LIBRARY
 
 BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
     EVT_SIZE(wxMDIParentFrame::OnSize)
 
 BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
     EVT_SIZE(wxMDIParentFrame::OnSize)
@@ -129,7 +133,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
                               long style,
                               const wxString& name)
 {
                               long style,
                               const wxString& name)
 {
-  m_defaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON : wxDEFAULT_MDIPARENTFRAME_ICON);
+  m_hDefaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON : wxDEFAULT_MDIPARENTFRAME_ICON);
 
   m_clientWindow = NULL;
   m_currentChild = NULL;
 
   m_clientWindow = NULL;
   m_currentChild = NULL;
@@ -140,6 +144,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
     wxTopLevelWindows.Append(this);
 
   SetName(name);
     wxTopLevelWindows.Append(this);
 
   SetName(name);
+  wxWindowBase::Show(TRUE); // MDI child frame starts off shown
   m_windowStyle = style;
 
   if (parent) parent->AddChild(this);
   m_windowStyle = style;
 
   if (parent) parent->AddChild(this);
@@ -249,7 +254,7 @@ void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 {
     if ( m_clientWindow )
     {
 {
     if ( m_clientWindow )
     {
-        m_clientWindow->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+        m_clientWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
         m_clientWindow->Refresh();
     }
 
         m_clientWindow->Refresh();
     }
 
@@ -290,8 +295,7 @@ void wxMDIParentFrame::ActivatePrevious()
 // the MDI parent frame window proc
 // ---------------------------------------------------------------------------
 
 // the MDI parent frame window proc
 // ---------------------------------------------------------------------------
 
-MRESULT wxMDIParentFrame::OS2WindowProc(HWND     hwnd,
-                                        WXUINT message,
+MRESULT wxMDIParentFrame::OS2WindowProc(WXUINT message,
                                         WXWPARAM wParam,
                                         WXLPARAM lParam)
 {
                                         WXWPARAM wParam,
                                         WXLPARAM lParam)
 {
@@ -377,7 +381,7 @@ MRESULT wxMDIParentFrame::OS2WindowProc(HWND     hwnd,
     }
 */
     if ( !processed )
     }
 */
     if ( !processed )
-        rc = wxFrame::OS2WindowProc(hwnd, message, wParam, lParam);
+        rc = wxFrame::OS2WindowProc(message, wParam, lParam);
 
     return rc;
 }
 
     return rc;
 }
@@ -420,7 +424,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
 
     // is it one of standard MDI commands?
     WXWPARAM wParam = 0;
 
     // is it one of standard MDI commands?
     WXWPARAM wParam = 0;
-    int msg;
+    int msg = 0;
 
     // TODO:
 /*
 
     // TODO:
 /*
@@ -506,8 +510,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
     return FALSE;
 }
 
     return FALSE;
 }
 
-MRESULT wxMDIParentFrame::OS2DefWindowProc(HWND hwnd,
-                                           WXUINT message,
+MRESULT wxMDIParentFrame::OS2DefWindowProc(WXUINT message,
                                            WXWPARAM wParam,
                                            WXLPARAM lParam)
 {
                                            WXWPARAM wParam,
                                            WXLPARAM lParam)
 {
@@ -561,8 +564,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
                              long style,
                              const wxString& name)
 {
                              long style,
                              const wxString& name)
 {
-  m_defaultIcon = (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
-                                                     : wxDEFAULT_MDICHILDFRAME_ICON);
+  m_hDefaultIcon = (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
+                                                      : wxDEFAULT_MDICHILDFRAME_ICON);
 
   SetName(name);
 
 
   SetName(name);
 
@@ -776,8 +779,7 @@ void wxMDIChildFrame::Activate()
 // MDI window proc and message handlers
 // ---------------------------------------------------------------------------
 
 // MDI window proc and message handlers
 // ---------------------------------------------------------------------------
 
-MRESULT wxMDIChildFrame::OS2WindowProc(HWND hwnd,
-                                       WXUINT message,
+MRESULT wxMDIChildFrame::OS2WindowProc(WXUINT message,
                                        WXWPARAM wParam,
                                        WXLPARAM lParam)
 {
                                        WXWPARAM wParam,
                                        WXLPARAM lParam)
 {
@@ -838,7 +840,7 @@ MRESULT wxMDIChildFrame::OS2WindowProc(HWND hwnd,
     }
 */
     if ( !processed )
     }
 */
     if ( !processed )
-        rc = wxFrame::OS2WindowProc(hwnd, message, wParam, lParam);
+        rc = wxFrame::OS2WindowProc(message, wParam, lParam);
 
     return rc;
 }
 
     return rc;
 }
@@ -989,7 +991,7 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos)
 // MDI specific message translation/preprocessing
 // ---------------------------------------------------------------------------
 
 // MDI specific message translation/preprocessing
 // ---------------------------------------------------------------------------
 
-MRESULT wxMDIChildFrame::OS2DefWindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+MRESULT wxMDIChildFrame::OS2DefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
 {
     // TODO
 /*
 {
     // TODO
 /*
@@ -1001,7 +1003,12 @@ MRESULT wxMDIChildFrame::OS2DefWindowProc(HWND hwnd, WXUINT message, WXWPARAM wP
 
 bool wxMDIChildFrame::OS2TranslateMessage(WXMSG* msg)
 {
 
 bool wxMDIChildFrame::OS2TranslateMessage(WXMSG* msg)
 {
-    return m_acceleratorTable.Translate(GetParent(), msg);
+#if wxUSE_ACCEL
+    return m_acceleratorTable.Translate(GetParent()->GetHWND(), msg);
+#else
+    return FALSE;
+#endif  //wxUSE_ACCEL
+
 }
 
 // ---------------------------------------------------------------------------
 }
 
 // ---------------------------------------------------------------------------
@@ -1046,7 +1053,7 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect)
 
 bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
 {
 
 bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
 {
-    m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE);
+    m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
 
     // TODO:
 /*
 
     // TODO:
 /*