]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/os2/frame.h
No changes, synchronised source names that appear commented at the top of files with...
[wxWidgets.git] / include / wx / os2 / frame.h
index 94fe07be61f129c9e76b471b1c9aced3500bb8b0..c79181518bec5847dd69d54f0159ae81ff1c9fef 100644 (file)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        frame.h
+// Name:        wx/os2/frame.h
 // Purpose:     wxFrame class
 // Author:      David Webster
 // Modified by:
 // Created:     10/27/99
 // RCS-ID:      $Id$
 // Copyright:   (c) David Webster
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_FRAME_H_
 //
 // Get the default resource ID's for frames
 //
-#include "wx/os2/wxOs2.h"
+#include "wx/os2/wxrsc.h"
 
-class WXDLLEXPORT wxFrame : public wxFrameBase
+class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
 {
 public:
     // construction
     wxFrame() { Init(); }
     wxFrame( wxWindow*       pParent
-            ,wxWindowID      vId
-            ,const wxString& rsTitle
-            ,const wxPoint&  rPos = wxDefaultPosition
-            ,const wxSize&   rSize = wxDefaultSize
-            ,long            lStyle = wxDEFAULT_FRAME_STYLE
-            ,const wxString& rsName = wxFrameNameStr
-           )
+               ,wxWindowID      vId
+               ,const wxString& rsTitle
+               ,const wxPoint&  rPos = wxDefaultPosition
+               ,const wxSize&   rSize = wxDefaultSize
+               ,long            lStyle = wxDEFAULT_FRAME_STYLE
+               ,const wxString& rsName = wxFrameNameStr
+              )
     {
         Init();
 
@@ -48,43 +48,40 @@ public:
     virtual ~wxFrame();
 
     // implement base class pure virtuals
-    virtual void Maximize(bool bMaximize = TRUE);
-    virtual bool IsMaximized(void) const;
-    virtual void Iconize(bool bIconize = TRUE);
-    virtual bool IsIconized(void) const;
-    virtual void Restore(void);
+#if wxUSE_MENUS_NATIVE
     virtual void SetMenuBar(wxMenuBar* pMenubar);
-    virtual void SetIcon(const wxIcon& rIcon);
+#endif
     virtual bool ShowFullScreen( bool bShow
                                 ,long lStyle = wxFULLSCREEN_ALL
                                );
-    virtual bool IsFullScreen(void) const { return m_bFsIsShowing; };
 
 
     // implementation only from now on
     // -------------------------------
 
-    // override some more virtuals
-    virtual bool Show(bool bShow = TRUE);
+    virtual void Raise(void);
 
     // event handlers
-    void OnActivate(wxActivateEvent& rEvent);
     void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
 
     // Toolbar
 #if wxUSE_TOOLBAR
-    virtual wxToolBar* CreateToolBar( long            lStyle = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT
+    virtual wxToolBar* CreateToolBar( long            lStyle = -1
                                      ,wxWindowID      vId = -1
                                      ,const wxString& rsName = wxToolBarNameStr
                                     );
 
+    virtual wxToolBar* OnCreateToolBar( long            lStyle
+                                       ,wxWindowID      vId
+                                       ,const wxString& rsName
+                                      );
     virtual void       PositionToolBar(void);
 #endif // wxUSE_TOOLBAR
 
     // Status bar
 #if wxUSE_STATUSBAR
     virtual wxStatusBar* OnCreateStatusBar( int             nNumber = 1
-                                           ,long            lStyle = wxST_SIZEGRIP
+                                           ,long            lStyle = wxSTB_DEFAULT_STYLE
                                            ,wxWindowID      vId = 0
                                            ,const wxString& rsName = wxStatusLineNameStr
                                           );
@@ -102,7 +99,6 @@ public:
 #endif // wxUSE_STATUSBAR
 
     WXHMENU GetWinMenu() const { return m_hMenu; }
-    WXHWND  GetFrame() const { return m_hFrame; }
 
     // Returns the origin of client area (may be different from (0,0) if the
     // frame has a toolbar)
@@ -123,52 +119,42 @@ public:
                           ,WXHMENU hMenu
                          );
 
-    bool OS2Create( int           nId
-                   ,wxWindow*     pParent
-                   ,const wxChar* zWclass
-                   ,wxWindow*     pWxWin
-                   ,const wxChar* zTitle
-                   ,int           nX
-                   ,int           nY
-                   ,int           nWidth
-                   ,int           nHeight
-                   ,long          nStyle
-                  );
-
     // tooltip management
 #if wxUSE_TOOLTIPS
     WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; }
     void   SetToolTipCtrl(WXHWND hHwndTT) { m_hWndToolTip = hHwndTT; }
 #endif // tooltips
 
+    void      SetClient(WXHWND    c_Hwnd);
+    void      SetClient(wxWindow* c_Window);
+    wxWindow *GetClient();
+
+ friend MRESULT EXPENTRY wxFrameWndProc(HWND  hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
+ friend MRESULT EXPENTRY wxFrameMainWndProc(HWND  hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
+
 protected:
     // common part of all ctors
     void         Init(void);
 
-    // common part of Iconize(), Maximize() and Restore()
-    void         DoShowWindow(int nShowCmd);
-
+    virtual WXHICON GetDefaultIcon(void) const;
     // override base class virtuals
     virtual void DoGetClientSize( int* pWidth
                                  ,int* pHeight
                                 ) const;
-    virtual void DoGetSize( int* pWidth
-                           ,int* pHeight
-                          ) const;
-    virtual void DoGetPosition( int* pX
-                               ,int* pY
-                              ) const;
     virtual void DoSetClientSize( int nWidth
                                  ,int nWeight
                                 );
+    inline virtual bool IsMDIChild(void) const { return FALSE; }
 
+#if wxUSE_MENUS_NATIVE
     // helper
     void         DetachMenuBar(void);
-
+    // perform MSW-specific action when menubar is changed
+    virtual void AttachMenuBar(wxMenuBar* pMenubar);
     // a plug in for MDI frame classes which need to do something special when
     // the menubar is set
     virtual void InternalSetMenuBar(void);
-
+#endif
     // propagate our state change to all child frames
     void IconizeChildFrames(bool bIconize);
 
@@ -197,6 +183,8 @@ protected:
     int                             m_nFsToolBarHeight;
     bool                            m_bFsIsMaximized;
     bool                            m_bFsIsShowing;
+    bool                            m_bWasMinimized;
+    bool                            m_bIsShown;
 
 private:
 #if wxUSE_TOOLTIPS
@@ -204,14 +192,9 @@ private:
 #endif // tooltips
 
     //
-    // The main handle of a frame window, that used for message processing
-    // is the client handle under PM.  But we still need the frame handle
-    // as well
-    //
-    WXHWND                          m_hFrame;
-
-    //
-    // Handles to child windows of the Frame that we don't have child objects for
+    // Handles to child windows of the Frame, and the frame itself,
+    // that we don't have child objects for (m_hWnd in wxWindow is the
+    // handle of the Frame's client window!
     //
     WXHWND                          m_hTitleBar;
     WXHWND                          m_hHScroll;
@@ -221,8 +204,6 @@ private:
     // Swp structures for various client data
     // DW: Better off in attached RefData?
     //
-    SWP                             m_vSwp;
-    SWP                             m_vSwpClient;
     SWP                             m_vSwpTitleBar;
     SWP                             m_vSwpMenuBar;
     SWP                             m_vSwpHScroll;
@@ -234,6 +215,8 @@ private:
     DECLARE_DYNAMIC_CLASS(wxFrame)
 };
 
+MRESULT EXPENTRY wxFrameWndProc(HWND  hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
+MRESULT EXPENTRY wxFrameMainWndProc(HWND  hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
 #endif
     // _WX_FRAME_H_