1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: TDI-based MDI implementation for wxGTK
4 // Author: Robert Roebling
5 // Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
7 // Copyright: (c) 1998 Robert Roebling
8 // (c) 2008 Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GTK_MDI_H_
13 #define _WX_GTK_MDI_H_
17 class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
18 class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow
;
20 typedef struct _GtkNotebook GtkNotebook
;
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
26 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxMDIParentFrameBase
29 wxMDIParentFrame() { Init(); }
30 wxMDIParentFrame(wxWindow
*parent
,
32 const wxString
& title
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
36 const wxString
& name
= wxFrameNameStr
)
40 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
43 bool Create(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
);
51 // we don't store the active child in m_currentChild unlike the base class
52 // version so override this method to find it dynamically
53 virtual wxMDIChildFrame
*GetActiveChild() const;
55 // implement base class pure virtuals
56 // ----------------------------------
58 virtual void ActivateNext();
59 virtual void ActivatePrevious();
61 static bool IsTDI() { return true; }
67 virtual void OnInternalIdle();
70 virtual void DoGetClientSize(int* width
, int* height
) const;
73 friend class wxMDIChildFrame
;
76 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
79 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
83 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxTDIChildFrame
86 wxMDIChildFrame() { Init(); }
87 wxMDIChildFrame(wxMDIParentFrame
*parent
,
89 const wxString
& title
,
90 const wxPoint
& pos
= wxDefaultPosition
,
91 const wxSize
& size
= wxDefaultSize
,
92 long style
= wxDEFAULT_FRAME_STYLE
,
93 const wxString
& name
= wxFrameNameStr
)
97 Create(parent
, id
, title
, pos
, size
, style
, name
);
100 bool Create(wxMDIParentFrame
*parent
,
102 const wxString
& title
,
103 const wxPoint
& pos
= wxDefaultPosition
,
104 const wxSize
& size
= wxDefaultSize
,
105 long style
= wxDEFAULT_FRAME_STYLE
,
106 const wxString
& name
= wxFrameNameStr
);
108 virtual ~wxMDIChildFrame();
110 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
111 virtual wxMenuBar
*GetMenuBar() const;
113 virtual void Activate();
115 virtual void SetTitle(const wxString
& title
);
119 void OnActivate( wxActivateEvent
& event
);
120 void OnMenuHighlight( wxMenuEvent
& event
);
121 virtual void GTKHandleRealized();
123 wxMenuBar
*m_menuBar
;
129 GtkNotebook
*GTKGetNotebook() const;
131 DECLARE_EVENT_TABLE()
132 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
135 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
139 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
142 wxMDIClientWindow() { }
143 ~wxMDIClientWindow();
145 virtual bool CreateClient(wxMDIParentFrame
*parent
,
146 long style
= wxVSCROLL
| wxHSCROLL
);
149 virtual void AddChildGTK(wxWindowGTK
* child
);
151 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
154 #endif // _WX_GTK_MDI_H_