]>
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
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
14 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
19 wxFrame(wxWindow
*parent
,
21 const wxString
& title
,
22 const wxPoint
& pos
= wxDefaultPosition
,
23 const wxSize
& size
= wxDefaultSize
,
24 long style
= wxDEFAULT_FRAME_STYLE
,
25 const wxString
& name
= wxFrameNameStr
)
29 Create(parent
, id
, title
, pos
, size
, style
, name
);
32 bool Create(wxWindow
*parent
,
34 const wxString
& title
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxDEFAULT_FRAME_STYLE
,
38 const wxString
& name
= wxFrameNameStr
);
42 // implement base class pure virtuals
43 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
45 // implementation only from now on
46 // -------------------------------
49 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
53 virtual wxToolBar
* CreateToolBar(long style
= -1,
54 wxWindowID id
= wxID_ANY
,
55 const wxString
& name
= wxToolBarNameStr
);
56 #endif // wxUSE_TOOLBAR
60 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
61 long style
= wxSTB_DEFAULT_STYLE
,
63 const wxString
& name
= wxStatusLineNameStr
);
65 // Hint to tell framework which status bar to use: the default is to use
66 // native one for the platforms which support it (Win32), the generic one
69 // TODO: should this go into a wxFrameworkSettings class perhaps?
70 static void UseNativeStatusBar(bool useNative
)
71 { m_useNativeStatusBar
= useNative
; }
72 static bool UsesNativeStatusBar()
73 { return m_useNativeStatusBar
; }
74 #endif // wxUSE_STATUSBAR
77 bool HandleSize(int x
, int y
, WXUINT flag
);
78 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
82 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
83 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
86 // override the base class function to handle iconized/maximized frames
87 virtual void SendSizeEvent(int flags
= 0);
89 virtual wxPoint
GetClientAreaOrigin() const;
91 // override base class version to add menu bar accel processing
92 virtual bool MSWTranslateMessage(WXMSG
*msg
)
94 return MSWDoTranslateMessage(this, msg
);
97 // window proc for the frames
98 virtual WXLRESULT
MSWWindowProc(WXUINT message
,
103 // get the currently active menu: this is the same as the frame menu for
104 // normal frames but is overridden by wxMDIParentFrame
105 virtual WXHMENU
MSWGetActiveMenu() const { return m_hMenu
; }
107 // Look up the menu in the menu bar.
108 virtual wxMenu
* MSWFindMenuFromHMENU(WXHMENU hMenu
);
109 #endif // wxUSE_MENUS
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 virtual bool IsMDIChild() const { return false; }
137 // get default (wxWidgets) icon for the frame
138 virtual WXHICON
GetDefaultIcon() const;
141 virtual void PositionToolBar();
142 #endif // wxUSE_TOOLBAR
145 virtual void PositionStatusBar();
147 static bool m_useNativeStatusBar
;
148 #endif // wxUSE_STATUSBAR
151 // frame menu, NULL if none
153 #endif // wxUSE_MENUS
157 WXHWND m_hwndToolTip
;
160 // used by IconizeChildFrames(), see comments there
163 DECLARE_EVENT_TABLE()
164 DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame
)