wxAUI Improvements

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

wxAUI Improvements

Post by NinjaNL »

I don't know how many follow the Dev mailing list, but someone there has been releasing a "fixed" version of the wxAUI library.

Currently (s)he has done the following

Visual Studio 2005 style docking
http://www.kirix.com/forums/viewtopic.php?f=16&t=596
Dock and Pane Resizing
http://www.kirix.com/forums/viewtopic.php?f=16&t=582
Patch concerning dock resizing
http://www.kirix.com/forums/viewtopic.php?f=16&t=610
Patch to effect wxAuiToolBar orientation switch
http://www.kirix.com/forums/viewtopic.php?f=16&t=641
AUI: Core dump when loading a perspective in wxGTK (MSW OK)
http://www.kirix.com/forums/viewtopic.php?f=15&t=627
wxAuiNotebook reordered AdvanceSelection()
http://www.kirix.com/forums/viewtopic.php?f=16&t=617
Vertical Toolbar Docking Issue
http://www.kirix.com/forums/viewtopic.php?f=16&t=181
Patch to show the resize hint on mouse-down in aui
http://trac.wxwidgets.org/ticket/9612

and a second release that included

The Lef / Right and Top / Bottom Docks over draw each other
http://trac.wxwidgets.org/ticket/3516
MinSize() not honoured
http://trac.wxwidgets.org/ticket/3562
Layout problem with wxAUI
http://trac.wxwidgets.org/ticket/3597
resizing children ignores current window size
http://trac.wxwidgets.org/ticket/3908
Resizing panes under Vista does not repaint background
http://trac.wxwidgets.org/ticket/4325
Resize sash resizes in response to click
http://trac.wxwidgets.org/ticket/4547
"illegal" resizing of the AuiPane? (wxPython)
http://trac.wxwidgets.org/ticket/4599
floating wxAUIPane Resize Event doesn't update its position
http://trac.wxwidgets.org/ticket/9773

Download (source and binary for MSW included):
http://www.mediafire.com/file/lmgzjnmmmtz/AUITest2.zip

Obviously I don't want to belittle the work done by the developers of wxAUI, which is itself an excellent docking system, but these patches/fixes do improve it immensely.

The above download contains a windows build of the auitest program allowing developers to appraise the changes.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
madnut.ua
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Dec 08, 2006 10:49 pm
Location: Ukraine
Contact:

Post by madnut.ua »

I've made some corrections and fixes for wx 2.8.9/mingw/gcc 4.3 to make compiler happy :)
But I have one issue - I can't drag wxAuiToolbar when it is added without ToolbarPane() in AuiInfo. Can someone help me?

Thanx
Attachments
wx289_aui_all_patched.7z
Updated sources to compile against wx 2.8.9/mingw/4.x
(96.97 KiB) Downloaded 462 times
jjn
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Sep 30, 2008 11:31 am

Post by jjn »

NinjaNL wrote:I don't know how many follow the Dev mailing list, but someone there has been releasing a "fixed" version of the wxAUI library.
Thanks for announcing my work.
madnut.ua wrote:I've made some corrections and fixes for wx 2.8.9/mingw/gcc 4.3 to make compiler happy :)
Could you tell me why you removed some includes? Unfortunately It makes my compiler unhappy.
At least the following files are essential on wxWidgets 2.9.0 and Visual Studio 2008.

auibook.cpp: "wx/renderer.h"
dockinfo.cpp: "wx/msw/dc.h"
auibar.cpp: "wx/dcbuffer.h" (not in precomp!)
madnut.ua wrote:But I have one issue - I can't drag wxAuiToolbar when it is added without ToolbarPane() in AuiInfo. Can someone help me?
Sorry, I do not understand what you mean.
madnut.ua
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Dec 08, 2006 10:49 pm
Location: Ukraine
Contact:

Post by madnut.ua »

jjn,

Thanks for correcting my updates.

As for issue, try to add the following example into your code and then begin drag added pane using gripper:

Code: Select all

m_pToolBar = new wxAuiToolBar(this, CTRL_TOOLBAR_ID, wxDefaultPosition, wxDefaultSize);

--cut--

m_AuiManager.AddPane(m_pToolBar,  wxAuiPaneInfo().Name(_("Test")).CaptionVisible(false).Top().Position(1).Row(1).CloseButton(false).Gripper(true));
It doesn't work for me - pane is unmovable. Could you help with this?
madnut.ua
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Dec 08, 2006 10:49 pm
Location: Ukraine
Contact:

Post by madnut.ua »

Please, find my ugly fix for that issue with dragging wxAuiToolbar as ordinary frame not toolbar. Pls, let me know your thoughts and suggestions for better implementation)
Attachments
wx289_aui_all_patched.7z
(96.99 KiB) Downloaded 317 times
jjn
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Sep 30, 2008 11:31 am

Post by jjn »

madnut.ua wrote:

Code: Select all

m_pToolBar = new wxAuiToolBar(this, CTRL_TOOLBAR_ID, wxDefaultPosition, wxDefaultSize);

--cut--

m_AuiManager.AddPane(m_pToolBar,  wxAuiPaneInfo().Name(_("Test")).CaptionVisible(false).Top().Position(1).Row(1).CloseButton(false).Gripper(true));
Hmm. Even on the official 2.8.9, this code seems not to work.
Do you have any reasons why you don't use ToolbarPane?
madnut.ua wrote:Please, find my ugly fix for that issue with dragging wxAuiToolbar as ordinary frame not toolbar. Pls, let me know your thoughts and suggestions for better implementation)
It surely works. (not very smart, though :))
By the way, could you use diff for small patches, please?
madnut.ua
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Dec 08, 2006 10:49 pm
Location: Ukraine
Contact:

Post by madnut.ua »

Do you have any reasons why you don't use ToolbarPane?
Without ToolbarPane I can move my toolbar everywhere, not only in fixed placements specified for toolbar.
I use one main toolbar with ToolbarPane for standard buttons and one additional toolbar without ToolbarPane for some specified functionality (e.g. displaying file path or navigation buttons). Ommiting ToolbarPane gives me more ways in GUI layout customization :)
It surely works. (not very smart, though )
By the way, could you use diff for small patches, please?
Sure, no problem.
That were a quickfixes, and I hadn't planned to make any changes in code, but I had)

Anyway, thanks for your work on this mod!
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

madnut.ua wrote:But I have one issue - I can't drag wxAuiToolbar when it is added without ToolbarPane() in AuiInfo. Can someone help me?
I think this is by design. Toolbar panes have their own region outside of the managed frames/panels area.

If you need to have a floating/dragging toolbar, then you have to allow aui to address it as a toolbar.

What you are attempting to do is add a toolbar as any other control. This isn't allowed, try adding a toolbar to a dialog, same result (more or less).
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
madnut.ua
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Dec 08, 2006 10:49 pm
Location: Ukraine
Contact:

Post by madnut.ua »

NinjaNL wrote:
madnut.ua wrote:But I have one issue - I can't drag wxAuiToolbar when it is added without ToolbarPane() in AuiInfo. Can someone help me?
I think this is by design. Toolbar panes have their own region outside of the managed frames/panels area.

If you need to have a floating/dragging toolbar, then you have to allow aui to address it as a toolbar.

What you are attempting to do is add a toolbar as any other control. This isn't allowed, try adding a toolbar to a dialog, same result (more or less).
It works well for wxToolbar and wx 2.8.8
As for wx 2.8.9 and wxAuiToolbar is works buggy.
I understand that it perhaps undocumented feature/bug, but it very useful for me :)
nikkov
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Oct 03, 2008 1:44 am

Post by nikkov »

I used this patches on my programm with tabbed MDI frame.
I find this problems:

1. Create wxAuiMDIParentFrame crashed programm, because in wxAuiNotebook::Create(...) --> wxControl::Create --> wxControl::Create --> wxControlContainer::AcceptsFocus(), but member wxControl::m_winParent not initialized yet. Needed move code "m_container.SetContainerWindow(this);" from wxAuiNotebook::InitNotebook to wxAuiNotebook constructors.

2. Deleting wxAuiMDIParentFrame crashed programm, because twice try delete wxAuiDockingGuide objects, in ~wxAuiMDIClientWindow() --> DestroyChildren and ~wxAuiManager() --> DestroyGuideWindows(). I replaced DestroyChildren in
~wxAuiMDIClientWindow() to code:

Code: Select all

wxAuiMDIClientWindow::~wxAuiMDIClientWindow()
{
    // DestroyChildren();
	// Because wxAuiDockingGuide object freeing in wxAuiManager destructor they skipped
	wxWindowList::compatibility_iterator node, prev_node;
	prev_node = GetChildren().GetLast();

	for ( ;; )
	{
		node = prev_node;
		if ( !node )
			break;

		prev_node = node->GetPrevious();

		wxWindow *child = node->GetData();
		if(child->IsKindOf(CLASSINFO(wxAuiDockingGuide)))
			continue;

		delete child;

		wxASSERT_MSG( !GetChildren().Find(child),
			wxT("child didn't remove itself using RemoveChild()") );
	}
}
3. If set wxAUI_TB_OVERFLOW for wxAuiToolbar with checked item, then dropdown item list produced assert dialog.
I added next checkup to wxAuiDefaultToolBarArt::ShowDropDown

Code: Select all

    for (i = 0; i < count; ++i)
    {
        wxAuiToolBarItem& item = items.Item(i);

        if (item.GetKind() != wxITEM_SEPARATOR)
        {
            wxString text = item.GetShortHelp();
            if (text.empty())
                text = item.GetLabel();

            if (text.empty())
                text = wxT(" ");

            wxMenuItem* m =  new wxMenuItem(&menuPopup, item.GetId(), text, item.GetShortHelp(), item.GetKind());

            m->SetBitmap(item.GetBitmap());
            menuPopup.Append(m);
            items_added++;
        }
        else if (item.GetKind() == wxITEM_SEPARATOR)
        {
            if (items_added > 0)
                menuPopup.AppendSeparator();
        }
    }
Last edited by nikkov on Fri Oct 03, 2008 4:54 am, edited 1 time in total.
jjn
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Sep 30, 2008 11:31 am

Post by jjn »

nikkov wrote:I used this patches on my programm with tabbed MDI frame.
I find this problems:

1. Create wxAuiMDIParentFrame crashed programm, because in wxAuiNotebook::Create(...) --> wxControl::Create --> wxControl::Create --> wxControlContainer::AcceptsFocus(), but member wxControl::m_winParent not initialized yet. Needed move code "m_container.SetContainerWindow(this);" from wxAuiNotebook::InitNotebook to wxAuiNotebook constructors.

2. Deleting wxAuiMDIParentFrame crashed programm, because twice try delete wxAuiDockingGuide objects, in ~wxAuiMDIClientWindow() --> DestroyChildren and ~wxAuiManager() --> DestroyGuideWindows(). I replaced DestroyChildren in
~wxAuiMDIClientWindow() to code:
Thanks for reporting. I'll fix it in the next release.
About the second problem, I think that the managers of other than the main frame should not have guide/hint windows.
jjn
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Sep 30, 2008 11:31 am

Post by jjn »

nikkov wrote:2. Deleting wxAuiMDIParentFrame crashed programm, because twice try delete wxAuiDockingGuide objects, in ~wxAuiMDIClientWindow() --> DestroyChildren and ~wxAuiManager() --> DestroyGuideWindows(). I replaced DestroyChildren in
~wxAuiMDIClientWindow() to code:
I noticed that DestroyChildren() is not necessary at all.
It was an old bug of wxAUI. When I integrated the patch of VS2005 docking, I have brought it back by mistake. So simply remove it!
nikkov wrote:3. If set wxAUI_TB_OVERFLOW for wxAuiToolbar with checked item, then dropdown item list produced assert dialog.
I added next checkup to wxAuiDefaultToolBarArt::ShowDropDown
I applied it.
jjn
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Sep 30, 2008 11:31 am

Post by jjn »

This is the third test release.

I integrated someone's work that allows notebook docking. When you drag a floating window on another pane, you'll see a new guide icon in the center. You can get a tabbed pane by dropping the window there.

Also, many problems are fixed, including these:

Don't hide floating panels when we maximize some other panel
http://trac.wxwidgets.org/ticket/4066
wxAUINotebook incorrect ALLOW_ACTIVE_PANE handling
http://trac.wxwidgets.org/ticket/4361
page changing veto doesn't work, (patch supplied)
http://trac.wxwidgets.org/ticket/4518
Show and DoShow are mixed around in wxAuiMDIChildFrame
http://trac.wxwidgets.org/ticket/4567
wxAuiManager & wxToolBar - ToolBar Of Size Zero
http://trac.wxwidgets.org/ticket/9724
AiuNotebook doesn't behave properly like a container as far as...
http://trac.wxwidgets.org/ticket/9911
Attachments
AUITest3.zip
wxAUI Improvements Test Release 3
(148.49 KiB) Downloaded 470 times
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

jjn wrote:This is the third test release.
What no executable? damn I'll have to build it myself. :)
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
jjn
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Sep 30, 2008 11:31 am

Post by jjn »

Because this forum restricts the file size to 500KB...

Anyway I uploaded the exe here.
http://www.mediafire.com/file/g4zuj4nj3 ... st3exe.zip
Post Reply