]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
cb8cc250 | 2 | // Name: wx/gtk/mdi.h |
d2824cdb | 3 | // Purpose: TDI-based MDI implementation for wxGTK |
c801d85f | 4 | // Author: Robert Roebling |
d2824cdb | 5 | // Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes |
58614078 | 6 | // Copyright: (c) 1998 Robert Roebling |
d2824cdb | 7 | // (c) 2008 Vadim Zeitlin |
65571936 | 8 | // Licence: wxWindows licence |
c801d85f KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
0416c418 PC |
11 | #ifndef _WX_GTK_MDI_H_ |
12 | #define _WX_GTK_MDI_H_ | |
c801d85f | 13 | |
0416c418 | 14 | #include "wx/frame.h" |
c801d85f | 15 | |
cca410b3 PC |
16 | class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; |
17 | class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; | |
18 | ||
d2824cdb VZ |
19 | typedef struct _GtkNotebook GtkNotebook; |
20 | ||
c801d85f KB |
21 | //----------------------------------------------------------------------------- |
22 | // wxMDIParentFrame | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
d2824cdb | 25 | class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase |
c801d85f | 26 | { |
ab2b3dd4 | 27 | public: |
f6bcfd97 BP |
28 | wxMDIParentFrame() { Init(); } |
29 | wxMDIParentFrame(wxWindow *parent, | |
30 | wxWindowID id, | |
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) | |
36 | { | |
37 | Init(); | |
38 | ||
39 | (void)Create(parent, id, title, pos, size, style, name); | |
40 | } | |
41 | ||
d2824cdb VZ |
42 | bool Create(wxWindow *parent, |
43 | wxWindowID id, | |
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); | |
c801d85f | 49 | |
d2824cdb VZ |
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; | |
f6bcfd97 | 53 | |
d2824cdb VZ |
54 | // implement base class pure virtuals |
55 | // ---------------------------------- | |
f6bcfd97 | 56 | |
ab2b3dd4 RR |
57 | virtual void ActivateNext(); |
58 | virtual void ActivatePrevious(); | |
716b7364 | 59 | |
d2824cdb VZ |
60 | static bool IsTDI() { return true; } |
61 | ||
f6bcfd97 | 62 | // implementation |
ab2b3dd4 | 63 | |
ab2b3dd4 RR |
64 | bool m_justInserted; |
65 | ||
ab2b3dd4 | 66 | virtual void OnInternalIdle(); |
f6bcfd97 BP |
67 | |
68 | protected: | |
cca410b3 | 69 | virtual void DoGetClientSize(int* width, int* height) const; |
f6bcfd97 | 70 | |
8487f887 RR |
71 | private: |
72 | friend class wxMDIChildFrame; | |
95dc31e0 | 73 | void Init(); |
f6bcfd97 | 74 | |
8487f887 | 75 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) |
c801d85f KB |
76 | }; |
77 | ||
78 | //----------------------------------------------------------------------------- | |
79 | // wxMDIChildFrame | |
80 | //----------------------------------------------------------------------------- | |
81 | ||
d2824cdb | 82 | class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame |
c801d85f | 83 | { |
8487f887 | 84 | public: |
d2824cdb VZ |
85 | wxMDIChildFrame() { Init(); } |
86 | wxMDIChildFrame(wxMDIParentFrame *parent, | |
87 | wxWindowID id, | |
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) | |
93 | { | |
94 | Init(); | |
95 | ||
96 | Create(parent, id, title, pos, size, style, name); | |
97 | } | |
98 | ||
99 | bool Create(wxMDIParentFrame *parent, | |
100 | wxWindowID id, | |
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); | |
885df446 VZ |
106 | |
107 | virtual ~wxMDIChildFrame(); | |
f6bcfd97 | 108 | |
8487f887 RR |
109 | virtual void SetMenuBar( wxMenuBar *menu_bar ); |
110 | virtual wxMenuBar *GetMenuBar() const; | |
c801d85f | 111 | |
8487f887 | 112 | virtual void Activate(); |
f6bcfd97 | 113 | |
d2824cdb VZ |
114 | virtual void SetTitle(const wxString& title); |
115 | ||
116 | // implementation | |
3811dacb | 117 | |
f6bcfd97 BP |
118 | void OnActivate( wxActivateEvent& event ); |
119 | void OnMenuHighlight( wxMenuEvent& event ); | |
3ec3c160 | 120 | virtual void GTKHandleRealized(); |
f6bcfd97 | 121 | |
716b7364 | 122 | wxMenuBar *m_menuBar; |
ab2b3dd4 | 123 | bool m_justInserted; |
f6bcfd97 | 124 | |
d2824cdb VZ |
125 | private: |
126 | void Init(); | |
885df446 | 127 | |
d2824cdb | 128 | GtkNotebook *GTKGetNotebook() const; |
b2e10dac | 129 | |
f6bcfd97 | 130 | DECLARE_EVENT_TABLE() |
8487f887 | 131 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) |
c801d85f KB |
132 | }; |
133 | ||
134 | //----------------------------------------------------------------------------- | |
135 | // wxMDIClientWindow | |
136 | //----------------------------------------------------------------------------- | |
137 | ||
d2824cdb | 138 | class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase |
c801d85f | 139 | { |
ab2b3dd4 | 140 | public: |
d2824cdb | 141 | wxMDIClientWindow() { } |
5a0a15cf | 142 | ~wxMDIClientWindow(); |
d2824cdb VZ |
143 | |
144 | virtual bool CreateClient(wxMDIParentFrame *parent, | |
145 | long style = wxVSCROLL | wxHSCROLL); | |
8487f887 RR |
146 | |
147 | private: | |
48200154 PC |
148 | virtual void AddChildGTK(wxWindowGTK* child); |
149 | ||
8487f887 | 150 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) |
c801d85f KB |
151 | }; |
152 | ||
0416c418 | 153 | #endif // _WX_GTK_MDI_H_ |