1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/object.h"
16 #include "wx/control.h"
19 #include "wx/toolbar.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxMDIParentFrame
;
26 class WXDLLIMPEXP_CORE wxMDIClientWindow
;
27 class WXDLLIMPEXP_CORE wxMDIChildFrame
;
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 extern WXDLLIMPEXP_CORE
const wxChar
* wxFrameNameStr
;
34 extern WXDLLIMPEXP_CORE
const wxChar
* wxStatusLineNameStr
;
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxFrame
43 wxMDIParentFrame() { Init(); }
44 wxMDIParentFrame(wxWindow
*parent
,
46 const wxString
& title
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
50 const wxString
& name
= wxFrameNameStr
)
54 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
58 bool Create( wxWindow
*parent
,
60 const wxString
& title
,
61 const wxPoint
& pos
= wxDefaultPosition
,
62 const wxSize
& size
= wxDefaultSize
,
63 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
64 const wxString
& name
= wxFrameNameStr
);
66 wxMDIChildFrame
*GetActiveChild() const;
68 wxMDIClientWindow
*GetClientWindow() const;
69 virtual wxMDIClientWindow
*OnCreateClient();
71 virtual void Cascade() {}
72 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) {}
73 virtual void ArrangeIcons() {}
74 virtual void ActivateNext();
75 virtual void ActivatePrevious();
79 wxMDIClientWindow
*m_clientWindow
;
82 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
83 virtual void OnInternalIdle();
88 virtual void DoGetClientSize(int *width
, int *height
) const;
91 friend class wxMDIChildFrame
;
93 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
96 //-----------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
100 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxFrame
104 wxMDIChildFrame( wxMDIParentFrame
*parent
,
106 const wxString
& title
,
107 const wxPoint
& pos
= wxDefaultPosition
,
108 const wxSize
& size
= wxDefaultSize
,
109 long style
= wxDEFAULT_FRAME_STYLE
,
110 const wxString
& name
= wxFrameNameStr
);
112 virtual ~wxMDIChildFrame();
113 bool Create( wxMDIParentFrame
*parent
,
115 const wxString
& title
,
116 const wxPoint
& pos
= wxDefaultPosition
,
117 const wxSize
& size
= wxDefaultSize
,
118 long style
= wxDEFAULT_FRAME_STYLE
,
119 const wxString
& name
= wxFrameNameStr
);
121 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
122 virtual wxMenuBar
*GetMenuBar() const;
124 virtual void AddChild( wxWindowBase
*child
);
126 virtual void Activate();
130 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
) = 1,
131 long WXUNUSED(style
) = 1,
132 wxWindowID
WXUNUSED(id
) = 1,
133 const wxString
& WXUNUSED(name
) = wxEmptyString
)
134 { return (wxStatusBar
*)NULL
; }
136 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
137 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
138 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
142 virtual void DoSetSizeHints( int WXUNUSED(minW
),
144 int WXUNUSED(maxW
) = -1,
145 int WXUNUSED(maxH
) = -1,
146 int WXUNUSED(incW
) = -1,
147 int WXUNUSED(incH
) = -1) {}
151 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
),
152 wxWindowID
WXUNUSED(id
),
153 const wxString
& WXUNUSED(name
) )
154 { return (wxToolBar
*)NULL
; }
155 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
156 #endif // wxUSE_TOOLBAR
159 virtual void SetIcon(const wxIcon
& icon
)
160 { wxTopLevelWindowBase::SetIcon(icon
); }
161 virtual void SetIcons(const wxIconBundle
& icons
)
162 { wxTopLevelWindowBase::SetIcons(icons
); }
165 void SetTitle( const wxString
&title
);
166 wxString
GetTitle() const { return m_title
; }
169 virtual void Maximize( bool WXUNUSED(maximize
) = true ) { }
170 virtual bool IsMaximized() const { return true; }
171 virtual void Iconize(bool WXUNUSED(iconize
) = true) { }
172 virtual bool IsIconized() const { return false; }
173 virtual void Restore() {}
175 virtual bool IsTopLevel() const { return false; }
177 void OnActivate( wxActivateEvent
& event
);
178 void OnMenuHighlight( wxMenuEvent
& event
);
182 wxMenuBar
*m_menuBar
;
183 GtkNotebookPage
*m_page
;
187 // override wxFrame methods to not do anything
188 virtual void DoSetSize(int x
, int y
,
189 int width
, int height
,
190 int sizeFlags
= wxSIZE_AUTO
);
191 virtual void DoSetClientSize(int width
, int height
);
192 virtual void DoGetClientSize( int *width
, int *height
) const;
195 DECLARE_EVENT_TABLE()
196 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
199 //-----------------------------------------------------------------------------
201 //-----------------------------------------------------------------------------
203 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxWindow
207 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
208 ~wxMDIClientWindow();
209 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
212 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)