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_FWD_CORE wxMDIParentFrame
;
26 class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow
;
27 class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusLineNameStr
[];
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxFrame
42 wxMDIParentFrame() { Init(); }
43 wxMDIParentFrame(wxWindow
*parent
,
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
)
53 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
56 virtual ~wxMDIParentFrame();
57 bool Create( wxWindow
*parent
,
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
);
65 wxMDIChildFrame
*GetActiveChild() const;
67 wxMDIClientWindow
*GetClientWindow() const;
68 virtual wxMDIClientWindow
*OnCreateClient();
70 virtual void Cascade() {}
71 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) {}
72 virtual void ArrangeIcons() {}
73 virtual void ActivateNext();
74 virtual void ActivatePrevious();
78 wxMDIClientWindow
*m_clientWindow
;
81 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
82 virtual void OnInternalIdle();
87 virtual void DoGetClientSize(int *width
, int *height
) const;
90 friend class wxMDIChildFrame
;
92 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
95 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
99 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxFrame
103 wxMDIChildFrame( wxMDIParentFrame
*parent
,
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
);
111 virtual ~wxMDIChildFrame();
112 bool Create( wxMDIParentFrame
*parent
,
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
);
120 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
121 virtual wxMenuBar
*GetMenuBar() const;
123 virtual void AddChild( wxWindowBase
*child
);
125 virtual void Activate();
129 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
) = 1,
130 long WXUNUSED(style
) = 1,
131 wxWindowID
WXUNUSED(id
) = 1,
132 const wxString
& WXUNUSED(name
) = wxEmptyString
)
133 { return (wxStatusBar
*)NULL
; }
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
)[] ) {}
141 virtual void DoSetSizeHints( int WXUNUSED(minW
),
143 int WXUNUSED(maxW
) = wxDefaultCoord
,
144 int WXUNUSED(maxH
) = wxDefaultCoord
,
145 int WXUNUSED(incW
) = wxDefaultCoord
,
146 int WXUNUSED(incH
) = wxDefaultCoord
) {}
150 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
),
151 wxWindowID
WXUNUSED(id
),
152 const wxString
& WXUNUSED(name
) )
153 { return (wxToolBar
*)NULL
; }
154 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
155 #endif // wxUSE_TOOLBAR
158 virtual void SetIcons(const wxIconBundle
& icons
)
159 { wxTopLevelWindowBase::SetIcons(icons
); }
162 virtual void SetTitle( const wxString
&title
);
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; }
169 virtual void Restore() {}
171 virtual bool IsTopLevel() const { return false; }
173 void OnActivate( wxActivateEvent
& event
);
174 void OnMenuHighlight( wxMenuEvent
& event
);
178 wxMenuBar
*m_menuBar
;
179 GtkNotebookPage
*m_page
;
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
);
188 virtual void DoGetClientSize( int *width
, int *height
) const;
191 DECLARE_EVENT_TABLE()
192 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
195 //-----------------------------------------------------------------------------
197 //-----------------------------------------------------------------------------
199 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxWindow
203 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
204 virtual ~wxMDIClientWindow();
205 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
208 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)