]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/frame.h
3 // Purpose: wxFrame class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "frame.h"
19 class WXDLLEXPORT wxFrame
: public wxFrameBase
24 wxFrame(wxWindow
*parent
,
26 const wxString
& title
,
27 const wxPoint
& pos
= wxDefaultPosition
,
28 const wxSize
& size
= wxDefaultSize
,
29 long style
= wxDEFAULT_FRAME_STYLE
,
30 const wxString
& name
= wxFrameNameStr
)
34 Create(parent
, id
, title
, pos
, size
, style
, name
);
37 bool Create(wxWindow
*parent
,
39 const wxString
& title
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
42 long style
= wxDEFAULT_FRAME_STYLE
,
43 const wxString
& name
= wxFrameNameStr
);
47 // implement base class pure virtuals
48 virtual void Maximize(bool maximize
= TRUE
);
49 virtual bool IsMaximized() const;
50 virtual void Iconize(bool iconize
= TRUE
);
51 virtual bool IsIconized() const;
52 virtual void Restore();
53 virtual void SetMenuBar(wxMenuBar
*menubar
);
54 virtual void SetIcon(const wxIcon
& icon
);
55 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
56 virtual bool IsFullScreen() const { return m_fsIsShowing
; };
58 // implementation only from now on
59 // -------------------------------
61 // override some more virtuals
62 virtual bool Show(bool show
= TRUE
);
65 void OnActivate(wxActivateEvent
& event
);
66 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
70 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
,
72 const wxString
& name
= wxToolBarNameStr
);
74 virtual void PositionToolBar();
75 #endif // wxUSE_TOOLBAR
79 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
80 long style
= wxST_SIZEGRIP
,
82 const wxString
& name
= wxStatusLineNameStr
);
84 virtual void PositionStatusBar();
86 // Hint to tell framework which status bar to use: the default is to use
87 // native one for the platforms which support it (Win32), the generic one
90 // TODO: should this go into a wxFrameworkSettings class perhaps?
91 static void UseNativeStatusBar(bool useNative
)
92 { m_useNativeStatusBar
= useNative
; };
93 static bool UsesNativeStatusBar()
94 { return m_useNativeStatusBar
; };
95 #endif // wxUSE_STATUSBAR
97 WXHMENU
GetWinMenu() const { return m_hMenu
; }
101 bool HandleSize(int x
, int y
, WXUINT flag
);
102 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
103 bool HandleMenuSelect(WXWORD nItem
, WXWORD nFlags
, WXHMENU hMenu
);
105 bool MSWCreate(int id
, wxWindow
*parent
, const wxChar
*wclass
,
106 wxWindow
*wx_win
, const wxChar
*title
,
107 int x
, int y
, int width
, int height
, long style
);
109 // tooltip management
111 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
112 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
115 // a MSW only function which sends a size event to the window using its
116 // current size - this has an effect of refreshing the window layout
117 void SendSizeEvent();
120 // common part of all ctors
123 // common part of Iconize(), Maximize() and Restore()
124 void DoShowWindow(int nShowCmd
);
126 // override base class virtuals
127 virtual void DoGetClientSize(int *width
, int *height
) const;
128 virtual void DoGetSize(int *width
, int *height
) const;
129 virtual void DoGetPosition(int *x
, int *y
) const;
131 virtual void DoSetClientSize(int width
, int height
);
134 void DetachMenuBar();
136 // a plug in for MDI frame classes which need to do something special when
137 // the menubar is set
138 virtual void InternalSetMenuBar();
140 // propagate our state change to all child frames
141 void IconizeChildFrames(bool bIconize
);
143 // we add menu bar accel processing
144 bool MSWTranslateMessage(WXMSG
* pMsg
);
146 // window proc for the frames
147 long MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
149 virtual bool IsMDIChild() const { return FALSE
; }
151 // is the frame currently iconized?
154 // should the frame be maximized when it will be shown? set by Maximize()
155 // when it is called while the frame is hidden
156 bool m_maximizeOnShow
;
158 WXHICON m_defaultIcon
;
161 static bool m_useNativeStatusBar
;
162 #endif // wxUSE_STATUSBAR
164 // the last focused child: we restore focus to it on activation
165 wxWindow
*m_winLastFocused
;
167 // Data to save/restore when calling ShowFullScreen
168 long m_fsStyle
; // Passed to ShowFullScreen
170 long m_fsOldWindowStyle
;
171 int m_fsStatusBarFields
; // 0 for no status bar
172 int m_fsStatusBarHeight
;
173 int m_fsToolBarHeight
;
175 bool m_fsIsMaximized
;
180 WXHWND m_hwndToolTip
;
183 DECLARE_EVENT_TABLE()
184 DECLARE_DYNAMIC_CLASS(wxFrame
)