X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b854a32613f34669af815e1416a6c623a4c2c5b..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/generic/tabg.cpp diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp index 7da066a106..24fb5c5f1c 100644 --- a/src/generic/tabg.cpp +++ b/src/generic/tabg.cpp @@ -623,7 +623,7 @@ bool wxTabView::RemoveTab(int id) m_noTabs --; // The layout has changed - Layout(); + LayoutTabs(); return TRUE; } tabNode = tabNode->Next(); @@ -699,11 +699,12 @@ void wxTabView::ClearTabs(bool deleteTabs) layerNode = nextLayerNode; } m_noTabs = 0; + m_tabSelection = -1; } // Layout tabs (optional, e.g. if resizing window) -void wxTabView::Layout(void) +void wxTabView::LayoutTabs(void) { // Make a list of the tab controls, deleting the wxTabLayers. wxList controls; @@ -875,8 +876,8 @@ bool wxTabView::OnEvent(wxMouseEvent& event) if (!event.LeftDown()) return FALSE; - long x, y; - event.Position(&x, &y); + wxCoord x, y; + event.GetPosition(&x, &y); wxTabControl *hitControl = (wxTabControl *) NULL; @@ -1024,6 +1025,9 @@ void wxTabView::SetBackgroundColour(const wxColour& col) void wxTabView::SetTabSelection(int sel, bool activateTool) { + if ( sel==m_tabSelection ) + return; + int oldSel = m_tabSelection; wxTabControl *control = FindTabControlForId(sel); wxTabControl *oldControl = FindTabControlForId(m_tabSelection);