]> git.saurik.com Git - wxWidgets.git/blame - include/wx/xrc/xh_treebk.h
synchronize GTK2 minimum version in docs
[wxWidgets.git] / include / wx / xrc / xh_treebk.h
CommitLineData
eca15c0d 1/////////////////////////////////////////////////////////////////////////////
e8a793f0 2// Name: wx/xrc/xh_treebk.h
eca15c0d
VZ
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
dd47af27 15#if wxUSE_XRC && wxUSE_TREEBOOK
eca15c0d 16
8e2701ea 17class WXDLLIMPEXP_FWD_CORE wxTreebook;
07f93593 18#include "wx/dynarray.h"
eca15c0d 19
07f93593
VZ
20WX_DEFINE_USER_EXPORTED_ARRAY_SIZE_T(size_t, wxArrayTbkPageIndexes,
21 class WXDLLIMPEXP_XRC);
eca15c0d
VZ
22
23// ---------------------------------------------------------------------
24// wxTreebookXmlHandler class
25// ---------------------------------------------------------------------
26// Resource xml structure have to be almost the "same" as for wxNotebook
27// except the additional (size_t)depth parameter for treebookpage nodes
28// which indicates the depth of the page in the tree.
29// There is only one logical constraint on this parameter :
30// it cannot be greater than the previous page depth plus one
31class WXDLLIMPEXP_XRC wxTreebookXmlHandler : public wxXmlResourceHandler
32{
dd47af27
VZ
33 DECLARE_DYNAMIC_CLASS(wxTreebookXmlHandler)
34
eca15c0d
VZ
35public:
36 wxTreebookXmlHandler();
37 virtual wxObject *DoCreateResource();
38 virtual bool CanHandle(wxXmlNode *node);
39
40private:
07f93593 41 wxTreebook *m_tbk;
eca15c0d 42 wxArrayTbkPageIndexes m_treeContext;
07f93593 43 bool m_isInside;
eca15c0d
VZ
44};
45
46
47// Example:
48// -------
49// Label
50// \--First
51// | \--Second
52// \--Third
53//
54//<resource>
55// ...
56// <object class="wxTreebook">
57// <object class="treebookpage">
58// <object class="wxWindow" />
59// <label>My first page</label>
60// <depth>0</depth>
61// </object>
62// <object class="treebookpage">
63// <object class="wxWindow" />
64// <label>First</label>
65// <depth>1</depth>
66// </object>
67// <object class="treebookpage">
68// <object class="wxWindow" />
69// <label>Second</label>
70// <depth>2</depth>
71// </object>
72// <object class="treebookpage">
73// <object class="wxWindow" />
74// <label>Third</label>
75// <depth>1</depth>
76// </object>
77// </object>
78// ...
79//</resource>
80
dd47af27 81#endif // wxUSE_XRC && wxUSE_TREEBOOK
eca15c0d
VZ
82
83#endif // _WX_XH_TREEBK_H_