]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk1/mdi.h | |
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 | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // (c) 2008 Vadim Zeitlin | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_GTK1_MDI_H_ | |
12 | #define _WX_GTK1_MDI_H_ | |
13 | ||
14 | #include "wx/frame.h" | |
15 | ||
16 | class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; | |
17 | class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; | |
18 | ||
19 | typedef struct _GtkNotebook GtkNotebook; | |
20 | ||
21 | //----------------------------------------------------------------------------- | |
22 | // wxMDIParentFrame | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
25 | class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase | |
26 | { | |
27 | public: | |
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 | ||
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); | |
49 | ||
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; | |
53 | ||
54 | // implement base class pure virtuals | |
55 | // ---------------------------------- | |
56 | ||
57 | virtual void ActivateNext(); | |
58 | virtual void ActivatePrevious(); | |
59 | ||
60 | static bool IsTDI() { return true; } | |
61 | ||
62 | // implementation | |
63 | ||
64 | bool m_justInserted; | |
65 | ||
66 | virtual void GtkOnSize( int x, int y, int width, int height ); | |
67 | virtual void OnInternalIdle(); | |
68 | ||
69 | private: | |
70 | void Init(); | |
71 | ||
72 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) | |
73 | }; | |
74 | ||
75 | //----------------------------------------------------------------------------- | |
76 | // wxMDIChildFrame | |
77 | //----------------------------------------------------------------------------- | |
78 | ||
79 | class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame | |
80 | { | |
81 | public: | |
82 | wxMDIChildFrame() { Init(); } | |
83 | wxMDIChildFrame(wxMDIParentFrame *parent, | |
84 | wxWindowID id, | |
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) | |
90 | { | |
91 | Init(); | |
92 | ||
93 | Create(parent, id, title, pos, size, style, name); | |
94 | } | |
95 | ||
96 | bool Create(wxMDIParentFrame *parent, | |
97 | wxWindowID id, | |
98 | const wxString& title, | |
99 | const wxPoint& pos = wxDefaultPosition, | |
100 | const wxSize& size = wxDefaultSize, | |
101 | long style = wxDEFAULT_FRAME_STYLE, | |
102 | const wxString& name = wxFrameNameStr); | |
103 | ||
104 | virtual ~wxMDIChildFrame(); | |
105 | ||
106 | virtual void SetMenuBar( wxMenuBar *menu_bar ); | |
107 | virtual wxMenuBar *GetMenuBar() const; | |
108 | ||
109 | virtual void Activate(); | |
110 | ||
111 | virtual void SetTitle(const wxString& title); | |
112 | ||
113 | // implementation | |
114 | ||
115 | void OnActivate( wxActivateEvent& event ); | |
116 | void OnMenuHighlight( wxMenuEvent& event ); | |
117 | ||
118 | wxMenuBar *m_menuBar; | |
119 | GtkNotebookPage *m_page; | |
120 | bool m_justInserted; | |
121 | ||
122 | private: | |
123 | void Init(); | |
124 | ||
125 | GtkNotebook *GTKGetNotebook() const; | |
126 | ||
127 | DECLARE_EVENT_TABLE() | |
128 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
129 | }; | |
130 | ||
131 | //----------------------------------------------------------------------------- | |
132 | // wxMDIClientWindow | |
133 | //----------------------------------------------------------------------------- | |
134 | ||
135 | class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase | |
136 | { | |
137 | public: | |
138 | wxMDIClientWindow() { } | |
139 | ||
140 | virtual bool CreateClient(wxMDIParentFrame *parent, | |
141 | long style = wxVSCROLL | wxHSCROLL); | |
142 | ||
143 | private: | |
144 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
145 | }; | |
146 | ||
147 | #endif // _WX_GTK1_MDI_H_ |