1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
14 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
19 #include "wx/object.h"
21 #include "wx/control.h"
24 #include "wx/toolbar.h"
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 class WXDLLIMPEXP_CORE wxMDIParentFrame
;
31 class WXDLLIMPEXP_CORE wxMDIClientWindow
;
32 class WXDLLIMPEXP_CORE wxMDIChildFrame
;
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
38 extern WXDLLIMPEXP_CORE
const wxChar
* wxFrameNameStr
;
39 extern WXDLLIMPEXP_CORE
const wxChar
* wxStatusLineNameStr
;
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxFrame
48 wxMDIParentFrame() { Init(); }
49 wxMDIParentFrame(wxWindow
*parent
,
51 const wxString
& title
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
55 const wxString
& name
= wxFrameNameStr
)
59 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
63 bool Create( wxWindow
*parent
,
65 const wxString
& title
,
66 const wxPoint
& pos
= wxDefaultPosition
,
67 const wxSize
& size
= wxDefaultSize
,
68 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
69 const wxString
& name
= wxFrameNameStr
);
71 wxMDIChildFrame
*GetActiveChild() const;
73 wxMDIClientWindow
*GetClientWindow() const;
74 virtual wxMDIClientWindow
*OnCreateClient();
76 virtual void Cascade() {}
77 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) {}
78 virtual void ArrangeIcons() {}
79 virtual void ActivateNext();
80 virtual void ActivatePrevious();
84 wxMDIClientWindow
*m_clientWindow
;
87 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
88 virtual void OnInternalIdle();
93 virtual void DoGetClientSize(int *width
, int *height
) const;
96 friend class wxMDIChildFrame
;
98 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
101 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
105 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxFrame
109 wxMDIChildFrame( wxMDIParentFrame
*parent
,
111 const wxString
& title
,
112 const wxPoint
& pos
= wxDefaultPosition
,
113 const wxSize
& size
= wxDefaultSize
,
114 long style
= wxDEFAULT_FRAME_STYLE
,
115 const wxString
& name
= wxFrameNameStr
);
117 virtual ~wxMDIChildFrame();
118 bool Create( wxMDIParentFrame
*parent
,
120 const wxString
& title
,
121 const wxPoint
& pos
= wxDefaultPosition
,
122 const wxSize
& size
= wxDefaultSize
,
123 long style
= wxDEFAULT_FRAME_STYLE
,
124 const wxString
& name
= wxFrameNameStr
);
126 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
127 virtual wxMenuBar
*GetMenuBar() const;
129 virtual void AddChild( wxWindowBase
*child
);
131 virtual void Activate();
135 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
) = 1,
136 long WXUNUSED(style
) = 1,
137 wxWindowID
WXUNUSED(id
) = 1,
138 const wxString
& WXUNUSED(name
) = wxEmptyString
)
139 { return (wxStatusBar
*)NULL
; }
141 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
142 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
143 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
147 virtual void DoSetSizeHints( int WXUNUSED(minW
),
149 int WXUNUSED(maxW
) = -1,
150 int WXUNUSED(maxH
) = -1,
151 int WXUNUSED(incW
) = -1,
152 int WXUNUSED(incH
) = -1) {}
156 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
),
157 wxWindowID
WXUNUSED(id
),
158 const wxString
& WXUNUSED(name
) )
159 { return (wxToolBar
*)NULL
; }
160 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
161 #endif // wxUSE_TOOLBAR
164 virtual void SetIcon(const wxIcon
& icon
)
165 { wxTopLevelWindowBase::SetIcon(icon
); }
166 virtual void SetIcons(const wxIconBundle
& icons
)
167 { wxTopLevelWindowBase::SetIcons(icons
); }
170 void SetTitle( const wxString
&title
);
171 wxString
GetTitle() const { return m_title
; }
174 virtual void Maximize( bool WXUNUSED(maximize
) = true ) { }
175 virtual bool IsMaximized() const { return true; }
176 virtual void Iconize(bool WXUNUSED(iconize
) = true) { }
177 virtual bool IsIconized() const { return false; }
178 virtual void Restore() {}
180 virtual bool IsTopLevel() const { return false; }
182 void OnActivate( wxActivateEvent
& event
);
183 void OnMenuHighlight( wxMenuEvent
& event
);
187 wxMenuBar
*m_menuBar
;
188 GtkNotebookPage
*m_page
;
192 // override wxFrame methods to not do anything
193 virtual void DoSetSize(int x
, int y
,
194 int width
, int height
,
195 int sizeFlags
= wxSIZE_AUTO
);
196 virtual void DoSetClientSize(int width
, int height
);
197 virtual void DoGetClientSize( int *width
, int *height
) const;
200 DECLARE_EVENT_TABLE()
201 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
204 //-----------------------------------------------------------------------------
206 //-----------------------------------------------------------------------------
208 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxWindow
212 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
213 ~wxMDIClientWindow();
214 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
217 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)