]> git.saurik.com Git - wxWidgets.git/commitdiff
Support for Toplevel window
authorDavid Webster <Dave.Webster@bhmi.com>
Mon, 7 Jan 2002 00:44:31 +0000 (00:44 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Mon, 7 Jan 2002 00:44:31 +0000 (00:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/checkbox.h
include/wx/os2/dialog.h
include/wx/os2/frame.h
include/wx/os2/private.h
include/wx/os2/window.h

index 6079d5f80a403e2c6e16dcd6c8be48a78e0e8602..a8e7a2cb743354c7627d1b7c87f1f0c995f59c57 100644 (file)
 #define _WX_CHECKBOX_H_
 
 #include "wx/control.h"
-
-WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
+                               WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
 
 // Checkbox item (single checkbox)
 class WXDLLEXPORT wxBitmap;
 class WXDLLEXPORT wxCheckBox : public wxCheckBoxBase
 {
  public:
-  inline wxCheckBox() { }
-  inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
+    inline wxCheckBox() { }
+    inline wxCheckBox( wxWindow*          pParent
+                      ,wxWindowID         vId
+                      ,const wxString&    rsLabel
+                      ,const wxPoint&     rPos = wxDefaultPosition
+                      ,const wxSize&      rSize = wxDefaultSize
+                      ,long lStyle = 0
+#if wxUSE_VALIDATORS
+                      ,const wxValidator& rValidator = wxDefaultValidator
+#endif
+                      ,const wxString&    rsName = wxCheckBoxNameStr
+                     )
+    {
+        Create( pParent
+               ,vId
+               ,rsLabel
+               ,rPos
+               ,rSize
+               ,lStyle
 #if wxUSE_VALIDATORS
-           const wxValidator& validator = wxDefaultValidator,
+               ,rValidator
 #endif
-           const wxString& name = wxCheckBoxNameStr)
-  {
-      Create(parent, id, label, pos, size, style, validator, name);
-  }
+               ,rsName
+              );
+    }
 
-  bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
+    bool Create( wxWindow* pParent
+                ,wxWindowID         vId
+                ,const wxString&    rsLabel
+                ,const wxPoint&     rPos = wxDefaultPosition
+                ,const wxSize&      rSize = wxDefaultSize
+                ,long lStyle = 0
 #if wxUSE_VALIDATORS
-           const wxValidator& validator = wxDefaultValidator,
+                ,const wxValidator& rValidator = wxDefaultValidator
 #endif
-           const wxString& name = wxCheckBoxNameStr);
+                ,const wxString&    rsName = wxCheckBoxNameStr
+               );
 
-  virtual void SetValue(bool);
-  virtual bool GetValue() const ;
+  virtual void SetValue(bool bValue);
+  virtual bool GetValue(void) const ;
 
-  virtual bool OS2Command(WXUINT param, WXWORD id);
-  virtual void SetLabel(const wxString& label);
-  virtual void Command(wxCommandEvent& event);
-  virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
-            WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+  virtual bool OS2Command( WXUINT uParam
+                          ,WXWORD wId
+                         );
+  virtual void SetLabel(const wxString& rsLabel);
+  virtual void Command(wxCommandEvent& rEvent);
 
 protected:
-  virtual wxSize DoGetBestSize() const;
+  virtual wxSize DoGetBestSize(void) const;
 private:
   DECLARE_DYNAMIC_CLASS(wxCheckBox)
 };
 
 class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
 {
-  DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
-
  public:
-  int checkWidth ;
-  int checkHeight ;
 
-  inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
-  inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
+    inline wxBitmapCheckBox() { m_nCheckWidth = -1; m_nCheckHeight = -1; }
+    inline wxBitmapCheckBox( wxWindow*          pParent
+                            ,wxWindowID         vId
+                            ,const wxBitmap*    pLabel
+                            ,const wxPoint&     rPos = wxDefaultPosition
+                            ,const wxSize&      rSize = wxDefaultSize
+                            ,long               lStyle = 0
 #if wxUSE_VALIDATORS
-           const wxValidator& validator = wxDefaultValidator,
+                            ,const wxValidator& rValidator = wxDefaultValidator
 #endif
-           const wxString& name = wxCheckBoxNameStr)
-  {
-      Create(parent, id, label, pos, size, style, validator, name);
-  }
+                            ,const wxString&    rsName = wxCheckBoxNameStr
+                           )
+    {
+        Create( pParent
+               ,vId
+               ,pLabel
+               ,rPos
+               ,rSize
+               ,lStyle
+               ,rValidator
+               ,rsName
+              );
+    }
 
-  bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
+    bool Create( wxWindow*          pParent
+                ,wxWindowID         vId
+                ,const wxBitmap*    pLabel
+                ,const wxPoint&     rPos = wxDefaultPosition
+                ,const wxSize&      rSize = wxDefaultSize
+                ,long               lStyle = 0
 #if wxUSE_VALIDATORS
-           const wxValidator& validator = wxDefaultValidator,
+                ,const wxValidator& rValidator = wxDefaultValidator
 #endif
-           const wxString& name = wxCheckBoxNameStr);
+                ,const wxString&    rsName = wxCheckBoxNameStr
+               );
+
+    virtual void SetLabel(const wxBitmap& rBitmap);
+
+    int                             m_nCheckWidth;
+    int                             m_nCheckHeight;
 
-  virtual void SetLabel(const wxBitmap& bitmap);
 private:
-  virtual void SetLabel(const wxString& string)
-  { wxCheckBox::SetLabel(string); };
+
+    virtual void SetLabel(const wxString& rsString)
+    { wxCheckBox::SetLabel(rsString); };
+    DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
 };
 #endif
     // _WX_CHECKBOX_H_
index 260a335ef1734456d0b845b2f133b7f103064b73..0198cd9bfa7c8780332c4f0a40b6ccd9e0109eff 100644 (file)
@@ -41,7 +41,6 @@ public:
     {
         long                        lModalStyle = lStyle ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
 
-        bModal = FALSE;
         Create( pParent
                ,-1
                ,rsTitle
@@ -84,36 +83,30 @@ public:
                );
     ~wxDialog();
 
-    virtual bool Destroy(void);
-    virtual bool Show(bool bShow);
-    virtual void Iconize(bool bIconize);
-    virtual bool IsIconized(void) const;
-
-    virtual bool IsTopLevel(void) const { return TRUE; }
-
-    void         SetModal(bool bFlag);
+            void SetModal(bool bFlag);
     virtual bool IsModal(void) const;
 
-    //
     // For now, same as Show(TRUE) but returns return code
-    //
-    virtual int  ShowModal(void);
-    virtual void EndModal(int nRetCode);
+    virtual int ShowModal();
+
+    // may be called to terminate the dialog with the given return code
+    virtual void EndModal(int retCode);
 
     //
     // Returns TRUE if we're in a modal loop
     //
-    bool IsModalShowing() const;
-
-#if WXWIN_COMPATIBILITY
-    bool Iconized() const { return IsIconized(); };
-#endif
+            bool IsModalShowing() const;
 
     //
     // Implementation only from now on
     // -------------------------------
     //
 
+    //
+    // Override some base class virtuals
+    //
+    virtual bool Show(bool bShow);
+
     //
     // Event handlers
     //
@@ -121,10 +114,6 @@ public:
     void OnCharHook(wxKeyEvent& rEvent);
     void OnCloseWindow(wxCloseEvent& rEvent);
 
-    //
-    // May be called to terminate the dialog with the given return code
-    //
-
     //
     // Standard buttons
     //
@@ -144,17 +133,9 @@ public:
                                   ,WXWPARAM wParam
                                   ,WXLPARAM lParam
                                  );
+
 protected:
     //
-    // Override more base class virtuals
-    //
-    virtual void DoSetClientSize( int nWidth
-                                 ,int nHeight
-                                );
-    virtual void DoGetPosition( int* pnX
-                               ,int* pnY
-                              ) const;
-    //
     // Show modal dialog and enter modal loop
     //
     void DoShowModal(void);
@@ -162,7 +143,7 @@ protected:
     //
     // Common part of all ctors
     //
-    void Init();
+    void Init(void);
 
 private:
     wxWindow*                       m_pOldFocus;
index 6f85949b9792a75a96e2fcf701afae7674ef3976..13d290e76ca526d544138f0834eb770f564bf7eb 100644 (file)
@@ -48,27 +48,18 @@ 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);
 #endif
-    virtual void SetIcon(const wxIcon& rIcon);
     virtual bool ShowFullScreen( bool bShow
                                 ,long lStyle = wxFULLSCREEN_ALL
                                );
-    virtual bool IsFullScreen(void) const { return m_bFsIsShowing; };
 
 
     // implementation only from now on
     // -------------------------------
 
-    void         AlterChildPos(void);
-    // override some more virtuals
-    virtual bool Show(bool bShow = TRUE);
+    virtual void Raise(void);
 
     // event handlers
     void OnActivate(wxActivateEvent& rEvent);
@@ -125,18 +116,7 @@ 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
-                  );
-
+    void SendSizeEvent(void);
     // tooltip management
 #if wxUSE_TOOLTIPS
     WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; }
@@ -152,7 +132,6 @@ public:
     void      SetClient(WXHWND    c_Hwnd);
     void      SetClient(wxWindow* c_Window);
     wxWindow *GetClient();
-    HWND      GetFrame(void) const { return m_hFrame; }
 
  friend MRESULT EXPENTRY wxFrameWndProc(HWND  hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
  friend MRESULT EXPENTRY wxFrameMainWndProc(HWND  hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
@@ -161,22 +140,15 @@ 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
@@ -229,7 +201,6 @@ private:
     // that we don't have child objects for (m_hWnd in wxWindow is the
     // handle of the Frame's client window!
     //
-    WXHWND                          m_hFrame;
     WXHWND                          m_hTitleBar;
     WXHWND                          m_hHScroll;
     WXHWND                          m_hVScroll;
@@ -238,8 +209,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;
index 17badf421ff322c05c271aadbaafc61521664e1b..5b29f6849fa7dd2a3c1668523e23ec8f404491d4 100644 (file)
@@ -232,10 +232,22 @@ inline bool wxStyleHasBorder(long style)
                    wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
 }
 
+inline RECTL wxGetWindowRect(HWND hWnd)
+{
+    RECTL                           vRect;
+
+    ::WinQueryWindowRect(hWnd, &vRect);
+    return vRect;
+} // end of wxGetWindowRect
+
 WXDLLEXPORT extern void wxOS2SetFont( HWND          hWnd
                                      ,const wxFont& rFont
                                     );
 
 
+WXDLLEXPORT extern bool wxCheckWindowWndProc( WXHWND                            hWnd
+                                             ,WXFARPROC                         fnWndProc
+                                            );
+
 #endif
     // _WX_PRIVATE_H_
index 6508c25f6ed8443bc63aca6ff8b9407698755a1b..15267db30711a7c9ef03972e2efc8d8c998b4f60 100644 (file)
 #include <os2.h>
 
 
+// ---------------------------------------------------------------------------
+// forward declarations
+// ---------------------------------------------------------------------------
+#ifndef CW_USEDEFAULT
+#  define  CW_USEDEFAULT ((int)0x80000000)
+#endif
+
 // ---------------------------------------------------------------------------
 // forward declarations
 // ---------------------------------------------------------------------------
@@ -247,21 +254,15 @@ public:
     virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
 
     // returns TRUE if the window has been created
-    bool OS2Create( WXHWND        hParent
-                   ,PSZ           zClass
-                   ,const wxChar* zTitle
-                   ,WXDWORD       dwStyle
-                   ,long          lX
-                   ,long          lY
-                   ,long          lWidth
-                   ,long          lHeight
-                   ,WXHWND        hOwner
-                   ,WXHWND        hZOrder
-                   ,unsigned long lId
-                   ,void*         pCtlData = NULL
-                   ,void*         pPresParams = NULL
-                   ,WXDWORD       dwExStyle = 0L
-                  );
+    bool         OS2Create( PSZ            zClass
+                           ,const char*    zTitle
+                           ,WXDWORD        dwStyle
+                           ,const wxPoint& rPos
+                           ,const wxSize&  rSize
+                           ,void*          pCtlData
+                           ,WXDWORD        dwExStyle
+                           ,bool           bIsChild
+                          );
     virtual bool OS2Command( WXUINT uParam
                             ,WXWORD nId
                            );