1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_MDI_H_
11 #define _WX_GTK_MDI_H_
15 class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
16 class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow
;
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxFrame
25 wxMDIParentFrame() { Init(); }
26 wxMDIParentFrame(wxWindow
*parent
,
28 const wxString
& title
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
32 const wxString
& name
= wxFrameNameStr
)
36 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
39 virtual ~wxMDIParentFrame();
40 bool Create( wxWindow
*parent
,
42 const wxString
& title
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
46 const wxString
& name
= wxFrameNameStr
);
48 wxMDIChildFrame
*GetActiveChild() const;
50 wxMDIClientWindow
*GetClientWindow() const;
51 virtual wxMDIClientWindow
*OnCreateClient();
53 virtual void Cascade() {}
54 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) {}
55 virtual void ArrangeIcons() {}
56 virtual void ActivateNext();
57 virtual void ActivatePrevious();
61 wxMDIClientWindow
*m_clientWindow
;
64 virtual void OnInternalIdle();
68 virtual void DoGetClientSize(int* width
, int* height
) const;
71 friend class wxMDIChildFrame
;
73 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
76 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
80 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxFrame
84 wxMDIChildFrame( wxMDIParentFrame
*parent
,
86 const wxString
& title
,
87 const wxPoint
& pos
= wxDefaultPosition
,
88 const wxSize
& size
= wxDefaultSize
,
89 long style
= wxDEFAULT_FRAME_STYLE
,
90 const wxString
& name
= wxFrameNameStr
);
92 virtual ~wxMDIChildFrame();
93 bool Create( wxMDIParentFrame
*parent
,
95 const wxString
& title
,
96 const wxPoint
& pos
= wxDefaultPosition
,
97 const wxSize
& size
= wxDefaultSize
,
98 long style
= wxDEFAULT_FRAME_STYLE
,
99 const wxString
& name
= wxFrameNameStr
);
101 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
102 virtual wxMenuBar
*GetMenuBar() const;
104 virtual void AddChild( wxWindowBase
*child
);
106 virtual void Activate();
110 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
) = 1,
111 long WXUNUSED(style
) = 1,
112 wxWindowID
WXUNUSED(id
) = 1,
113 const wxString
& WXUNUSED(name
) = wxEmptyString
)
114 { return (wxStatusBar
*)NULL
; }
116 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
117 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
118 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
123 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
),
124 wxWindowID
WXUNUSED(id
),
125 const wxString
& WXUNUSED(name
) )
126 { return (wxToolBar
*)NULL
; }
127 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
128 #endif // wxUSE_TOOLBAR
131 virtual void SetIcons(const wxIconBundle
& icons
)
132 { wxTopLevelWindowBase::SetIcons(icons
); }
135 virtual void SetTitle( const wxString
&title
);
138 virtual void Maximize( bool WXUNUSED(maximize
) = true ) { }
139 virtual bool IsMaximized() const { return true; }
140 virtual void Iconize(bool WXUNUSED(iconize
) = true) { }
141 virtual bool IsIconized() const { return false; }
142 virtual void Restore() {}
144 virtual bool IsTopLevel() const { return false; }
146 virtual bool Destroy();
148 void OnActivate( wxActivateEvent
& event
);
149 void OnMenuHighlight( wxMenuEvent
& event
);
153 wxMenuBar
*m_menuBar
;
154 GtkNotebookPage
*m_page
;
158 // override wxFrame methods to not do anything
159 virtual void DoSetSize(int x
, int y
,
160 int width
, int height
,
161 int sizeFlags
= wxSIZE_AUTO
);
164 virtual void DoSetSizeHints(int WXUNUSED(minW
), int WXUNUSED(minH
),
165 int WXUNUSED(maxW
), int WXUNUSED(maxH
),
166 int WXUNUSED(incW
), int WXUNUSED(incH
)) {}
169 DECLARE_EVENT_TABLE()
170 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
173 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
177 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxWindow
181 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
182 virtual ~wxMDIClientWindow();
183 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
186 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
189 #endif // _WX_GTK_MDI_H_