]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/frame.h
20ce9333ad5603ecd960217f12e2ba656fbb0e25
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
);
46 // implementation only from now on
47 // -------------------------------
50 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
54 virtual wxToolBar
* CreateToolBar(long style
= -1,
55 wxWindowID id
= wxID_ANY
,
56 const wxString
& name
= wxToolBarNameStr
);
57 #endif // wxUSE_TOOLBAR
61 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
62 long style
= wxSTB_DEFAULT_STYLE
,
64 const wxString
& name
= wxStatusLineNameStr
);
66 // Hint to tell framework which status bar to use: the default is to use
67 // native one for the platforms which support it (Win32), the generic one
70 // TODO: should this go into a wxFrameworkSettings class perhaps?
71 static void UseNativeStatusBar(bool useNative
)
72 { m_useNativeStatusBar
= useNative
; }
73 static bool UsesNativeStatusBar()
74 { return m_useNativeStatusBar
; }
75 #endif // wxUSE_STATUSBAR
78 bool HandleSize(int x
, int y
, WXUINT flag
);
79 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
83 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
84 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
87 // override the base class function to handle iconized/maximized frames
88 virtual void SendSizeEvent(int flags
= 0);
90 virtual wxPoint
GetClientAreaOrigin() const;
92 // override base class version to add menu bar accel processing
93 virtual bool MSWTranslateMessage(WXMSG
*msg
)
95 return MSWDoTranslateMessage(this, msg
);
98 // window proc for the frames
99 virtual WXLRESULT
MSWWindowProc(WXUINT message
,
104 // get the currently active menu: this is the same as the frame menu for
105 // normal frames but is overridden by wxMDIParentFrame
106 virtual WXHMENU
MSWGetActiveMenu() const { return m_hMenu
; }
108 // Look up the menu in the menu bar.
109 virtual wxMenu
* MSWFindMenuFromHMENU(WXHMENU hMenu
);
110 #endif // wxUSE_MENUS
113 // common part of all ctors
116 // override base class virtuals
117 virtual void DoGetClientSize(int *width
, int *height
) const;
118 virtual void DoSetClientSize(int width
, int height
);
120 #if wxUSE_MENUS_NATIVE
121 // perform MSW-specific action when menubar is changed
122 virtual void AttachMenuBar(wxMenuBar
*menubar
);
124 // a plug in for MDI frame classes which need to do something special when
125 // the menubar is set
126 virtual void InternalSetMenuBar();
127 #endif // wxUSE_MENUS_NATIVE
129 // propagate our state change to all child frames
130 void IconizeChildFrames(bool bIconize
);
132 // the real implementation of MSWTranslateMessage(), also used by
134 bool MSWDoTranslateMessage(wxFrame
*frame
, WXMSG
*msg
);
136 virtual bool IsMDIChild() const { return false; }
138 // get default (wxWidgets) icon for the frame
139 virtual WXHICON
GetDefaultIcon() const;
142 virtual void PositionToolBar();
143 #endif // wxUSE_TOOLBAR
146 virtual void PositionStatusBar();
148 static bool m_useNativeStatusBar
;
149 #endif // wxUSE_STATUSBAR
152 // frame menu, NULL if none
154 #endif // wxUSE_MENUS
158 WXHWND m_hwndToolTip
;
161 // used by IconizeChildFrames(), see comments there
164 DECLARE_EVENT_TABLE()
165 DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame
)