Add wxAuiTabCtrl::DoShowTab() helper
No real changes, just add a function ensuring that the tab is shown. It's not really clear why the existing code sometimes calls MakeTabVisible() after SetActivePage() and sometimes doesn't, and perhaps it should actually always do it, in which case this function could be merged with SetActivePage() to do everything at once, but for now keep the changes minimal.
This commit is contained in:
parent
b66d0a640d
commit
3de2e479fc
2 changed files with 11 additions and 5 deletions
|
|
@ -210,6 +210,9 @@ public:
|
|||
|
||||
void SetRect(const wxRect& rect) { wxAuiTabContainer::SetRect(rect, this); }
|
||||
|
||||
// Internal helper.
|
||||
void DoShowTab(int idx);
|
||||
|
||||
protected:
|
||||
// choose the default border for this window
|
||||
virtual wxBorder GetDefaultBorder() const override { return wxBORDER_NONE; }
|
||||
|
|
|
|||
|
|
@ -1019,6 +1019,12 @@ wxAuiTabCtrl::~wxAuiTabCtrl()
|
|||
{
|
||||
}
|
||||
|
||||
void wxAuiTabCtrl::DoShowTab(int idx)
|
||||
{
|
||||
DoShowHide();
|
||||
MakeTabVisible(idx, this);
|
||||
}
|
||||
|
||||
void wxAuiTabCtrl::DoEndDragging()
|
||||
{
|
||||
m_clickPt = wxDefaultPosition;
|
||||
|
|
@ -2143,8 +2149,7 @@ bool wxAuiNotebook::RemovePage(size_t page_idx)
|
|||
|
||||
// but we still need to show the new active page in this
|
||||
// control, otherwise it wouldn't be updated
|
||||
ctrl->DoShowHide();
|
||||
ctrl->MakeTabVisible(ctrl_idx, ctrl);
|
||||
ctrl->DoShowTab(ctrl_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3659,9 +3664,7 @@ int wxAuiNotebook::DoModifySelection(size_t n, bool events)
|
|||
|
||||
ctrl->SetActivePage(ctrl_idx);
|
||||
DoSizing();
|
||||
ctrl->DoShowHide();
|
||||
|
||||
ctrl->MakeTabVisible(ctrl_idx, ctrl);
|
||||
ctrl->DoShowTab(ctrl_idx);
|
||||
|
||||
// set fonts
|
||||
wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue