]>
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 and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
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 void Maximize(bool maximize
= TRUE
);
49 virtual bool IsMaximized() const;
50 virtual void Iconize(bool iconize
= TRUE
);
51 virtual bool IsIconized() const;
52 virtual void Restore();
53 virtual void SetMenuBar(wxMenuBar
*menubar
);
54 virtual void SetIcon(const wxIcon
& icon
);
56 // implementation only from now on
57 // -------------------------------
59 // override some more virtuals
60 virtual bool Show(bool show
= TRUE
);
63 void OnActivate(wxActivateEvent
& event
);
64 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
68 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
,
70 const wxString
& name
= wxToolBarNameStr
);
72 virtual void PositionToolBar();
73 #endif // wxUSE_TOOLBAR
77 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
78 long style
= wxST_SIZEGRIP
,
80 const wxString
& name
= wxStatusLineNameStr
);
82 virtual void PositionStatusBar();
84 // Hint to tell framework which status bar to use: the default is to use
85 // native one for the platforms which support it (Win32), the generic one
88 // TODO: should this go into a wxFrameworkSettings class perhaps?
89 static void UseNativeStatusBar(bool useNative
)
90 { m_useNativeStatusBar
= useNative
; };
91 static bool UsesNativeStatusBar()
92 { return m_useNativeStatusBar
; };
93 #endif // wxUSE_STATUSBAR
95 WXHMENU
GetWinMenu() const { return m_hMenu
; }
99 bool HandleSize(int x
, int y
, WXUINT flag
);
100 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
101 bool HandleMenuSelect(WXWORD nItem
, WXWORD nFlags
, WXHMENU hMenu
);
103 bool MSWCreate(int id
, wxWindow
*parent
, const wxChar
*wclass
,
104 wxWindow
*wx_win
, const wxChar
*title
,
105 int x
, int y
, int width
, int height
, long style
);
107 // tooltip management
109 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
110 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
114 // common part of all ctors
117 // common part of Iconize(), Maximize() and Restore()
118 void DoShowWindow(int nShowCmd
);
120 // override base class virtuals
121 virtual void DoGetClientSize(int *width
, int *height
) const;
122 virtual void DoGetSize(int *width
, int *height
) const;
123 virtual void DoGetPosition(int *x
, int *y
) const;
125 virtual void DoSetClientSize(int width
, int height
);
128 void DetachMenuBar();
130 // a plug in for MDI frame classes which need to do something special when
131 // the menubar is set
132 virtual void InternalSetMenuBar();
134 // propagate our state change to all child frames
135 void IconizeChildFrames(bool bIconize
);
137 // we add menu bar accel processing
138 bool MSWTranslateMessage(WXMSG
* pMsg
);
140 // window proc for the frames
141 long MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
144 WXHICON m_defaultIcon
;
147 static bool m_useNativeStatusBar
;
148 #endif // wxUSE_STATUSBAR
152 WXHWND m_hwndToolTip
;
155 DECLARE_EVENT_TABLE()
156 DECLARE_DYNAMIC_CLASS(wxFrame
)