]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/mdi.h
Prevent seg fault for older GTK+
[wxWidgets.git] / include / wx / gtk1 / mdi.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/mdi.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __MDIH__
11#define __MDIH__
12
c801d85f
KB
13#include "wx/defs.h"
14#include "wx/object.h"
15#include "wx/list.h"
16#include "wx/control.h"
17#include "wx/panel.h"
18#include "wx/frame.h"
716b7364 19#include "wx/toolbar.h"
c801d85f
KB
20
21//-----------------------------------------------------------------------------
22// classes
23//-----------------------------------------------------------------------------
24
20123d49
MW
25class WXDLLIMPEXP_CORE wxMDIParentFrame;
26class WXDLLIMPEXP_CORE wxMDIClientWindow;
27class WXDLLIMPEXP_CORE wxMDIChildFrame;
c801d85f
KB
28
29//-----------------------------------------------------------------------------
30// global data
31//-----------------------------------------------------------------------------
32
63ec432b 33extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[];
c801d85f
KB
34
35//-----------------------------------------------------------------------------
36// wxMDIParentFrame
37//-----------------------------------------------------------------------------
38
20123d49 39class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
c801d85f 40{
ab2b3dd4 41public:
f6bcfd97
BP
42 wxMDIParentFrame() { Init(); }
43 wxMDIParentFrame(wxWindow *parent,
44 wxWindowID id,
45 const wxString& title,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
49 const wxString& name = wxFrameNameStr)
50 {
51 Init();
52
53 (void)Create(parent, id, title, pos, size, style, name);
54 }
55
d3c7fc99 56 virtual ~wxMDIParentFrame();
8487f887 57 bool Create( wxWindow *parent,
40d432c4
VZ
58 wxWindowID id,
59 const wxString& title,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
63 const wxString& name = wxFrameNameStr );
c801d85f 64
ab2b3dd4 65 wxMDIChildFrame *GetActiveChild() const;
f6bcfd97
BP
66
67 wxMDIClientWindow *GetClientWindow() const;
ab2b3dd4 68 virtual wxMDIClientWindow *OnCreateClient();
f6bcfd97 69
ab2b3dd4 70 virtual void Cascade() {}
0d97c090 71 virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {}
ab2b3dd4
RR
72 virtual void ArrangeIcons() {}
73 virtual void ActivateNext();
74 virtual void ActivatePrevious();
716b7364 75
f6bcfd97 76 // implementation
ab2b3dd4
RR
77
78 wxMDIClientWindow *m_clientWindow;
79 bool m_justInserted;
80
716b7364 81 virtual void GtkOnSize( int x, int y, int width, int height );
ab2b3dd4 82 virtual void OnInternalIdle();
f6bcfd97
BP
83
84protected:
85 void Init();
86
885df446
VZ
87 virtual void DoGetClientSize(int *width, int *height) const;
88
8487f887
RR
89private:
90 friend class wxMDIChildFrame;
f6bcfd97 91
8487f887 92 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
c801d85f
KB
93};
94
95//-----------------------------------------------------------------------------
96// wxMDIChildFrame
97//-----------------------------------------------------------------------------
98
20123d49 99class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
c801d85f 100{
8487f887 101public:
ab2b3dd4 102 wxMDIChildFrame();
c801d85f 103 wxMDIChildFrame( wxMDIParentFrame *parent,
885df446
VZ
104 wxWindowID id,
105 const wxString& title,
106 const wxPoint& pos = wxDefaultPosition,
107 const wxSize& size = wxDefaultSize,
108 long style = wxDEFAULT_FRAME_STYLE,
109 const wxString& name = wxFrameNameStr );
110
111 virtual ~wxMDIChildFrame();
c801d85f 112 bool Create( wxMDIParentFrame *parent,
885df446
VZ
113 wxWindowID id,
114 const wxString& title,
115 const wxPoint& pos = wxDefaultPosition,
116 const wxSize& size = wxDefaultSize,
117 long style = wxDEFAULT_FRAME_STYLE,
118 const wxString& name = wxFrameNameStr );
f6bcfd97 119
8487f887
RR
120 virtual void SetMenuBar( wxMenuBar *menu_bar );
121 virtual wxMenuBar *GetMenuBar() const;
c801d85f 122
8487f887 123 virtual void AddChild( wxWindowBase *child );
debe6624 124
8487f887 125 virtual void Activate();
f6bcfd97 126
dcf924a3 127#if wxUSE_STATUSBAR
cf4219e7 128 // no status bars
8487f887 129 virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
f6bcfd97 130 long WXUNUSED(style) = 1,
e90c1d2a
VZ
131 wxWindowID WXUNUSED(id) = 1,
132 const wxString& WXUNUSED(name) = wxEmptyString)
8487f887 133 { return (wxStatusBar*)NULL; }
e90c1d2a 134
8487f887
RR
135 virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
136 virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
137 virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
dcf924a3 138#endif
cf4219e7
RR
139
140 // no size hints
571f6981 141 virtual void DoSetSizeHints( int WXUNUSED(minW),
cb8cc250
WS
142 int WXUNUSED(minH),
143 int WXUNUSED(maxW) = wxDefaultCoord,
144 int WXUNUSED(maxH) = wxDefaultCoord,
145 int WXUNUSED(incW) = wxDefaultCoord,
146 int WXUNUSED(incH) = wxDefaultCoord) {}
f6bcfd97 147
dcf924a3 148#if wxUSE_TOOLBAR
05c3f0fc 149 // no toolbar
885df446
VZ
150 virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
151 wxWindowID WXUNUSED(id),
152 const wxString& WXUNUSED(name) )
153 { return (wxToolBar*)NULL; }
8487f887 154 virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
d11e8786 155#endif // wxUSE_TOOLBAR
f6bcfd97 156
cf4219e7 157 // no icon
05c3f0fc
VZ
158 virtual void SetIcons(const wxIconBundle& icons )
159 { wxTopLevelWindowBase::SetIcons(icons); }
f6bcfd97
BP
160
161 // no title
cb8cc250 162 virtual void SetTitle( const wxString &title );
f6bcfd97 163
cf4219e7 164 // no maximize etc
d11e8786
VZ
165 virtual void Maximize( bool WXUNUSED(maximize) = true ) { }
166 virtual bool IsMaximized() const { return true; }
167 virtual void Iconize(bool WXUNUSED(iconize) = true) { }
168 virtual bool IsIconized() const { return false; }
8487f887 169 virtual void Restore() {}
f6bcfd97 170
d11e8786 171 virtual bool IsTopLevel() const { return false; }
f6bcfd97
BP
172
173 void OnActivate( wxActivateEvent& event );
174 void OnMenuHighlight( wxMenuEvent& event );
175
176 // implementation
177
716b7364 178 wxMenuBar *m_menuBar;
716b7364 179 GtkNotebookPage *m_page;
ab2b3dd4 180 bool m_justInserted;
f6bcfd97 181
885df446 182protected:
ac0c857a
RR
183 // override wxFrame methods to not do anything
184 virtual void DoSetSize(int x, int y,
185 int width, int height,
186 int sizeFlags = wxSIZE_AUTO);
187 virtual void DoSetClientSize(int width, int height);
885df446
VZ
188 virtual void DoGetClientSize( int *width, int *height ) const;
189
8487f887 190private:
f6bcfd97 191 DECLARE_EVENT_TABLE()
8487f887 192 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
c801d85f
KB
193};
194
195//-----------------------------------------------------------------------------
196// wxMDIClientWindow
197//-----------------------------------------------------------------------------
198
20123d49 199class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
c801d85f 200{
ab2b3dd4 201public:
fd9811b1 202 wxMDIClientWindow();
debe6624 203 wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
d3c7fc99 204 virtual ~wxMDIClientWindow();
debe6624 205 virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
8487f887
RR
206
207private:
208 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
c801d85f
KB
209};
210
211#endif // __MDIH__