X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/178f951f78abbc04abba3f9ff52432513c309068..9ef63a4a59eccce6cd8787f0ed966bfa8365a22e:/include/wx/os2/frame.h diff --git a/include/wx/os2/frame.h b/include/wx/os2/frame.h index 1ff9224fac..88cac74d0f 100644 --- a/include/wx/os2/frame.h +++ b/include/wx/os2/frame.h @@ -12,19 +12,24 @@ #ifndef _WX_FRAME_H_ #define _WX_FRAME_H_ +// +// Get the default resource ID's for frames +// +#include "wx/os2/wxrsc.h" + class WXDLLEXPORT 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(); @@ -43,24 +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); - virtual void SetIcon(const wxIcon& rIcon); +#endif virtual bool ShowFullScreen( bool bShow ,long lStyle = wxFULLSCREEN_ALL ); - virtual bool IsFullScreen(void) const { return m_fsIsShowing; }; // 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); @@ -91,9 +90,9 @@ public: // TODO: should this go into a wxFrameworkSettings class perhaps? static void UseNativeStatusBar(bool bUseNative) - { m_useNativeStatusBar = useNative; }; + { m_bUseNativeStatusBar = bUseNative; }; static bool UsesNativeStatusBar() - { return m_useNativeStatusBar; }; + { return m_bUseNativeStatusBar; }; #endif // wxUSE_STATUSBAR WXHMENU GetWinMenu() const { return m_hMenu; } @@ -117,52 +116,48 @@ 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 = hwndTT; } + WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; } + void SetToolTipCtrl(WXHWND hHwndTT) { m_hWndToolTip = hHwndTT; } #endif // tooltips + // + // Called by wxWindow whenever it gets focus + // + void SetLastFocus(wxWindow* pWin) { m_pWinLastFocused = pWin; } + wxWindow *GetLastFocus(void) const { return m_pWinLastFocused; } + + 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); @@ -191,12 +186,35 @@ protected: int m_nFsToolBarHeight; bool m_bFsIsMaximized; bool m_bFsIsShowing; + bool m_bWasMinimized; + bool m_bIsShown; + wxWindow* m_pWinLastFocused; private: #if wxUSE_TOOLTIPS - WXHWND m_hHwndToolTip; + WXHWND m_hWndToolTip; #endif // tooltips + // + // 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; + WXHWND m_hVScroll; + + // + // Swp structures for various client data + // DW: Better off in attached RefData? + // + SWP m_vSwpTitleBar; + SWP m_vSwpMenuBar; + SWP m_vSwpHScroll; + SWP m_vSwpVScroll; + SWP m_vSwpStatusBar; + SWP m_vSwpToolBar; + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxFrame) };