renamed AddSubPage() with pos parameter to InsertSubPage()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,10 +18,11 @@ of preference sections on the left and select section page on the right.
|
|||||||
|
|
||||||
To use the class simply create it and populate with pages using
|
To use the class simply create it and populate with pages using
|
||||||
\helpref{InsertPage}{wxtreebookinsertpage},
|
\helpref{InsertPage}{wxtreebookinsertpage},
|
||||||
|
\helpref{InsertSubPage}{wxtreebookinsertsubpage},
|
||||||
\helpref{AddPage}{wxtreebookaddpage},
|
\helpref{AddPage}{wxtreebookaddpage},
|
||||||
\helpref{AddSubPage}{wxtreebookaddsubpage}.
|
\helpref{AddSubPage}{wxtreebookaddsubpage}.
|
||||||
|
|
||||||
If your tree is no more than 1 level in depth then you could
|
If your tree is no more than $1$ level in depth then you could
|
||||||
simply use \helpref{AddPage}{wxtreebookaddpage} and
|
simply use \helpref{AddPage}{wxtreebookaddpage} and
|
||||||
\helpref{AddSubPage}{wxtreebookaddsubpage} to sequentially populate your tree
|
\helpref{AddSubPage}{wxtreebookaddsubpage} to sequentially populate your tree
|
||||||
by adding at every step a page or a subpage to the end of the tree.
|
by adding at every step a page or a subpage to the end of the tree.
|
||||||
@@ -104,7 +105,7 @@ Also deletes all the pages owned by the control (inserted previously into it).
|
|||||||
\param{int }{imageId = wxNOT\_FOUND}}
|
\param{int }{imageId = wxNOT\_FOUND}}
|
||||||
|
|
||||||
Adds a new page. The page is placed at the topmost level after all other pages.
|
Adds a new page. The page is placed at the topmost level after all other pages.
|
||||||
NULL could be specified for page to create an empty page.
|
\NULL could be specified for page to create an empty page.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -112,10 +113,8 @@ NULL could be specified for page to create an empty page.
|
|||||||
|
|
||||||
\func{bool}{AddSubPage}{\param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
|
\func{bool}{AddSubPage}{\param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
|
||||||
|
|
||||||
\func{bool}{AddSubPage}{\param{size\_t }{pagePos}, \param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
|
Adds a new child-page to the last top-level page.
|
||||||
|
\NULL could be specified for page to create an empty page.
|
||||||
Adds a new child-page to either the last or the specified top-level.
|
|
||||||
NULL could be specified for page to create an empty page.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -215,7 +214,16 @@ depending on the platform and so wxTreebookEvent::GetSelection should be used in
|
|||||||
|
|
||||||
Inserts a new page just before the page indicated by pagePos.
|
Inserts a new page just before the page indicated by pagePos.
|
||||||
The new page is placed before pagePos page and on the same level.
|
The new page is placed before pagePos page and on the same level.
|
||||||
NULL could be specified for page to create an empty page.
|
\NULL could be specified for page to create an empty page.
|
||||||
|
|
||||||
|
|
||||||
|
\membersection{wxTreebook::InsertSubPage}\label{wxtreebookinsertsubpage}
|
||||||
|
|
||||||
|
\func{bool}{InsertSubPage}{\param{size\_t }{pagePos}, \param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
|
||||||
|
|
||||||
|
Inserts a sub page under the specified page.
|
||||||
|
|
||||||
|
\NULL could be specified for page to create an empty page.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxTreebook::IsNodeExpanded}\label{wxtreebookisnodeexpanded}
|
\membersection{wxTreebook::IsNodeExpanded}\label{wxtreebookisnodeexpanded}
|
||||||
|
@@ -77,11 +77,11 @@ public:
|
|||||||
int imageId = wxNOT_FOUND);
|
int imageId = wxNOT_FOUND);
|
||||||
|
|
||||||
// Inserts a new sub-page to the end of children of the page at given pos.
|
// Inserts a new sub-page to the end of children of the page at given pos.
|
||||||
virtual bool AddSubPage(size_t pos,
|
virtual bool InsertSubPage(size_t pos,
|
||||||
wxWindow *page,
|
wxWindow *page,
|
||||||
const wxString& text,
|
const wxString& text,
|
||||||
bool bSelect = false,
|
bool bSelect = false,
|
||||||
int imageId = wxNOT_FOUND);
|
int imageId = wxNOT_FOUND);
|
||||||
|
|
||||||
// Adds a new page at top level after all other pages.
|
// Adds a new page at top level after all other pages.
|
||||||
virtual bool AddPage(wxWindow *page,
|
virtual bool AddPage(wxWindow *page,
|
||||||
|
@@ -436,7 +436,7 @@ void MyFrame::RecreateBook()
|
|||||||
if ( parent != wxNOT_FOUND )
|
if ( parent != wxNOT_FOUND )
|
||||||
{
|
{
|
||||||
wxStaticCast(m_bookCtrl, wxTreebook)->
|
wxStaticCast(m_bookCtrl, wxTreebook)->
|
||||||
AddSubPage(parent, page, str, false, image);
|
InsertSubPage(parent, page, str, false, image);
|
||||||
|
|
||||||
// skip adding it again below
|
// skip adding it again below
|
||||||
continue;
|
continue;
|
||||||
@@ -600,15 +600,18 @@ void MyFrame::OnAddSubPage(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static unsigned s_subPageAdded = 0;
|
static unsigned s_subPageAdded = 0;
|
||||||
currBook->AddSubPage(selPos,
|
currBook->InsertSubPage
|
||||||
CreateNewPage(),
|
(
|
||||||
wxString::Format
|
selPos,
|
||||||
(
|
CreateNewPage(),
|
||||||
ADDED_SUB_PAGE_NAME wxT("%u"),
|
wxString::Format
|
||||||
++s_subPageAdded
|
(
|
||||||
),
|
ADDED_SUB_PAGE_NAME wxT("%u"),
|
||||||
true,
|
++s_subPageAdded
|
||||||
GetIconIndex(currBook));
|
),
|
||||||
|
true,
|
||||||
|
GetIconIndex(currBook)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -125,11 +125,11 @@ bool wxTreebook::InsertPage(size_t pagePos,
|
|||||||
return DoInsertPage(pagePos, page, text, bSelect, imageId);
|
return DoInsertPage(pagePos, page, text, bSelect, imageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTreebook::AddSubPage(size_t pagePos,
|
bool wxTreebook::InsertSubPage(size_t pagePos,
|
||||||
wxWindow *page,
|
wxWindow *page,
|
||||||
const wxString& text,
|
const wxString& text,
|
||||||
bool bSelect,
|
bool bSelect,
|
||||||
int imageId)
|
int imageId)
|
||||||
{
|
{
|
||||||
return DoInsertSubPage(pagePos, page, text, bSelect, imageId);
|
return DoInsertSubPage(pagePos, page, text, bSelect, imageId);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user