X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b854a32613f34669af815e1416a6c623a4c2c5b..51072df23ffcf5bdd4651dbe0ad5143b1e360119:/src/generic/tabg.cpp diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp index 7da066a106..bd0ba3d2eb 100644 --- a/src/generic/tabg.cpp +++ b/src/generic/tabg.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_TAB_DIALOG + #ifndef WX_PRECOMP #include "wx/wx.h" #endif @@ -623,7 +625,7 @@ bool wxTabView::RemoveTab(int id) m_noTabs --; // The layout has changed - Layout(); + LayoutTabs(); return TRUE; } tabNode = tabNode->Next(); @@ -699,11 +701,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 +878,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 +1027,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); @@ -1275,3 +1281,4 @@ void wxPanelTabView::ShowWindowForTab(int id) newWindow->Refresh(); } +#endif // wxUSE_TAB_DIALOG