ChartTrellisNode::ChartTrellisNode(const ChartTrellisNode &root,
                                   const ChartTrellisNode &substitutedNode,
                                   const ChartHypothesis &replacementHypo,
                                   ChartTrellisNode *&deviationPoint)
    : m_hypo((&root == &substitutedNode)
             ? replacementHypo
             : root.GetHypothesis())
{
  if (&root == &substitutedNode) {
    deviationPoint = this;
    CreateChildren();
  } else {
    CreateChildren(root, substitutedNode, replacementHypo, deviationPoint);
  }
}
ChartTrellisNode::ChartTrellisNode(const ChartTrellisDetour &detour,
                                   ChartTrellisNode *&deviationPoint)
    : m_hypo((&detour.GetBasePath().GetFinalNode() == &detour.GetSubstitutedNode())
             ? detour.GetReplacementHypo()
             : detour.GetBasePath().GetFinalNode().GetHypothesis())
{
  if (&m_hypo == &detour.GetReplacementHypo()) {
    deviationPoint = this;
    CreateChildren();
  } else {
    CreateChildren(detour.GetBasePath().GetFinalNode(),
                   detour.GetSubstitutedNode(), detour.GetReplacementHypo(),
                   deviationPoint);
  }
}
BOOL COXNetBrowseTree::ExpandNode(HTREEITEM hTreeItem) 
// --- In  : hTreeItem : Node to expand (NULL is top level)
// --- Out : 
// --- Returns :
// --- Effect : Expands the specified node
{
	// If hTreeItem == NULL we have to have an empty tree
	ASSERT((hTreeItem != NULL) || (GetRootItem() == NULL));

	// Get the net resource of the parent item
	NETRESOURCE* pNetResources = NULL;
	if (hTreeItem != NULL)
	{
		pNetResources = GetAssocNetResourceEx(hTreeItem);
		ASSERT(pNetResources != NULL);
	}
	else
		pNetResources = NULL;

	if ((pNetResources != NULL) && ((pNetResources->dwUsage & RESOURCEUSAGE_CONTAINER) != RESOURCEUSAGE_CONTAINER))
		// Net resource exists, but is not a container and thus cannot be enumerated
		return FALSE;

	// Expand the node (may take a while)
	CWaitCursor wc;
	return CreateChildren(hTreeItem, pNetResources);
}
Ejemplo n.º 4
0
wxObject* wxRibbonXmlHandler::Handle_bar()
{
    XRC_MAKE_INSTANCE (ribbonBar, wxRibbonBar);

    Handle_RibbonArtProvider (ribbonBar);

    if ( !ribbonBar->Create(wxDynamicCast(m_parent, wxWindow),
                            GetID(),
                            GetPosition(),
                            GetSize(),
                            GetStyle("style", wxRIBBON_BAR_DEFAULT_STYLE)) )
    {
        ReportError ("could not create ribbonbar");
    }
    else
    {
        // Currently the art provider style must be explicitly set to the
        // ribbon style too.
        ribbonBar->GetArtProvider()
            ->SetFlags(GetStyle("style", wxRIBBON_BAR_DEFAULT_STYLE));

        const wxClassInfo* const wasInside = m_isInside;
        wxON_BLOCK_EXIT_SET(m_isInside, wasInside);
        m_isInside = &wxRibbonBar::ms_classInfo;

        CreateChildren (ribbonBar, true);

        ribbonBar->Realize();
    }

    return ribbonBar;
}
Ejemplo n.º 5
0
wxObject * MaxMdiXmlHandler::DoCreateResource()
{
    wxWindow *frame = CreateFrame();

    if (HasParam(wxT("size")))
        frame->SetClientSize(GetSize());
    if (HasParam(wxT("pos")))
        frame->Move(GetPosition());
    if (HasParam(wxT("icon")))
    {
        wxFrame* f = wxDynamicCast(frame, wxFrame);
        if (f)
            f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
    }

    SetupWindow(frame);

    CreateChildren(frame);

    if (GetBool(wxT("centered"), false))
        frame->Centre();

    return frame;

}
Ejemplo n.º 6
0
wxObject *wxMDIParentFrameXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(frame, wxMDIParentFrame);

    frame->Create(m_parentAsWindow,
                  GetID(),
                  GetText(wxT("title")),
                  wxDefaultPosition, wxDefaultSize,
                  GetStyle(wxT("style"), wxDEFAULT_FRAME_STYLE),
                  GetName());

    if (HasParam(wxT("size")))
        frame->SetClientSize(GetSize());
    if (HasParam(wxT("pos")))
        frame->Move(GetPosition());

    SetupWindow(frame);

    CreateChildren(frame);

    if (GetBool(wxT("centered"), FALSE))
        frame->Centre();

    return frame;
}
Ejemplo n.º 7
0
wxObject *wxSplitterWindowXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(frame, wxSplitterWindow);

    frame->Create(m_parentAsWindow,
                  GetID(),
                  wxDefaultPosition, wxDefaultSize,
                  GetStyle(wxT("style"), wxSP_3D),
                  GetName());

    SetupWindow(frame);

    CreateChildren(frame);
	
	if (frame->GetChildren().GetCount() != 2)
	{
		wxLogError(wxT("Error in resource: Splitter window needs exactly two children."));
		return NULL;
	}
	
	frame->SetSplitMode(GetLong (wxT("splitmode"), wxSPLIT_VERTICAL));
	long sashpos = GetLong (wxT("sashposition"), 100);
	
	wxWindowList::compatibility_iterator node = frame->GetChildren().GetFirst();
	wxWindow* wnd1 = node->GetData();
	wxWindow* wnd2 = node->GetNext()->GetData();

	if (frame->GetSplitMode() == wxSPLIT_VERTICAL)
		frame->SplitVertically (wnd1, wnd2, sashpos);
	else
		frame->SplitHorizontally (wnd1, wnd2, sashpos);
	
    return frame;
}
Ejemplo n.º 8
0
wxObject *wxMDIChildFrameXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(frame, wxMDIChildFrame);
	
	wxMDIParentFrame* prt = wxDynamicCast (m_parentAsWindow, wxMDIParentFrame);

	if (prt == NULL)
	{
		wxLogError(wxT("Error in resource: wxMDIChildFrame has no wxMDIParentFrame."));
		return NULL;
	}

    frame->Create(prt,
                  GetID(),
                  GetText(wxT("title")),
                  wxDefaultPosition, wxDefaultSize,
                  GetStyle(wxT("style"), wxDEFAULT_FRAME_STYLE),
                  GetName());

    SetupWindow(frame);

    CreateChildren(frame);

    if (GetBool(wxT("centered"), FALSE))
        frame->Centre();

    return frame;
}
Ejemplo n.º 9
0
wxObject * MaxDialogXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(dlg, MaxDialog);

    dlg->Create(m_parentAsWindow,
                GetID(),
                GetText(wxT("title")),
                wxDefaultPosition, wxDefaultSize,
                GetStyle(wxT("style"), wxDEFAULT_DIALOG_STYLE),
                GetName());

	dlg->MaxBind(_wx_wxdialog_wxDialog__xrcNew(dlg));

    if (HasParam(wxT("size")))
        dlg->SetClientSize(GetSize(wxT("size"), dlg));
    if (HasParam(wxT("pos")))
        dlg->Move(GetPosition());
    if (HasParam(wxT("icon")))
        dlg->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));

    SetupWindow(dlg);

    CreateChildren(dlg);

    if (GetBool(wxT("centered"), false))
        dlg->Centre();

    return dlg;
}
Ejemplo n.º 10
0
wxObject *wxSimplebookXmlHandler::DoCreateResource()
{
    if (m_class == wxS("simplebookpage"))
    {
        wxXmlNode *n = GetParamNode(wxS("object"));

        if ( !n )
            n = GetParamNode(wxS("object_ref"));

        if (n)
        {
            bool old_ins = m_isInside;
            m_isInside = false;
            wxObject *item = CreateResFromNode(n, m_simplebook, NULL);
            m_isInside = old_ins;
            wxWindow *wnd = wxDynamicCast(item, wxWindow);

            if (wnd)
            {
                m_simplebook->AddPage(wnd, GetText(wxS("label")),
                                      GetBool(wxS("selected")));
            }
            else
            {
                ReportError(n, "simplebookpage child must be a window");
            }
            return wnd;
        }
        else
        {
            ReportError("simplebookpage must have a window child");
            return NULL;
        }
    }

    else
    {
        XRC_MAKE_INSTANCE(sb, wxSimplebook)

        sb->Create(m_parentAsWindow,
                   GetID(),
                   GetPosition(), GetSize(),
                   GetStyle(wxS("style")),
                   GetName());

        SetupWindow(sb);

        wxSimplebook *old_par = m_simplebook;
        m_simplebook = sb;
        bool old_ins = m_isInside;
        m_isInside = true;
        CreateChildren(m_simplebook, true/*only this handler*/);
        m_isInside = old_ins;
        m_simplebook = old_par;

        return sb;
    }
}
Ejemplo n.º 11
0
wxObject *wxCollapsiblePaneXmlHandler::DoCreateResource()
{
    if (m_class == wxT("panewindow"))   // read the XRC for the pane window
    {
        wxXmlNode *n = GetParamNode(wxT("object"));

        if ( !n )
            n = GetParamNode(wxT("object_ref"));

        if (n)
        {
            bool old_ins = m_isInside;
            m_isInside = false;
            wxObject *item = CreateResFromNode(n, m_collpane->GetPane(), NULL);
            m_isInside = old_ins;

            return item;
        }
        else
        {
            ReportError("no control within panewindow");
            return NULL;
        }
    }
    else
    {
        XRC_MAKE_INSTANCE(ctrl, wxCollapsiblePane)

        wxString label = GetText(wxT("label"));
        if (label.empty())
        {
            ReportParamError("label", "label cannot be empty");
            return NULL;
        }

        ctrl->Create(m_parentAsWindow,
                    GetID(),
                    label,
                    GetPosition(), GetSize(),
                    GetStyle(wxT("style"), wxCP_DEFAULT_STYLE),
                    wxDefaultValidator,
                    GetName());

        ctrl->Collapse(GetBool(wxT("collapsed")));
        SetupWindow(ctrl);

        wxCollapsiblePane *old_par = m_collpane;
        m_collpane = ctrl;
        bool old_ins = m_isInside;
        m_isInside = true;
        CreateChildren(m_collpane, true/*only this handler*/);
        m_isInside = old_ins;
        m_collpane = old_par;

        return ctrl;
    }
}
Ejemplo n.º 12
0
void CDialog::InitChildren()
{
	if (!m_bChildrenInited)
	{
		m_bChildrenInited = true;

		CreateChildren();
	}
}
Ejemplo n.º 13
0
BOOL RichEditObj::InitFromXml(pugi::xml_node xmlNode)
{
    if (xmlNode)
    {
        SObject::InitFromXml(xmlNode);
        CreateChildren(xmlNode);
    }

    return TRUE;
}
Ejemplo n.º 14
0
HWND CStatusControl::Create(HWND hParent) {
  CWindowImpl<CStatusControl>::Create(hParent, 0, 0, WS_VISIBLE | WS_CHILD );

  CreateChildren();

  PopulateCombo();
  PopulateSpeed();

  LayoutChildrenInitial();

  return m_hWnd;
}
Ejemplo n.º 15
0
wxObject *wxMenuBarXmlHandler::DoCreateResource()
{
    wxMenuBar *menubar = new wxMenuBar(GetStyle());
    CreateChildren(menubar);

    if (m_parentAsWindow)
    {
        wxFrame *parentFrame = wxDynamicCast(m_parent, wxFrame);
        if (parentFrame)
            parentFrame->SetMenuBar(menubar);
    }

    return menubar;
}
Ejemplo n.º 16
0
wxObject *wxPanelXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(panel, wxPanel)

    panel->Create(m_parentAsWindow,
                  GetID(),
                  GetPosition(), GetSize(),
                  GetStyle(wxT("style"), wxTAB_TRAVERSAL),
                  GetName());

    SetupWindow(panel);
    CreateChildren(panel);

    return panel;
}
Ejemplo n.º 17
0
wxObject *wxScrolledWindowXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(control, wxScrolledWindow)

    control->Create(m_parentAsWindow,
                    GetID(),
                    GetPosition(), GetSize(),
                    GetStyle(wxT("style"), wxHSCROLL | wxVSCROLL),
                    GetName());

    SetupWindow(control);
    CreateChildren(control);

    return control;
}
Ejemplo n.º 18
0
wxObject *wxStdDialogButtonSizerXmlHandler::DoCreateResource()
{
    if (m_class == wxT("wxStdDialogButtonSizer"))
    {
        wxASSERT( !m_parentSizer );

        wxSizer *s = m_parentSizer = new wxStdDialogButtonSizer;
        m_isInside = true;

        CreateChildren(m_parent, true/*only this handler*/);

        m_parentSizer->Realize();

        m_isInside = false;
        m_parentSizer = NULL;

        return s;
    }
    else // m_class == "button"
    {
        wxASSERT( m_parentSizer );

        // find the item to be managed by this sizeritem
        wxXmlNode *n = GetParamNode(wxT("object"));
        if ( !n )
            n = GetParamNode(wxT("object_ref"));

        // did we find one?
        if (n)
        {
            wxObject *item = CreateResFromNode(n, m_parent, NULL);
            wxButton *button = wxDynamicCast(item, wxButton);

            if (button)
                m_parentSizer->AddButton(button);
            else
                ReportError(n, "expected wxButton");

            return item;
        }
        else /*n == NULL*/
        {
            ReportError("no button within wxStdDialogButtonSizer");
            return NULL;
        }
    }
}
Ejemplo n.º 19
0
wxObject* MyWxSimplebookXmlHandler::DoCreateResource()
{
    if(m_class == wxT("simplebookpage")) {
        wxXmlNode* n = GetParamNode(wxT("object"));

        if(!n) n = GetParamNode(wxT("object_ref"));

        if(n) {
            bool old_ins = m_isInside;
            m_isInside = false;
            wxObject* item = CreateResFromNode(n, m_notebook, NULL);
            m_isInside = old_ins;
            wxWindow* wnd = wxDynamicCast(item, wxWindow);

            if(wnd) {
                m_notebook->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")), wxNOT_FOUND);

            } else
                wxLogError(wxT("Error in resource."));

            return wnd;
        } else {
            wxLogError(wxT("Error in resource: no control within notebook's <page> tag."));
            return NULL;
        }
    }

    else {
        wxSimplebook* nb =
            new wxSimplebook(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")));
        wxString showEffect = GetText("effect", false);
        nb->SetEffect(wxCrafter::ShowEffectFromString(showEffect));
        nb->SetName(GetName());
        SetupWindow(nb);

        wxSimplebook* old_par = m_notebook;
        m_notebook = nb;
        bool old_ins = m_isInside;
        m_isInside = true;
        CreateChildren(m_notebook, true /*only this handler*/);
        m_isInside = old_ins;
        m_notebook = old_par;
        return nb;
    }
}
Ejemplo n.º 20
0
wxObject * MaxMenuBarXmlHandler::DoCreateResource()
{
    MaxMenuBar *menubar = new MaxMenuBar(GetStyle());


	menubar->MaxBind(CB_PREF(wx_wxmenubar_wxMenuBar__xrcNew)(menubar));

    CreateChildren(menubar);

    if (m_parentAsWindow)
    {
        wxFrame *parentFrame = wxDynamicCast(m_parent, wxFrame);
        if (parentFrame)
            parentFrame->SetMenuBar(menubar);
    }

    return menubar;

}
Ejemplo n.º 21
0
wxObject* wxRibbonXmlHandler::Handle_panel()
{
    XRC_MAKE_INSTANCE (ribbonPanel, wxRibbonPanel);

    if (!ribbonPanel->Create (wxDynamicCast(m_parent, wxWindow), GetID(),
            GetText ("label"), GetBitmap ("icon"), GetPosition(), GetSize(),
            GetStyle("style", wxRIBBON_PANEL_DEFAULT_STYLE)))
    {
        ReportError("could not create ribbon panel");
    }
    else
    {
        CreateChildren (ribbonPanel);

        ribbonPanel->Realize();
    }

    return ribbonPanel;
}
Ejemplo n.º 22
0
CoverTree<MetricType, StatisticType, MatType, RootPointPolicy>::CoverTree(
    const MatType& dataset,
    const ElemType base,
    const size_t pointIndex,
    const int scale,
    CoverTree* parent,
    const ElemType parentDistance,
    arma::Col<size_t>& indices,
    arma::vec& distances,
    size_t nearSetSize,
    size_t& farSetSize,
    size_t& usedSetSize,
    MetricType& metric) :
    dataset(&dataset),
    point(pointIndex),
    scale(scale),
    base(base),
    numDescendants(0),
    parent(parent),
    parentDistance(parentDistance),
    furthestDescendantDistance(0),
    localMetric(false),
    localDataset(false),
    metric(&metric),
    distanceComps(0)
{
  // If the size of the near set is 0, this is a leaf.
  if (nearSetSize == 0)
  {
    this->scale = INT_MIN;
    numDescendants = 1;
    stat = StatisticType(*this);
    return;
  }

  // Otherwise, create the children.
  CreateChildren(indices, distances, nearSetSize, farSetSize, usedSetSize);

  // Initialize statistic.
  stat = StatisticType(*this);
}
Ejemplo n.º 23
0
wxObject *wxScrollBarXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(control, wxScrollBar)

    control->Create(m_parentAsWindow,
                    GetID(),
                    GetPosition(), GetSize(),
                    GetStyle(),
                    wxDefaultValidator,
                    GetName());

    control->SetScrollbar(GetLong( wxT("value"), 0),
                          GetLong( wxT("thumbsize"),1),
                          GetLong( wxT("range"), 10),
                          GetLong( wxT("pagesize"),1));

    SetupWindow(control);
    CreateChildren(control);

    return control;
}
Ejemplo n.º 24
0
wxObject *wxScrolledWindowXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(control, wxScrolledWindow)

    control->Create(m_parentAsWindow,
                    GetID(),
                    GetPosition(), GetSize(),
                    GetStyle(wxT("style"), wxHSCROLL | wxVSCROLL),
                    GetName());

    SetupWindow(control);
    CreateChildren(control);

    if ( HasParam(wxT("scrollrate")) )
    {
        wxSize rate = GetSize(wxT("scrollrate"));
        control->SetScrollRate(rate.x, rate.y);
    }

    return control;
}
Ejemplo n.º 25
0
wxObject* wxRibbonXmlHandler::Handle_gallery()
{
    XRC_MAKE_INSTANCE (ribbonGallery, wxRibbonGallery);

    if (!ribbonGallery->Create (wxDynamicCast(m_parent, wxWindow), GetID(),
            GetPosition(), GetSize(), GetStyle()))
    {
        ReportError("could not create ribbon gallery");
    }
    else
    {
        const wxClassInfo* const wasInside = m_isInside;
        wxON_BLOCK_EXIT_SET(m_isInside, wasInside);
        m_isInside = &wxRibbonGallery::ms_classInfo;

        CreateChildren (ribbonGallery);

        ribbonGallery->Realize();
    }

    return ribbonGallery;
}
Ejemplo n.º 26
0
wxObject *wxWizardXmlHandler::DoCreateResource()
{
    if (m_class == wxT("wxWizard"))
    {
        XRC_MAKE_INSTANCE(wiz, wxWizard)

        long style = GetStyle(wxT("exstyle"), 0);
        if (style != 0)
            wiz->SetExtraStyle(style);
        wiz->Create(m_parentAsWindow,
                    GetID(),
                    GetText(wxT("title")),
                    GetBitmap(),
                    GetPosition());

        wxWizard *old = m_wizard;
        m_wizard = wiz;
        m_lastSimplePage = NULL;
        CreateChildren(wiz, true /*this handler only*/);
        m_wizard = old;
        return wiz;
    }
Ejemplo n.º 27
0
wxObject* wxRibbonXmlHandler::Handle_buttonbar()
{
    XRC_MAKE_INSTANCE (buttonBar, wxRibbonButtonBar);

    if (!buttonBar->Create (wxDynamicCast(m_parent, wxWindow), GetID(),
            GetPosition(), GetSize(), GetStyle()))
    {
        ReportError("could not create ribbon panel");
    }
    else
    {
        const wxClassInfo* const wasInside = m_isInside;
        wxON_BLOCK_EXIT_SET(m_isInside, wasInside);
        m_isInside = &wxRibbonButtonBar::ms_classInfo;

        CreateChildren (buttonBar, true);

        buttonBar->Realize();
    }

    return buttonBar;
}
Ejemplo n.º 28
0
wxObject* wxRibbonXmlHandler::Handle_page()
{
    XRC_MAKE_INSTANCE (ribbonPage, wxRibbonPage);

    if (!ribbonPage->Create (wxDynamicCast(m_parent, wxRibbonBar), GetID(),
            GetText ("label"), GetBitmap ("icon"), GetStyle()))
    {
        ReportError("could not create ribbon page");
    }
    else
    {
        const wxClassInfo* const wasInside = m_isInside;
        wxON_BLOCK_EXIT_SET(m_isInside, wasInside);
        m_isInside = &wxRibbonPage::ms_classInfo;

        CreateChildren (ribbonPage);

        ribbonPage->Realize();
    }

    return ribbonPage;
}
Ejemplo n.º 29
0
wxObject *wxMenuBarXmlHandler::DoCreateResource()
{
    wxMenuBar *menubar = NULL;

    const int style = GetStyle();
    wxASSERT_MSG(!style || !m_instance,
                 "cannot use <style> with pre-created menubar");

    if ( m_instance )
        menubar = wxDynamicCast(m_instance, wxMenuBar);
    if ( !menubar )
        menubar = new wxMenuBar(style);

    CreateChildren(menubar);

    if (m_parentAsWindow)
    {
        wxFrame *parentFrame = wxDynamicCast(m_parent, wxFrame);
        if (parentFrame)
            parentFrame->SetMenuBar(menubar);
    }

    return menubar;
}
Ejemplo n.º 30
0
wxObject* MYwxTreebookXmlHandler::DoCreateResource()
{
    if(m_class == wxT("wxTreebook")) {
        XRC_MAKE_INSTANCE(tbk, wxTreebook)

        tbk->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), GetName());

        wxTreebook* old_par = m_tbk;
        m_tbk = tbk;

        bool old_ins = m_isInside;
        m_isInside = true;

        wxArrayTbkPageIndexes old_treeContext = m_treeContext;
        m_treeContext.Clear();

        CreateChildren(m_tbk, true /*only this handler*/);

        wxXmlNode* node = GetParamNode(wxT("object"));
        int pageIndex = 0;
        for(unsigned int i = 0; i < m_tbk->GetPageCount(); i++) {
            if(m_tbk->GetPage(i)) {
                wxXmlNode* child = node->GetChildren();
                while(child) {
                    if(child->GetName() == wxT("expanded") && child->GetNodeContent() == wxT("1"))
                        m_tbk->ExpandNode(pageIndex, true);

                    child = child->GetNext();
                }
                pageIndex++;
            }
        }

        m_treeContext = old_treeContext;
        m_isInside = old_ins;
        m_tbk = old_par;

        return tbk;
    }

    //    else ( m_class == wxT("treebookpage") )
    wxXmlNode* n = GetParamNode(wxT("object"));
    wxWindow* wnd = NULL;

    if(!n) n = GetParamNode(wxT("object_ref"));

    if(n) {
        bool old_ins = m_isInside;
        m_isInside = false;
        wxObject* item = CreateResFromNode(n, m_tbk, NULL);
        m_isInside = old_ins;
        wnd = wxDynamicCast(item, wxWindow);
    }

    size_t depth = GetLong(wxT("depth"));

    if(depth <= m_treeContext.GetCount()) {
        // first prepare the icon
        int imgIndex = wxNOT_FOUND;
        if(HasParam(wxT("bitmap"))) {
            wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);
            wxImageList* imgList = m_tbk->GetImageList();
            if(imgList == NULL) {
                imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight());
                m_tbk->AssignImageList(imgList);
            }
            imgIndex = imgList->Add(bmp);
        } else if(HasParam(wxT("image"))) {
            if(m_tbk->GetImageList()) {
                imgIndex = GetLong(wxT("image"));
            } else // image without image list?
            {
            }
        }

        // then add the page to the corresponding parent
        if(depth < m_treeContext.GetCount()) m_treeContext.RemoveAt(depth, m_treeContext.GetCount() - depth);
        if(depth == 0) {
            m_tbk->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);
        } else {
            m_tbk->InsertSubPage(m_treeContext.Item(depth - 1), wnd, GetText(wxT("label")), GetBool(wxT("selected")),
                                 imgIndex);
        }

        m_treeContext.Add(m_tbk->GetPageCount() - 1);

    } else {
        // ReportParamError("depth", "invalid depth");
    }

    return wnd;
}