wxAuiNotebook: on tab move page keeps old index
Posted: Wed Mar 03, 2010 1:51 pm
When I move a tab in AuiNotebook, I would like to change the labels of the tabs so that they show the actual tab position. Example:
AuiNotebook
------------
[Tab 1] [Tab 2] [Tab 3] [Tab 4]
When I move Tab 3 before Tab 1, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG is fired in which I have:
The problem is that GetPageText(0) doesn't return the tab at zero position, but the tab that had zero position when tabs were created first time. When I move a tab left or right, it keeps the old index position.
In order to find the right index I also tried the following but without success:
AuiBook->GetPageIndex( AuiBook->GetPage(i) )
Any help?
AuiNotebook
------------
[Tab 1] [Tab 2] [Tab 3] [Tab 4]
When I move Tab 3 before Tab 1, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG is fired in which I have:
Code: Select all
for (int i=0; i < AuiBook->GetPageCount(); i++ ) {
AuiBook->SetPageText(i, wxT("Tab ") + wxString::Format(wxT("%i"),i) );
}
In order to find the right index I also tried the following but without success:
AuiBook->GetPageIndex( AuiBook->GetPage(i) )
Any help?