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
6 // Copyright: (c) 1998 Robert Roebling
7 // (c) 2008 Vadim Zeitlin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_MDI_H_
12 #define _WX_GTK_MDI_H_
16 class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
17 class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow
;
19 typedef struct _GtkNotebook GtkNotebook
;
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxMDIParentFrameBase
28 wxMDIParentFrame() { Init(); }
29 wxMDIParentFrame(wxWindow
*parent
,
31 const wxString
& title
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
35 const wxString
& name
= wxFrameNameStr
)
39 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
,
44 const wxString
& title
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
48 const wxString
& name
= wxFrameNameStr
);
50 // we don't store the active child in m_currentChild unlike the base class
51 // version so override this method to find it dynamically
52 virtual wxMDIChildFrame
*GetActiveChild() const;
54 // implement base class pure virtuals
55 // ----------------------------------
57 virtual void ActivateNext();
58 virtual void ActivatePrevious();
60 static bool IsTDI() { return true; }
66 virtual void OnInternalIdle();
69 virtual void DoGetClientSize(int* width
, int* height
) const;
72 friend class wxMDIChildFrame
;
75 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
78 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
82 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxTDIChildFrame
85 wxMDIChildFrame() { Init(); }
86 wxMDIChildFrame(wxMDIParentFrame
*parent
,
88 const wxString
& title
,
89 const wxPoint
& pos
= wxDefaultPosition
,
90 const wxSize
& size
= wxDefaultSize
,
91 long style
= wxDEFAULT_FRAME_STYLE
,
92 const wxString
& name
= wxFrameNameStr
)
96 Create(parent
, id
, title
, pos
, size
, style
, name
);
99 bool Create(wxMDIParentFrame
*parent
,
101 const wxString
& title
,
102 const wxPoint
& pos
= wxDefaultPosition
,
103 const wxSize
& size
= wxDefaultSize
,
104 long style
= wxDEFAULT_FRAME_STYLE
,
105 const wxString
& name
= wxFrameNameStr
);
107 virtual ~wxMDIChildFrame();
109 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
110 virtual wxMenuBar
*GetMenuBar() const;
112 virtual void Activate();
114 virtual void SetTitle(const wxString
& title
);
118 void OnActivate( wxActivateEvent
& event
);
119 void OnMenuHighlight( wxMenuEvent
& event
);
120 virtual void GTKHandleRealized();
122 wxMenuBar
*m_menuBar
;
128 GtkNotebook
*GTKGetNotebook() const;
130 DECLARE_EVENT_TABLE()
131 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
134 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
138 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
141 wxMDIClientWindow() { }
142 ~wxMDIClientWindow();
144 virtual bool CreateClient(wxMDIParentFrame
*parent
,
145 long style
= wxVSCROLL
| wxHSCROLL
);
148 virtual void AddChildGTK(wxWindowGTK
* child
);
150 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
153 #endif // _WX_GTK_MDI_H_