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

Define wxAuiTabContainer as event object to the wxAuiNotebookEvent objects #125

Closed Kinaou closed 9 years ago

Kinaou commented 9 years ago

Checked and modified the wxAuiNotebookEvent object's content sent by the frame manager to be consistent with the behavior of the 'old aui':

This patch should answer to the issue https://github.com/nhold/wxWidgets/issues/111

pkulchenko commented 9 years ago

@Kinaou, the changes look good and I only have one question: Why do you use GetIdxFromWindow for TAB_MIDDLE_DOWN, but FindTab for TAB_MIDDLE_UP?

AuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, GetManagedWindow()->GetId());
                    e.SetSelection(part->m_tab_container->GetIdxFromWindow(hitPane->GetWindow()));
...
        if (FindTab(part->pane->GetWindow(), &ctrl, &ctrlIndex))
            wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, GetManagedWindow()->GetId());

Does this mean that when I click on a tab area that doesn't match any tab (like a tab background), I get MIDDLE_DOWN, but not MIDDLE_UP event (as the second one is conditioned on the tab match and the first one is not)? If so, we may use the same check for all these events.

Kinaou commented 9 years ago

You are right, I have not thought about this case. The tab's related events are not relevant when the tabs bar's background is sought. I'll fix that.

Kinaou commented 9 years ago

@nhold, you merged 6a96e92 but not 59f4453, is it intentional? or is it that I missed something?

nhold commented 9 years ago

No I did, I just cleaned up the commit history a bit. You can see in the commit that the changes are there. I had to manually do it because github couldn't merge it. Sorry about any confusion.