Added wxTreebook:

- added the control itself
- added protected wxBookCtrlBase::AllowNullPage() to accommodate it
- big changes to the sample to get rid of (most) ugly macros
- added XRC handler for the control
- added docs
- and wxUSE_TREEBOOK everywhere


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-10-09 18:40:36 +00:00
parent 97c58531bf
commit eca15c0d54
27 changed files with 2250 additions and 332 deletions

View File

@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
// Name: xh_treebk.h
// 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"
#if wxUSE_TREEBOOK
#include "wx/treebook.h"
WX_DEFINE_ARRAY_INT(size_t, wxArrayTbkPageIndexes);
// ---------------------------------------------------------------------
// 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
{
DECLARE_DYNAMIC_CLASS(wxTreebookXmlHandler)
public:
wxTreebookXmlHandler();
virtual wxObject *DoCreateResource();
virtual bool CanHandle(wxXmlNode *node);
private:
bool m_isInside;
wxTreebook * m_tbk;
wxArrayTbkPageIndexes m_treeContext;
};
// 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>
#endif
#endif // _WX_XH_TREEBK_H_