]>
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 | #ifdef __GNUG__ | |
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 | class wxFrame; | |
30 | ||
31 | //----------------------------------------------------------------------------- | |
32 | // wxFrame | |
33 | //----------------------------------------------------------------------------- | |
34 | ||
35 | class wxFrame : public wxFrameBase | |
36 | { | |
37 | public: | |
38 | // construction | |
39 | wxFrame() { Init(); } | |
40 | wxFrame(wxWindow *parent, | |
41 | wxWindowID id, | |
42 | const wxString& title, | |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, | |
45 | long style = wxDEFAULT_FRAME_STYLE, | |
46 | const wxString& name = wxFrameNameStr) | |
47 | { | |
48 | Init(); | |
49 | ||
50 | Create(parent, id, title, pos, size, style, name); | |
51 | } | |
52 | ||
53 | bool Create(wxWindow *parent, | |
54 | wxWindowID id, | |
55 | const wxString& title, | |
56 | const wxPoint& pos = wxDefaultPosition, | |
57 | const wxSize& size = wxDefaultSize, | |
58 | long style = wxDEFAULT_FRAME_STYLE, | |
59 | const wxString& name = wxFrameNameStr); | |
60 | ||
61 | virtual ~wxFrame(); | |
62 | ||
63 | // implement base class pure virtuals | |
64 | virtual void Maximize(bool maximize = TRUE); | |
65 | virtual bool IsMaximized() const; | |
66 | virtual void Iconize(bool iconize = TRUE); | |
67 | virtual bool IsIconized() const; | |
68 | virtual void SetIcon(const wxIcon& icon); | |
69 | virtual void MakeModal(bool modal = TRUE); | |
70 | virtual void Restore(); | |
71 | ||
72 | virtual void SetMenuBar( wxMenuBar *menuBar ); | |
73 | ||
74 | #if wxUSE_STATUSBAR | |
75 | virtual void PositionStatusBar(); | |
76 | ||
77 | virtual wxStatusBar* CreateStatusBar(int number = 1, | |
78 | long style = wxST_SIZEGRIP, | |
79 | wxWindowID id = 0, | |
80 | const wxString& name = wxStatusLineNameStr); | |
81 | #endif // wxUSE_STATUSBAR | |
82 | ||
83 | #if wxUSE_TOOLBAR | |
84 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT, | |
85 | wxWindowID id = -1, | |
86 | const wxString& name = wxToolBarNameStr); | |
87 | void SetToolBar(wxToolBar *toolbar); | |
88 | #endif // wxUSE_TOOLBAR | |
89 | ||
90 | virtual bool Show(bool show); | |
91 | ||
92 | virtual void SetTitle( const wxString &title ); | |
93 | virtual wxString GetTitle() const { return m_title; } | |
94 | ||
95 | // implementation from now on | |
96 | // -------------------------- | |
97 | ||
98 | // move the window to the specified location and resize it: this is called | |
99 | // from both DoSetSize() and DoSetClientSize() | |
100 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
101 | ||
102 | // GTK callbacks | |
103 | virtual void GtkOnSize( int x, int y, int width, int height ); | |
104 | virtual void OnInternalIdle(); | |
105 | ||
106 | wxString m_title; | |
107 | int m_miniEdge, | |
108 | m_miniTitle; | |
109 | GtkWidget *m_mainWidget; | |
110 | bool m_menuBarDetached; | |
111 | bool m_toolBarDetached; | |
112 | bool m_insertInClientArea; /* not from within OnCreateXXX */ | |
113 | ||
114 | protected: | |
115 | // common part of all ctors | |
116 | void Init(); | |
117 | ||
118 | // override wxWindow methods to take into account tool/menu/statusbars | |
119 | virtual void DoSetSize(int x, int y, | |
120 | int width, int height, | |
121 | int sizeFlags = wxSIZE_AUTO); | |
122 | ||
123 | virtual void DoSetClientSize(int width, int height); | |
124 | virtual void DoGetClientSize( int *width, int *height ) const; | |
125 | ||
126 | private: | |
127 | DECLARE_DYNAMIC_CLASS(wxFrame) | |
128 | }; | |
129 | ||
130 | #endif // __GTKFRAMEH__ |