]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk/frame.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_GTK_FRAME_H_ | |
11 | #define _WX_GTK_FRAME_H_ | |
12 | ||
13 | //----------------------------------------------------------------------------- | |
14 | // classes | |
15 | //----------------------------------------------------------------------------- | |
16 | ||
17 | class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; | |
18 | class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; | |
19 | class WXDLLIMPEXP_FWD_CORE wxMenu; | |
20 | class WXDLLIMPEXP_FWD_CORE wxMenuBar; | |
21 | class WXDLLIMPEXP_FWD_CORE wxToolBar; | |
22 | class WXDLLIMPEXP_FWD_CORE wxStatusBar; | |
23 | ||
24 | //----------------------------------------------------------------------------- | |
25 | // wxFrame | |
26 | //----------------------------------------------------------------------------- | |
27 | ||
28 | class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase | |
29 | { | |
30 | public: | |
31 | // construction | |
32 | wxFrame() { Init(); } | |
33 | wxFrame(wxWindow *parent, | |
34 | wxWindowID id, | |
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) | |
40 | { | |
41 | Init(); | |
42 | ||
43 | Create(parent, id, title, pos, size, style, name); | |
44 | } | |
45 | ||
46 | bool Create(wxWindow *parent, | |
47 | wxWindowID id, | |
48 | const wxString& title, | |
49 | const wxPoint& pos = wxDefaultPosition, | |
50 | const wxSize& size = wxDefaultSize, | |
51 | long style = wxDEFAULT_FRAME_STYLE, | |
52 | const wxString& name = wxFrameNameStr); | |
53 | ||
54 | virtual ~wxFrame(); | |
55 | ||
56 | #if wxUSE_STATUSBAR | |
57 | void SetStatusBar(wxStatusBar *statbar); | |
58 | #endif // wxUSE_STATUSBAR | |
59 | ||
60 | #if wxUSE_TOOLBAR | |
61 | void SetToolBar(wxToolBar *toolbar); | |
62 | #endif // wxUSE_TOOLBAR | |
63 | ||
64 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); | |
65 | wxPoint GetClientAreaOrigin() const { return wxPoint(0, 0); } | |
66 | ||
67 | // implementation from now on | |
68 | // -------------------------- | |
69 | ||
70 | // GTK callbacks | |
71 | virtual void GtkOnSize(); | |
72 | virtual void OnInternalIdle(); | |
73 | ||
74 | bool m_menuBarDetached; | |
75 | int m_menuBarHeight; | |
76 | bool m_toolBarDetached; | |
77 | ||
78 | protected: | |
79 | // common part of all ctors | |
80 | void Init(); | |
81 | ||
82 | // override wxWindow methods to take into account tool/menu/statusbars | |
83 | virtual void DoGetClientSize( int *width, int *height ) const; | |
84 | ||
85 | #if wxUSE_MENUS_NATIVE | |
86 | virtual void DetachMenuBar(); | |
87 | virtual void AttachMenuBar(wxMenuBar *menubar); | |
88 | // Whether frame has a menubar showing | |
89 | // (needed to deal with perverted MDI menubar handling) | |
90 | virtual bool HasVisibleMenubar() const; | |
91 | ||
92 | public: | |
93 | // Menu size is dynamic now, call this whenever it might change. | |
94 | void UpdateMenuBarSize(); | |
95 | #endif // wxUSE_MENUS_NATIVE | |
96 | ||
97 | private: | |
98 | long m_fsSaveFlag; | |
99 | ||
100 | DECLARE_DYNAMIC_CLASS(wxFrame) | |
101 | }; | |
102 | ||
103 | #endif // _WX_GTK_FRAME_H_ |