Opened 5 years ago

Closed 21 months ago

#10848 closed defect (fixed)

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

Reported by: JarkkoL Owned by:
Priority: normal Milestone:
Component: wxAui Version: stable-latest
Keywords: wxAuiNotebook; tab order; out of order Cc:
Blocked By: Blocking:
Patch: yes

Description

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.

Attachments (5)

auibook.patch download (506 bytes) - added by JarkkoL 5 years ago.
wxAuiNotebook.patch download (1.2 KB) - added by jens 5 years ago.
CycleControls.patch download (4.1 KB) - added by LukasK 3 years ago.
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
CycleControls.png download (16.1 KB) - added by LukasK 3 years ago.
auibook_dragndrop.patch download (1013 bytes) - added by MarcBarber 3 years ago.

Download all attachments as: .zip

Change History (13)

Changed 5 years ago by JarkkoL

Changed 5 years ago by jens

comment:1 Changed 5 years ago by jens

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.

comment:2 Changed 3 years ago by LukasK

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.

Changed 3 years ago by LukasK

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

Changed 3 years ago by LukasK

comment:3 Changed 3 years ago by vadz

  • Status changed from new to infoneeded_new

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!

comment:4 Changed 3 years ago by LukasK

  • Status changed from infoneeded_new to new

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.

Changed 3 years ago by MarcBarber

comment:5 Changed 3 years ago by MarcBarber

  • Keywords wxAuiNotebook tab order out of order added
  • Resolution set to fixed
  • Status changed from new to closed

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.

comment:6 Changed 3 years ago by vadz

  • Resolution fixed deleted
  • Status changed from closed to reopened

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...

comment:7 Changed 21 months ago by eran

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

comment:8 Changed 21 months ago by VZ

  • Resolution set to fixed
  • Status changed from reopened to closed

(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.

Note: See TracTickets for help on using tickets.