]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
7c0ea335 | 2 | // Name: wx/gtk/frame.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
58614078 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart | |
ab16f4a3 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | ||
11 | #ifndef __GTKFRAMEH__ | |
12 | #define __GTKFRAMEH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
7c0ea335 | 15 | #pragma interface "frame.h" |
c801d85f KB |
16 | #endif |
17 | ||
c801d85f KB |
18 | //----------------------------------------------------------------------------- |
19 | // classes | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
716b7364 | 22 | class wxMDIChildFrame; |
cf4219e7 RR |
23 | class wxMDIClientWindow; |
24 | class wxMenu; | |
25 | class wxMenuBar; | |
26 | class wxToolBar; | |
27 | class wxStatusBar; | |
c801d85f KB |
28 | |
29 | class wxFrame; | |
30 | ||
c801d85f KB |
31 | //----------------------------------------------------------------------------- |
32 | // wxFrame | |
33 | //----------------------------------------------------------------------------- | |
34 | ||
7c0ea335 | 35 | class wxFrame : public wxFrameBase |
c801d85f | 36 | { |
bfc6fde4 | 37 | public: |
7c0ea335 | 38 | // construction |
ddb6bc71 | 39 | wxFrame() { Init(); } |
7c0ea335 VZ |
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 | ||
3d0c4d2e RR |
72 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); |
73 | virtual bool IsFullScreen() const { return m_fsIsShowing; }; | |
74 | ||
7c0ea335 | 75 | virtual void SetMenuBar( wxMenuBar *menuBar ); |
bfc6fde4 | 76 | |
88ac883a | 77 | #if wxUSE_STATUSBAR |
8febdd39 RR |
78 | virtual void PositionStatusBar(); |
79 | ||
7c0ea335 VZ |
80 | virtual wxStatusBar* CreateStatusBar(int number = 1, |
81 | long style = wxST_SIZEGRIP, | |
82 | wxWindowID id = 0, | |
83 | const wxString& name = wxStatusLineNameStr); | |
88ac883a | 84 | #endif // wxUSE_STATUSBAR |
bfc6fde4 | 85 | |
88ac883a | 86 | #if wxUSE_TOOLBAR |
7c0ea335 VZ |
87 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT, |
88 | wxWindowID id = -1, | |
89 | const wxString& name = wxToolBarNameStr); | |
307f16e8 | 90 | void SetToolBar(wxToolBar *toolbar); |
88ac883a | 91 | #endif // wxUSE_TOOLBAR |
bfc6fde4 | 92 | |
a6e2b3a8 | 93 | virtual bool Show(bool show = TRUE); |
bfc6fde4 VZ |
94 | |
95 | virtual void SetTitle( const wxString &title ); | |
96 | virtual wxString GetTitle() const { return m_title; } | |
97 | ||
7c0ea335 VZ |
98 | // implementation from now on |
99 | // -------------------------- | |
bfc6fde4 | 100 | |
23efdd02 | 101 | // move the window to the specified location and resize it: this is called |
3dd9b88a | 102 | // from both DoSetSize() and DoSetClientSize() |
23efdd02 | 103 | virtual void DoMoveWindow(int x, int y, int width, int height); |
3dd9b88a | 104 | |
7c0ea335 | 105 | // GTK callbacks |
bfc6fde4 | 106 | virtual void GtkOnSize( int x, int y, int width, int height ); |
bfc6fde4 VZ |
107 | virtual void OnInternalIdle(); |
108 | ||
3dd9b88a VZ |
109 | // do *not* call this to iconize the frame, this is a private function! |
110 | void SetIconizeState(bool iconic); | |
111 | ||
bfc6fde4 | 112 | wxString m_title; |
7c0ea335 VZ |
113 | int m_miniEdge, |
114 | m_miniTitle; | |
f362b96d | 115 | GtkWidget *m_mainWidget; |
16bcc879 RR |
116 | bool m_menuBarDetached; |
117 | bool m_toolBarDetached; | |
6bc8a1c8 | 118 | bool m_insertInClientArea; /* not from within OnCreateXXX */ |
bfc6fde4 | 119 | |
3d0c4d2e RR |
120 | bool m_fsIsShowing; /* full screen */ |
121 | long m_fsSaveStyle; | |
122 | long m_fsSaveFlag; | |
123 | wxRect m_fsSaveFrame; | |
124 | ||
bfc6fde4 | 125 | protected: |
ddb6bc71 RR |
126 | // common part of all ctors |
127 | void Init(); | |
7c0ea335 | 128 | |
1c4f8f8d | 129 | // override wxWindow methods to take into account tool/menu/statusbars |
bfc6fde4 VZ |
130 | virtual void DoSetSize(int x, int y, |
131 | int width, int height, | |
132 | int sizeFlags = wxSIZE_AUTO); | |
133 | ||
134 | virtual void DoSetClientSize(int width, int height); | |
f9241296 | 135 | virtual void DoGetClientSize( int *width, int *height ) const; |
bfc6fde4 | 136 | |
3dd9b88a VZ |
137 | // is the frame currently iconized? |
138 | bool m_isIconized; | |
139 | ||
bfc6fde4 | 140 | private: |
7c0ea335 | 141 | DECLARE_DYNAMIC_CLASS(wxFrame) |
c801d85f KB |
142 | }; |
143 | ||
144 | #endif // __GTKFRAMEH__ |