Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxAuiNotebook: Incorrect tab indexing after tab move (via DnD) #10848

Closed
wxtrac opened this issue May 29, 2009 · 13 comments
Closed

wxAuiNotebook: Incorrect tab indexing after tab move (via DnD) #10848

wxtrac opened this issue May 29, 2009 · 13 comments
Labels

Comments

@wxtrac
Copy link
Collaborator

@wxtrac wxtrac commented May 29, 2009

Issue migrated from trac ticket # 10848

component: wxAui | priority: normal | resolution: fixed | keywords: wxAuiNotebook; tab order; out of order

2009-05-29 16:46:15: JarkkoL (Jarkko Lempiainen) created the issue


After moving tabs in wxAuiNotebook (via drag-n-drop) and subsequently calling e.g. notebook->GetPageText(i); the index passed to GetPageText() doesn't match the order of tabs as they appear in the notebook. The attached patch should fix this.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented May 29, 2009

2009-05-29 16:46:47: JarkkoL (Jarkko Lempiainen) uploaded file auibook.patch (0.5 KiB)

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 24, 2009

2009-06-24 23:49:00: jens (Jens Lody) uploaded file wxAuiNotebook.patch (1.2 KiB)

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Jun 25, 2009

2009-06-25 00:04:52: jens (Jens Lody) commented


The behaviour described by Jarkkol can be very annoying, but his patch fixes the the problem only partly and it does not work, if the notebook is splitted.

Navigating through the notebook using e.g. Strg+Tab does not reliably work, especially not, if the user splits the notebook .
My patch makes the navigation keys behave as expected.
We only walk through the active container, we use the correct order and if we reached the end we start at the beginning and vice versa.

The wrapping might be a matter of taste, but that's what I expect if I walk through tabs with the navigation keys.

My patch does not change the behaviour of GetPagetText (and most likely other functions, because I do not need them), but the problem is similar, and the patch can probably be used as base for other fixes needed if the user changes the tab-order, so I decided to post it here.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 23, 2011

2011-03-23 17:23:53: LukasK (Lukas K) commented


This is a problem for my app, I notice the issue has been stale for 21 months.
The tab navigation order is still incorrect in trunk for the wxAuiNotebook.

I applied the changes from jens patch. They still work in fixing the tab order, but (as mentioned) instead prevent navigation to a new set of tabs when the notebook is split, and I guess the added wrap around should be optional.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 25, 2011

2011-03-25 21:29:15: LukasK (Lukas K) uploaded file CycleControls.patch (4.1 KiB)

Patch which makes Ctrl+Tab and Ctrl+Shift+Tab cycles through the tabs in one tab control in the visual control order order, and switching to the next tab control after the last or first tab

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Mar 25, 2011

2011-03-25 21:33:20: LukasK (Lukas K) uploaded file CycleControls.png (16.1 KiB)

CycleControls.png

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented May 14, 2011

2011-05-14 15:32:58: @vadz changed status from new to infoneeded_new

2011-05-14 15:32:58: @vadz commented

I'm very confused here. First of all, I think there are 2 completely different issues in this ticket and I think a separate one should be opened for the problem described by jens and LukasK. All I can say about this one is that Tab navigation doesn't seem to work well for me in the aui sample right now so if these patches fix it (do they?) it would be worthwhile to apply them. In any case, please let's discuss this in a separate ticket and please describe what the problem is exactly right now (i.e. how can it be reproduced) and what exactly is fixed by the patch(es?).

As for the original problem reported by JarkkoL, it seems to be about a different bug which results in the internal pages order not corresponding to their order on the display. But I don't know how can this be reproduced (as the original report didn't say) and the patch seems suspicious to me: first, why does it touch m_tabs instead of either source or destination tabs, is it because they're both equal to this anyhow in this case? Second, the logic in wxAuiTabContainer::MovePage() looks correct to me. Could you please explain what is the patch doing? TIA!

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented May 15, 2011

2011-05-15 17:37:34: LukasK (Lukas K) changed status from infoneeded_new to new

2011-05-15 17:37:34: LukasK (Lukas K) commented

The problems are different so a new ticket is probably a good idea, the cause might be the same (the title "wxAuiNotebook: Incorrect tab indexing after tab move (via DnD)" sounds a lot like my problem, only I experience it when tabbing, not retrieving text)

I created ticket #13217 for the incorrect ordering when navigating with keyboard. I added the patch there as well.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Oct 5, 2011

2011-10-05 00:30:24: MarcBarber (Marc Barber) uploaded file auibook_dragndrop.patch (1.0 KiB)

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Oct 5, 2011

2011-10-05 00:33:22: MarcBarber (Marc Barber) changed status from new to closed

2011-10-05 00:33:22: MarcBarber (Marc Barber) set resolution to fixed

2011-10-05 00:33:22: MarcBarber (Marc Barber) commented

This patch fixes the ordering of tabs when dragging and dropping from one wxAuiNotebook to another (whether separate or split). Like the original auibook.patch (which this includes), this has to do with keeping the tab list and window list in sync.

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Oct 6, 2011

2011-10-06 14:53:31: @vadz changed status from closed to reopened

2011-10-06 14:53:31: @vadz changed resolution from fixed to **

2011-10-06 14:53:31: @vadz commented

Probably wasn't meant to be closed.

Can someone please test the latest patch? I still don't understand what it does and don't have any way to reproduce the problem...

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Dec 14, 2012

2012-12-14 17:01:53: @eranif commented


Hi,

I have just applied the latest patch ("auibook_dragndrop.patch") on my local build of wx294 and tested it on codelite (which also suffers from the same problem: tab order is lost when using DnD to move tabs around)

The patch fixes this problem

Hope you can apply to trunk

Thanks,
Eran

@wxtrac
Copy link
Collaborator Author

@wxtrac wxtrac commented Dec 23, 2012

2012-12-23 12:33:51: @vadz changed status from reopened to closed

2012-12-23 12:33:51: @vadz changed resolution from ** to fixed

2012-12-23 12:33:51: @vadz commented

(In [73263]) Fix wrong tab order in wxAuiNotebook after dragging.

Update the tab index correctly to keep tabs list and windows list in sync.

Closes #10848.

@wxtrac wxtrac closed this Dec 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant