]>
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
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
20 wxFrame(wxWindow
*parent
,
22 const wxString
& title
,
23 const wxPoint
& pos
= wxDefaultPosition
,
24 const wxSize
& size
= wxDefaultSize
,
25 long style
= wxDEFAULT_FRAME_STYLE
,
26 const wxString
& name
= wxFrameNameStr
)
30 Create(parent
, id
, title
, pos
, size
, style
, name
);
33 bool Create(wxWindow
*parent
,
35 const wxString
& title
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxDEFAULT_FRAME_STYLE
,
39 const wxString
& name
= wxFrameNameStr
);
43 // implement base class pure virtuals
44 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
47 // implementation only from now on
48 // -------------------------------
51 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
55 virtual wxToolBar
* CreateToolBar(long style
= -1,
56 wxWindowID id
= wxID_ANY
,
57 const wxString
& name
= wxToolBarNameStr
);
58 #endif // wxUSE_TOOLBAR
62 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
63 long style
= wxST_SIZEGRIP
,
65 const wxString
& name
= wxStatusLineNameStr
);
67 // Hint to tell framework which status bar to use: the default is to use
68 // native one for the platforms which support it (Win32), the generic one
71 // TODO: should this go into a wxFrameworkSettings class perhaps?
72 static void UseNativeStatusBar(bool useNative
)
73 { m_useNativeStatusBar
= useNative
; }
74 static bool UsesNativeStatusBar()
75 { return m_useNativeStatusBar
; }
76 #endif // wxUSE_STATUSBAR
79 WXHMENU
GetWinMenu() const { return m_hMenu
; }
83 bool HandleSize(int x
, int y
, WXUINT flag
);
84 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
85 bool HandleMenuSelect(WXWORD nItem
, WXWORD nFlags
, WXHMENU hMenu
);
86 bool HandleMenuLoop(const wxEventType
& evtType
, WXWORD isPopup
);
90 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
91 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
94 // a MSW only function which sends a size event to the window using its
95 // current size - this has an effect of refreshing the window layout
96 virtual void SendSizeEvent();
98 virtual wxPoint
GetClientAreaOrigin() const;
100 // override base class version to add menu bar accel processing
101 virtual bool MSWTranslateMessage(WXMSG
*msg
)
103 return MSWDoTranslateMessage(this, msg
);
106 // window proc for the frames
107 virtual WXLRESULT
MSWWindowProc(WXUINT message
,
112 // common part of all ctors
115 // override base class virtuals
116 virtual void DoGetClientSize(int *width
, int *height
) const;
117 virtual void DoSetClientSize(int width
, int height
);
119 #if wxUSE_MENUS_NATIVE
120 // perform MSW-specific action when menubar is changed
121 virtual void AttachMenuBar(wxMenuBar
*menubar
);
123 // a plug in for MDI frame classes which need to do something special when
124 // the menubar is set
125 virtual void InternalSetMenuBar();
126 #endif // wxUSE_MENUS_NATIVE
128 // propagate our state change to all child frames
129 void IconizeChildFrames(bool bIconize
);
131 // the real implementation of MSWTranslateMessage(), also used by
133 bool MSWDoTranslateMessage(wxFrame
*frame
, WXMSG
*msg
);
135 // handle WM_INITMENUPOPUP message to generate wxEVT_MENU_OPEN
136 bool HandleInitMenuPopup(WXHMENU hMenu
);
138 virtual bool IsMDIChild() const { return false; }
140 // get default (wxWidgets) icon for the frame
141 virtual WXHICON
GetDefaultIcon() const;
144 virtual void PositionToolBar();
145 #endif // wxUSE_TOOLBAR
148 virtual void PositionStatusBar();
150 static bool m_useNativeStatusBar
;
151 #endif // wxUSE_STATUSBAR
154 // frame menu, NULL if none
156 #endif // wxUSE_MENUS
160 WXHWND m_hwndToolTip
;
163 // used by IconizeChildFrames(), see comments there
166 DECLARE_EVENT_TABLE()
167 DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame
)