1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: TDI-based MDI implementation for wxGTK1
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_GTK1_MDI_H_
13 #define _WX_GTK1_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 GtkOnSize( int x
, int y
, int width
, int height
);
68 virtual void OnInternalIdle();
73 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
76 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
80 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxTDIChildFrame
83 wxMDIChildFrame() { Init(); }
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
)
94 Create(parent
, id
, title
, pos
, size
, style
, name
);
97 bool Create(wxMDIParentFrame
*parent
,
99 const wxString
& title
,
100 const wxPoint
& pos
= wxDefaultPosition
,
101 const wxSize
& size
= wxDefaultSize
,
102 long style
= wxDEFAULT_FRAME_STYLE
,
103 const wxString
& name
= wxFrameNameStr
);
105 virtual ~wxMDIChildFrame();
107 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
108 virtual wxMenuBar
*GetMenuBar() const;
110 virtual void Activate();
112 virtual void SetTitle(const wxString
& title
);
116 void OnActivate( wxActivateEvent
& event
);
117 void OnMenuHighlight( wxMenuEvent
& event
);
119 wxMenuBar
*m_menuBar
;
120 GtkNotebookPage
*m_page
;
126 GtkNotebook
*GTKGetNotebook() const;
128 DECLARE_EVENT_TABLE()
129 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
132 //-----------------------------------------------------------------------------
134 //-----------------------------------------------------------------------------
136 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
139 wxMDIClientWindow() { }
141 virtual bool CreateClient(wxMDIParentFrame
*parent
,
142 long style
= wxVSCROLL
| wxHSCROLL
);
145 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
148 #endif // _WX_GTK1_MDI_H_