2005-10-09 14:40:36 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-04 14:08:09 -04:00
|
|
|
// Name: wx/xrc/xh_treebk.h
|
2005-10-09 14:40:36 -04:00
|
|
|
// Purpose: XML resource handler for wxTreebook
|
|
|
|
// Author: Evgeniy Tarassov
|
|
|
|
// Created: 2005/09/28
|
|
|
|
// Copyright: (c) 2005 TT-Solutions <vadim@tt-solutions.com>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_XH_TREEBK_H_
|
|
|
|
#define _WX_XH_TREEBK_H_
|
|
|
|
|
|
|
|
#include "wx/xrc/xmlres.h"
|
|
|
|
|
2006-10-03 10:53:40 -04:00
|
|
|
#if wxUSE_XRC && wxUSE_TREEBOOK
|
2005-10-09 14:40:36 -04:00
|
|
|
|
2007-08-11 07:46:29 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreebook;
|
2005-10-25 09:11:18 -04:00
|
|
|
#include "wx/dynarray.h"
|
2005-10-09 14:40:36 -04:00
|
|
|
|
2005-10-25 09:11:18 -04:00
|
|
|
WX_DEFINE_USER_EXPORTED_ARRAY_SIZE_T(size_t, wxArrayTbkPageIndexes,
|
|
|
|
class WXDLLIMPEXP_XRC);
|
2005-10-09 14:40:36 -04:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// wxTreebookXmlHandler class
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Resource xml structure have to be almost the "same" as for wxNotebook
|
|
|
|
// except the additional (size_t)depth parameter for treebookpage nodes
|
|
|
|
// which indicates the depth of the page in the tree.
|
|
|
|
// There is only one logical constraint on this parameter :
|
|
|
|
// it cannot be greater than the previous page depth plus one
|
|
|
|
class WXDLLIMPEXP_XRC wxTreebookXmlHandler : public wxXmlResourceHandler
|
|
|
|
{
|
2006-10-03 10:53:40 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxTreebookXmlHandler)
|
|
|
|
|
2005-10-09 14:40:36 -04:00
|
|
|
public:
|
|
|
|
wxTreebookXmlHandler();
|
|
|
|
virtual wxObject *DoCreateResource();
|
|
|
|
virtual bool CanHandle(wxXmlNode *node);
|
|
|
|
|
|
|
|
private:
|
2005-10-25 09:11:18 -04:00
|
|
|
wxTreebook *m_tbk;
|
2005-10-09 14:40:36 -04:00
|
|
|
wxArrayTbkPageIndexes m_treeContext;
|
2005-10-25 09:11:18 -04:00
|
|
|
bool m_isInside;
|
2005-10-09 14:40:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Example:
|
|
|
|
// -------
|
|
|
|
// Label
|
|
|
|
// \--First
|
|
|
|
// | \--Second
|
|
|
|
// \--Third
|
|
|
|
//
|
|
|
|
//<resource>
|
|
|
|
// ...
|
|
|
|
// <object class="wxTreebook">
|
|
|
|
// <object class="treebookpage">
|
|
|
|
// <object class="wxWindow" />
|
|
|
|
// <label>My first page</label>
|
|
|
|
// <depth>0</depth>
|
|
|
|
// </object>
|
|
|
|
// <object class="treebookpage">
|
|
|
|
// <object class="wxWindow" />
|
|
|
|
// <label>First</label>
|
|
|
|
// <depth>1</depth>
|
|
|
|
// </object>
|
|
|
|
// <object class="treebookpage">
|
|
|
|
// <object class="wxWindow" />
|
|
|
|
// <label>Second</label>
|
|
|
|
// <depth>2</depth>
|
|
|
|
// </object>
|
|
|
|
// <object class="treebookpage">
|
|
|
|
// <object class="wxWindow" />
|
|
|
|
// <label>Third</label>
|
|
|
|
// <depth>1</depth>
|
|
|
|
// </object>
|
|
|
|
// </object>
|
|
|
|
// ...
|
|
|
|
//</resource>
|
|
|
|
|
2006-10-03 10:53:40 -04:00
|
|
|
#endif // wxUSE_XRC && wxUSE_TREEBOOK
|
2005-10-09 14:40:36 -04:00
|
|
|
|
|
|
|
#endif // _WX_XH_TREEBK_H_
|