]>
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 | ||
11 | #ifndef __GTKFRAMEH__ | |
12 | #define __GTKFRAMEH__ | |
13 | ||
14 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
15 | #pragma interface "frame.h" | |
16 | #endif | |
17 | ||
18 | //----------------------------------------------------------------------------- | |
19 | // classes | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
22 | class wxMDIChildFrame; | |
23 | class wxMDIClientWindow; | |
24 | class wxMenu; | |
25 | class wxMenuBar; | |
26 | class wxToolBar; | |
27 | class wxStatusBar; | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | // wxFrame | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | class wxFrame : public wxFrameBase | |
34 | { | |
35 | public: | |
36 | // construction | |
37 | wxFrame() { Init(); } | |
38 | wxFrame(wxWindow *parent, | |
39 | wxWindowID id, | |
40 | const wxString& title, | |
41 | const wxPoint& pos = wxDefaultPosition, | |
42 | const wxSize& size = wxDefaultSize, | |
43 | long style = wxDEFAULT_FRAME_STYLE, | |
44 | const wxString& name = wxFrameNameStr) | |
45 | { | |
46 | Init(); | |
47 | ||
48 | Create(parent, id, title, pos, size, style, name); | |
49 | } | |
50 | ||
51 | bool Create(wxWindow *parent, | |
52 | wxWindowID id, | |
53 | const wxString& title, | |
54 | const wxPoint& pos = wxDefaultPosition, | |
55 | const wxSize& size = wxDefaultSize, | |
56 | long style = wxDEFAULT_FRAME_STYLE, | |
57 | const wxString& name = wxFrameNameStr); | |
58 | ||
59 | virtual ~wxFrame(); | |
60 | ||
61 | #if wxUSE_STATUSBAR | |
62 | virtual void PositionStatusBar(); | |
63 | ||
64 | virtual wxStatusBar* CreateStatusBar(int number = 1, | |
65 | long style = wxST_SIZEGRIP|wxFULL_REPAINT_ON_RESIZE, | |
66 | wxWindowID id = 0, | |
67 | const wxString& name = wxStatusLineNameStr); | |
68 | ||
69 | void SetStatusBar(wxStatusBar *statbar); | |
70 | #endif // wxUSE_STATUSBAR | |
71 | ||
72 | #if wxUSE_TOOLBAR | |
73 | virtual wxToolBar* CreateToolBar(long style = -1, | |
74 | wxWindowID id = -1, | |
75 | const wxString& name = wxToolBarNameStr); | |
76 | void SetToolBar(wxToolBar *toolbar); | |
77 | #endif // wxUSE_TOOLBAR | |
78 | ||
79 | wxPoint GetClientAreaOrigin() const { return wxPoint(0, 0); } | |
80 | ||
81 | // implementation from now on | |
82 | // -------------------------- | |
83 | ||
84 | // GTK callbacks | |
85 | virtual void GtkOnSize( int x, int y, int width, int height ); | |
86 | virtual void OnInternalIdle(); | |
87 | ||
88 | bool m_menuBarDetached; | |
89 | int m_menuBarHeight; | |
90 | bool m_toolBarDetached; | |
91 | ||
92 | protected: | |
93 | // common part of all ctors | |
94 | void Init(); | |
95 | ||
96 | // override wxWindow methods to take into account tool/menu/statusbars | |
97 | virtual void DoSetClientSize(int width, int height); | |
98 | virtual void DoGetClientSize( int *width, int *height ) const; | |
99 | ||
100 | #if wxUSE_MENUS_NATIVE | |
101 | ||
102 | virtual void DetachMenuBar(); | |
103 | virtual void AttachMenuBar(wxMenuBar *menubar); | |
104 | ||
105 | public: | |
106 | // Menu size is dynamic now, call this whenever it might change. | |
107 | void UpdateMenuBarSize(); | |
108 | ||
109 | #endif // wxUSE_MENUS_NATIVE | |
110 | ||
111 | DECLARE_DYNAMIC_CLASS(wxFrame) | |
112 | }; | |
113 | ||
114 | #endif // __GTKFRAMEH__ |