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 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxFrame
22 wxMDIParentFrame() { Init(); }
23 wxMDIParentFrame(wxWindow
*parent
,
25 const wxString
& title
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
28 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
29 const wxString
& name
= wxFrameNameStr
)
33 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
36 virtual ~wxMDIParentFrame();
37 bool Create( wxWindow
*parent
,
39 const wxString
& title
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
42 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
43 const wxString
& name
= wxFrameNameStr
);
45 wxMDIChildFrame
*GetActiveChild() const;
47 wxMDIClientWindow
*GetClientWindow() const;
48 virtual wxMDIClientWindow
*OnCreateClient();
50 virtual void Cascade() {}
51 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) {}
52 virtual void ArrangeIcons() {}
53 virtual void ActivateNext();
54 virtual void ActivatePrevious();
58 wxMDIClientWindow
*m_clientWindow
;
61 virtual void GtkOnSize();
62 virtual void OnInternalIdle();
67 virtual void DoGetClientSize(int *width
, int *height
) const;
70 friend class wxMDIChildFrame
;
72 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
75 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
79 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxFrame
83 wxMDIChildFrame( wxMDIParentFrame
*parent
,
85 const wxString
& title
,
86 const wxPoint
& pos
= wxDefaultPosition
,
87 const wxSize
& size
= wxDefaultSize
,
88 long style
= wxDEFAULT_FRAME_STYLE
,
89 const wxString
& name
= wxFrameNameStr
);
91 virtual ~wxMDIChildFrame();
92 bool Create( wxMDIParentFrame
*parent
,
94 const wxString
& title
,
95 const wxPoint
& pos
= wxDefaultPosition
,
96 const wxSize
& size
= wxDefaultSize
,
97 long style
= wxDEFAULT_FRAME_STYLE
,
98 const wxString
& name
= wxFrameNameStr
);
100 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
101 virtual wxMenuBar
*GetMenuBar() const;
103 virtual void AddChild( wxWindowBase
*child
);
105 virtual void Activate();
109 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
) = 1,
110 long WXUNUSED(style
) = 1,
111 wxWindowID
WXUNUSED(id
) = 1,
112 const wxString
& WXUNUSED(name
) = wxEmptyString
)
113 { return (wxStatusBar
*)NULL
; }
115 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
116 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
117 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
121 virtual void DoSetSizeHints( int WXUNUSED(minW
),
123 int WXUNUSED(maxW
) = wxDefaultCoord
,
124 int WXUNUSED(maxH
) = wxDefaultCoord
,
125 int WXUNUSED(incW
) = wxDefaultCoord
,
126 int WXUNUSED(incH
) = wxDefaultCoord
) {}
130 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
),
131 wxWindowID
WXUNUSED(id
),
132 const wxString
& WXUNUSED(name
) )
133 { return (wxToolBar
*)NULL
; }
134 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
135 #endif // wxUSE_TOOLBAR
138 virtual void SetIcon(const wxIcon
& icon
)
139 { wxTopLevelWindowBase::SetIcon(icon
); }
140 virtual void SetIcons(const wxIconBundle
& icons
)
141 { wxTopLevelWindowBase::SetIcons(icons
); }
144 virtual void SetTitle( const wxString
&title
);
147 virtual void Maximize( bool WXUNUSED(maximize
) = true ) { }
148 virtual bool IsMaximized() const { return true; }
149 virtual void Iconize(bool WXUNUSED(iconize
) = true) { }
150 virtual bool IsIconized() const { return false; }
151 virtual void Restore() {}
153 virtual bool IsTopLevel() const { return false; }
155 void OnActivate( wxActivateEvent
& event
);
156 void OnMenuHighlight( wxMenuEvent
& event
);
160 wxMenuBar
*m_menuBar
;
161 GtkNotebookPage
*m_page
;
165 // override wxFrame methods to not do anything
166 virtual void DoSetSize(int x
, int y
,
167 int width
, int height
,
168 int sizeFlags
= wxSIZE_AUTO
);
169 virtual void DoSetClientSize(int width
, int height
);
170 virtual void DoGetClientSize( int *width
, int *height
) const;
173 DECLARE_EVENT_TABLE()
174 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
177 //-----------------------------------------------------------------------------
179 //-----------------------------------------------------------------------------
181 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxWindow
185 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
186 virtual ~wxMDIClientWindow();
187 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
190 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
193 #endif // _WX_GTK_MDI_H_