Hi,
I've found a bug in notebook page reordering. When you reorder a tab by dragging it it reorders it visually fine but it does not reorder it in the notebook's m_tabs member variable. This means that when I later read back the pages consecutively using GetPage() they are still in the old order. Not sure what the fix is yet but I'm looking at it.
Cheers,
James
Kirix Support Forums
Page reordering bug
7 posts
• Page 1 of 1
The fix was again very simple.
In wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt):
wxWindow* src_tab = dest_tabs->GetWindowFromIdx(src_idx);
m_tabs.MovePage(src_tab, dest_idx); <---- ADD THIS
dest_tabs->MovePage(src_tab, dest_idx);
dest_tabs->SetActivePage((size_t)dest_idx);
dest_tabs->DoShowHide();
dest_tabs->Refresh();
I will endeavour to get some patches together as I've got about 4 bug fixes to get into wx cvs now.
Cheers,
James
In wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt):
wxWindow* src_tab = dest_tabs->GetWindowFromIdx(src_idx);
m_tabs.MovePage(src_tab, dest_idx); <---- ADD THIS
dest_tabs->MovePage(src_tab, dest_idx);
dest_tabs->SetActivePage((size_t)dest_idx);
dest_tabs->DoShowHide();
dest_tabs->Refresh();
I will endeavour to get some patches together as I've got about 4 bug fixes to get into wx cvs now.
Cheers,
James
- jfrench
- Registered User
- Posts: 14
- Joined: Mon Dec 18, 2006 6:58 am
Hi there,
As far as wxAuiNotebook::m_tabs, it was my intention to leave the order of array alone, and have the change in page position be solely visual.
I'm certainly not opposed to adding a function which can retrieve a page pointer by visual offset.
All the best,
Ben
As far as wxAuiNotebook::m_tabs, it was my intention to leave the order of array alone, and have the change in page position be solely visual.
I'm certainly not opposed to adding a function which can retrieve a page pointer by visual offset.
All the best,
Ben
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Something is required so it is possible to persist the notebook pages in the correct order.
By the way, what is the reason for this design decision? I must say I'm not clear on why there are two tab containers either, but then again I haven't dug too deeply.
James
By the way, what is the reason for this design decision? I must say I'm not clear on why there are two tab containers either, but then again I haven't dug too deeply.
James
- jfrench
- Registered User
- Posts: 14
- Joined: Mon Dec 18, 2006 6:58 am
Hi James,
The reason is that, most of the time developers add their pages in a certain order to notebooks in a certain order. When the user is offered the possibility of arbitrarily reordering notebook tabs, this should not affect the actual order of the array of page pointers.
It's similar to a grid. When columns are reordered in a grid, this doesn't change the actual data representation of the table, merely the appearance on the screen.
The reason for the two tab containers is that the tab control allows split views. If you drag a tab to the bottom of the control in the sample, you will see this functionality. wxAuiNotebook was not developed to be just a generic tab control, but rather a way of presenting multiple documents on the screen at the same time, while maintaining the flexibility that a tab control offers.
Thanks much for your comments,
Ben
The reason is that, most of the time developers add their pages in a certain order to notebooks in a certain order. When the user is offered the possibility of arbitrarily reordering notebook tabs, this should not affect the actual order of the array of page pointers.
It's similar to a grid. When columns are reordered in a grid, this doesn't change the actual data representation of the table, merely the appearance on the screen.
The reason for the two tab containers is that the tab control allows split views. If you drag a tab to the bottom of the control in the sample, you will see this functionality. wxAuiNotebook was not developed to be just a generic tab control, but rather a way of presenting multiple documents on the screen at the same time, while maintaining the flexibility that a tab control offers.
Thanks much for your comments,
Ben
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Hi Ben
<I'm certainly not opposed to adding a function which can retrieve a page pointer by visual offset. >
That would be really helpful. On a related note, is it possible to query a tab as to where in the notebook it is docked (top, bottom, right, etc.)?
Many thanks,
Gerald
<I'm certainly not opposed to adding a function which can retrieve a page pointer by visual offset. >
That would be really helpful. On a related note, is it possible to query a tab as to where in the notebook it is docked (top, bottom, right, etc.)?
Many thanks,
Gerald
- gnschmidt
- Registered User
- Posts: 20
- Joined: Sat Sep 30, 2006 2:59 am
Hi Gerald,
No it isn't yet possible. I was trying to be as complete as possible when doing the API, but I guess I missed some stuff. I'll have to improve this when the next wx development cycle gets going.
Thanks,
Ben
No it isn't yet possible. I was trying to be as complete as possible when doing the API, but I guess I missed some stuff. I'll have to improve this when the next wx development cycle gets going.
Thanks,
Ben
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
7 posts
· Page 1 of 1
Return to wxAUI Questions, Thoughts & Feedback