/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/frame.h
-// Purpose: wxFrame class
+// Purpose: wxFrameMSW class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
#pragma interface "frame.h"
#endif
-class WXDLLEXPORT wxFrame : public wxFrameBase
+class WXDLLEXPORT wxFrameMSW : public wxFrameBase
{
public:
// construction
- wxFrame() { Init(); }
- wxFrame(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr)
+ wxFrameMSW() { Init(); }
+ wxFrameMSW(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr)
{
Init();
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
- virtual ~wxFrame();
+ virtual ~wxFrameMSW();
// implement base class pure virtuals
virtual void Maximize(bool maximize = TRUE);
virtual void Restore();
virtual void SetMenuBar(wxMenuBar *menubar);
virtual void SetIcon(const wxIcon& icon);
+ virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
+ virtual bool IsFullScreen() const { return m_fsIsShowing; };
// implementation only from now on
// -------------------------------
WXHMENU GetWinMenu() const { return m_hMenu; }
- // Returns the origin of client area (may be different from (0,0) if the
- // frame has a toolbar)
- virtual wxPoint GetClientAreaOrigin() const;
-
// event handlers
bool HandlePaint();
bool HandleSize(int x, int y, WXUINT flag);
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
#endif // tooltips
+ // a MSW only function which sends a size event to the window using its
+ // current size - this has an effect of refreshing the window layout
+ void SendSizeEvent();
+
+ // called by wxWindow whenever it gets focus
+ void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
+ wxWindow *GetLastFocus() const { return m_winLastFocused; }
+
protected:
// common part of all ctors
void Init();
virtual void DoSetClientSize(int width, int height);
- virtual void DoClientToScreen(int *x, int *y) const;
- virtual void DoScreenToClient(int *x, int *y) const;
-
// helper
void DetachMenuBar();
+#if wxUSE_MENUS_NATIVE
// a plug in for MDI frame classes which need to do something special when
// the menubar is set
virtual void InternalSetMenuBar();
+#endif // wxUSE_MENUS_NATIVE
// propagate our state change to all child frames
void IconizeChildFrames(bool bIconize);
// window proc for the frames
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- bool m_iconized;
+ virtual bool IsMDIChild() const { return FALSE; }
+
+ // is the frame currently iconized?
+ bool m_iconized;
+
+ // should the frame be maximized when it will be shown? set by Maximize()
+ // when it is called while the frame is hidden
+ bool m_maximizeOnShow;
+
WXHICON m_defaultIcon;
#if wxUSE_STATUSBAR
static bool m_useNativeStatusBar;
#endif // wxUSE_STATUSBAR
+ // the last focused child: we restore focus to it on activation
+ wxWindow *m_winLastFocused;
+
+ // Data to save/restore when calling ShowFullScreen
+ long m_fsStyle; // Passed to ShowFullScreen
+ wxRect m_fsOldSize;
+ long m_fsOldWindowStyle;
+ int m_fsStatusBarFields; // 0 for no status bar
+ int m_fsStatusBarHeight;
+ int m_fsToolBarHeight;
+// WXHMENU m_fsMenu;
+ bool m_fsIsMaximized;
+ bool m_fsIsShowing;
+
private:
#if wxUSE_TOOLTIPS
WXHWND m_hwndToolTip;
#endif // tooltips
+ DECLARE_DYNAMIC_CLASS(wxFrameMSW)
DECLARE_EVENT_TABLE()
- DECLARE_DYNAMIC_CLASS(wxFrame)
};
#endif