]>
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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 bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
51 // implementation only from now on
52 // -------------------------------
55 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
59 virtual wxToolBar
* CreateToolBar(long style
= -1,
60 wxWindowID id
= wxID_ANY
,
61 const wxString
& name
= wxToolBarNameStr
);
63 virtual void PositionToolBar();
64 #endif // wxUSE_TOOLBAR
68 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
69 long style
= wxST_SIZEGRIP
,
71 const wxString
& name
= wxStatusLineNameStr
);
73 virtual void PositionStatusBar();
75 // Hint to tell framework which status bar to use: the default is to use
76 // native one for the platforms which support it (Win32), the generic one
79 // TODO: should this go into a wxFrameworkSettings class perhaps?
80 static void UseNativeStatusBar(bool useNative
)
81 { m_useNativeStatusBar
= useNative
; };
82 static bool UsesNativeStatusBar()
83 { return m_useNativeStatusBar
; };
84 #endif // wxUSE_STATUSBAR
87 WXHMENU
GetWinMenu() const { return m_hMenu
; }
92 bool HandleSize(int x
, int y
, WXUINT flag
);
93 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
94 bool HandleMenuSelect(WXWORD nItem
, WXWORD nFlags
, WXHMENU hMenu
);
95 bool HandleMenuLoop(const wxEventType
& evtType
, WXWORD isPopup
);
99 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
100 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
103 // a MSW only function which sends a size event to the window using its
104 // current size - this has an effect of refreshing the window layout
105 virtual void SendSizeEvent();
107 virtual wxPoint
GetClientAreaOrigin() const;
110 // common part of all ctors
113 // override base class virtuals
114 virtual void DoGetClientSize(int *width
, int *height
) const;
115 virtual void DoSetClientSize(int width
, int height
);
117 #if wxUSE_MENUS_NATIVE
118 // perform MSW-specific action when menubar is changed
119 virtual void AttachMenuBar(wxMenuBar
*menubar
);
121 // a plug in for MDI frame classes which need to do something special when
122 // the menubar is set
123 virtual void InternalSetMenuBar();
124 #endif // wxUSE_MENUS_NATIVE
126 // propagate our state change to all child frames
127 void IconizeChildFrames(bool bIconize
);
129 // we add menu bar accel processing
130 bool MSWTranslateMessage(WXMSG
* pMsg
);
132 // window proc for the frames
133 WXLRESULT
MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
135 // handle WM_INITMENUPOPUP message
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 static bool m_useNativeStatusBar
;
145 #endif // wxUSE_STATUSBAR
148 // frame menu, NULL if none
150 #endif // wxUSE_MENUS
154 WXHWND m_hwndToolTip
;
157 // used by IconizeChildFrames(), see comments there
160 DECLARE_EVENT_TABLE()
161 DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame
)