]>
Commit | Line | Data |
---|---|---|
eca15c0d VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: xh_treebk.h | |
3 | // Purpose: XML resource handler for wxTreebook | |
4 | // Author: Evgeniy Tarassov | |
5 | // Created: 2005/09/28 | |
6 | // Copyright: (c) 2005 TT-Solutions <vadim@tt-solutions.com> | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_XH_TREEBK_H_ | |
11 | #define _WX_XH_TREEBK_H_ | |
12 | ||
13 | #include "wx/xrc/xmlres.h" | |
14 | ||
15 | #if wxUSE_TREEBOOK | |
16 | ||
17 | #include "wx/treebook.h" | |
18 | ||
b719fd8d | 19 | WX_DEFINE_ARRAY_SIZE_T(size_t, wxArrayTbkPageIndexes); |
eca15c0d VZ |
20 | |
21 | // --------------------------------------------------------------------- | |
22 | // wxTreebookXmlHandler class | |
23 | // --------------------------------------------------------------------- | |
24 | // Resource xml structure have to be almost the "same" as for wxNotebook | |
25 | // except the additional (size_t)depth parameter for treebookpage nodes | |
26 | // which indicates the depth of the page in the tree. | |
27 | // There is only one logical constraint on this parameter : | |
28 | // it cannot be greater than the previous page depth plus one | |
29 | class WXDLLIMPEXP_XRC wxTreebookXmlHandler : public wxXmlResourceHandler | |
30 | { | |
31 | DECLARE_DYNAMIC_CLASS(wxTreebookXmlHandler) | |
32 | public: | |
33 | wxTreebookXmlHandler(); | |
34 | virtual wxObject *DoCreateResource(); | |
35 | virtual bool CanHandle(wxXmlNode *node); | |
36 | ||
37 | private: | |
38 | bool m_isInside; | |
39 | wxTreebook * m_tbk; | |
40 | wxArrayTbkPageIndexes m_treeContext; | |
41 | }; | |
42 | ||
43 | ||
44 | // Example: | |
45 | // ------- | |
46 | // Label | |
47 | // \--First | |
48 | // | \--Second | |
49 | // \--Third | |
50 | // | |
51 | //<resource> | |
52 | // ... | |
53 | // <object class="wxTreebook"> | |
54 | // <object class="treebookpage"> | |
55 | // <object class="wxWindow" /> | |
56 | // <label>My first page</label> | |
57 | // <depth>0</depth> | |
58 | // </object> | |
59 | // <object class="treebookpage"> | |
60 | // <object class="wxWindow" /> | |
61 | // <label>First</label> | |
62 | // <depth>1</depth> | |
63 | // </object> | |
64 | // <object class="treebookpage"> | |
65 | // <object class="wxWindow" /> | |
66 | // <label>Second</label> | |
67 | // <depth>2</depth> | |
68 | // </object> | |
69 | // <object class="treebookpage"> | |
70 | // <object class="wxWindow" /> | |
71 | // <label>Third</label> | |
72 | // <depth>1</depth> | |
73 | // </object> | |
74 | // </object> | |
75 | // ... | |
76 | //</resource> | |
77 | ||
78 | #endif | |
79 | ||
80 | #endif // _WX_XH_TREEBK_H_ | |
81 |