]>
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 WXDLLEXPORT 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
);
59 virtual void PositionToolBar();
60 #endif // wxUSE_TOOLBAR
64 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
65 long style
= wxST_SIZEGRIP
,
67 const wxString
& name
= wxStatusLineNameStr
);
69 virtual void PositionStatusBar();
71 // Hint to tell framework which status bar to use: the default is to use
72 // native one for the platforms which support it (Win32), the generic one
75 // TODO: should this go into a wxFrameworkSettings class perhaps?
76 static void UseNativeStatusBar(bool useNative
)
77 { m_useNativeStatusBar
= useNative
; };
78 static bool UsesNativeStatusBar()
79 { return m_useNativeStatusBar
; };
80 #endif // wxUSE_STATUSBAR
83 WXHMENU
GetWinMenu() const { return m_hMenu
; }
88 bool HandleSize(int x
, int y
, WXUINT flag
);
89 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
90 bool HandleMenuSelect(WXWORD nItem
, WXWORD nFlags
, WXHMENU hMenu
);
91 bool HandleMenuLoop(const wxEventType
& evtType
, WXWORD isPopup
);
95 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
96 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
99 // a MSW only function which sends a size event to the window using its
100 // current size - this has an effect of refreshing the window layout
101 virtual void SendSizeEvent();
103 virtual wxPoint
GetClientAreaOrigin() const;
106 // common part of all ctors
109 // override base class virtuals
110 virtual void DoGetClientSize(int *width
, int *height
) const;
111 virtual void DoSetClientSize(int width
, int height
);
113 #if wxUSE_MENUS_NATIVE
114 // perform MSW-specific action when menubar is changed
115 virtual void AttachMenuBar(wxMenuBar
*menubar
);
117 // a plug in for MDI frame classes which need to do something special when
118 // the menubar is set
119 virtual void InternalSetMenuBar();
120 #endif // wxUSE_MENUS_NATIVE
122 // propagate our state change to all child frames
123 void IconizeChildFrames(bool bIconize
);
125 // we add menu bar accel processing
126 bool MSWTranslateMessage(WXMSG
* pMsg
);
128 // window proc for the frames
129 WXLRESULT
MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
131 // handle WM_INITMENUPOPUP message
132 bool HandleInitMenuPopup(WXHMENU hMenu
);
134 virtual bool IsMDIChild() const { return false; }
136 // get default (wxWidgets) icon for the frame
137 virtual WXHICON
GetDefaultIcon() const;
140 static bool m_useNativeStatusBar
;
141 #endif // wxUSE_STATUSBAR
144 // frame menu, NULL if none
146 #endif // wxUSE_MENUS
150 WXHWND m_hwndToolTip
;
152 #if defined(__SMARTPHONE__) || defined(__POCKETPC__)
153 void* m_activateInfo
;
156 // used by IconizeChildFrames(), see comments there
159 DECLARE_EVENT_TABLE()
160 DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame
)