Kirix Support Forums

wxAuiNotebook closing

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxAuiNotebook closing

Postby miclus on Wed May 05, 2010 6:19 pm

Hi. I changed the code in OnLeftDown() so that if a close button is clicked, it won't switch to the tab just before closing it. Here is the code:

Code: Select all

        if ((new_selection != GetActivePage() ||
            GetParent()->IsKindOf(CLASSINFO(wxAuiNotebook))) && !m_hover_button)
        {
            wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId);
            e.SetSelection(new_selection);
            e.SetOldSelection(GetActivePage());
            e.SetEventObject(this);
            GetEventHandler()->ProcessEvent(e);
        }



Only thing different is the !m_hover_button. But, I found a strange glitch that results from this. If I drag the tab to close to very left position (index 0), then close it, there become strange little dead spaces on the remaining tabs whereby clicking them has no effect.

So, does anyone have a better solution to this problem?
miclus
Registered User
 
Posts: 10
Joined: Sat Jul 18, 2009 8:56 pm

Re: wxAuiNotebook closing

Postby miclus on Sat May 08, 2010 5:34 pm

Ok, I found I can do the same thing in SetSelection. But, there is still the strange behavior with the dead space. Does anyone have another solution? Basically, I want it so that if you click the X button on a tab, it doesn't switch to that tab first.
miclus
Registered User
 
Posts: 10
Joined: Sat Jul 18, 2009 8:56 pm

Re: wxAuiNotebook closing

Postby Ben on Tue May 18, 2010 3:19 am

We wanted that, too, when we implemented it, but it was causing problems shortly before release, so we didn't put it in. I'm grateful for your insights.

Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Questions, Thoughts & Feedback