nhold / wxWidgets

Read-only mirror of the wxWidgets SVN repo (automatically updated). Report issues here: http://trac.wxwidgets.org/
http://www.wxwidgets.org/
1 stars 3 forks source link

No hint is shown when splitting wxAuiNotebook tabs #117

Open pkulchenko opened 9 years ago

pkulchenko commented 9 years ago

Thia can be seen in Auidemo sample (Windows, commit a7976ec):

  1. Open wxAuiNotebook by going to View | Create wxAuiNotebook.
  2. Try to drag any of the tabs to split. The tab is split as expected, but there is no indication of the blue target area during dragging.

The correct behavior can be seen in the demo for other (non-notebook) tabs, so this appears to be wxAuiNotebook-specific issue.

tomkulaga commented 9 years ago

This might be a non dynamic notebook, as the old aui notebook didn't show the hint when splitting notebooks?

pkulchenko commented 9 years ago

@tomkulaga, no, the current implementation of the notebook shows the position hint when splitting or repositioning tabs. It also shows the hint over the tab backgrounds when merging tabs, which the dynamic branch doesn't do.

Kinaou commented 9 years ago

It seems to be caused by the notebook's manager for which the hint flags are not defined in the wxAuiNotebook::Init method. This patch allows to see the hint but it breaks the hint positioning in the dynamic behavior. It needs more meditation...

@@ -91,6 +91,7 @@
     m_mgr.SetManagedWindow(this);
     m_mgr.SetDockSizeConstraint(1.0, 1.0); // no dock size constraint
     SetWindowStyleFlag(style);
+    m_mgr.SetFlag(wxAUI_MGR_TRANSPARENT_HINT | wxAUI_MGR_HINT_FADE | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE, true);

 }
tomkulaga commented 9 years ago

I've got this code running below and it DOES show hints when splitting notebooks. It hints if I split the notebook and want to dock it into itself or elsewhere.

http://codepad.org/3bOhBSbk

I haven't looked deeply into the code, I'm experimenting with AUI for a project and this has been my scratchpad.

On the AuiDemo I don't see the hints, but for my code I do.

mjmacleod commented 9 years ago

Above patch from @Kinaou works for me - though it seems 'SetWindowStyleFlag' is actually stripping these flags, so I wonder if its not something that should rather be fixed within 'SetWindowStyleFlag' - also we should maybe double check that 'SetWindowStyleFlag' doesn't strip anything else that should be set for notebooks.

Thoughts?

pkulchenko commented 9 years ago

@mjmacleod, @Kinaou, the patch from @Kinaou works for me as well, as the hint is now shown, but it's shown not as I'd expect it to be (although the patch didn't purport to fix those aspects, they were just not visible previously):

  1. When you split Welcome to wxAUI tab and try to join it back, the hint is only over that new container and not over the container it was separated from.
  2. At no point the hint is over the tab row (as it is in the current version), so there is no (visual) indication that the tabs will be all joined back (although they do this).
  3. The focus switches to the background window when the tab is dragged around, which is a bit unexpected as the tabs can't be dropped there, but I guess it may be by design.

I can open a ticket for the first two issues.

Kinaou commented 7 years ago

In wxAuiNotebook::SetWindowStyleFlag(), le mask used by m_mgr.SetFlags() is too restrictive. '0x3FFFFFF' seems to be the correct value to filter all the values of the enum wxAuiManagerOption.

Furthermore, in the 'auidemo', the actions of the 'auimanager' of a pure 'auinotebook' seem to affect the main 'auimanager'. Yet, all the actions done on in a pure 'auinotebook' should be confined in it. Removing a tab from a pure 'auinotebook' to be put in a 'new aui' (logical 'auinotebook') environment is not possible (should it be?). It would be necessary either to confine the events propagation inside the pure 'auinotebook' or ensure in the management of the 'auimanager' that the actions made by the pure 'auinotebook' have no impact outside of it (especially the flag 'activepane' which is defined on several tabs outside the notebook and generate warnings).