X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/977a41ec3e85ae7736b7028ec04ebd1818058c8e..9b49405777342458dc1666001865eef7309b6c30:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index ca183a7905..e63d023e05 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -973,11 +973,7 @@ void wxGenericTreeCtrl::Init() m_lastOnSame = false; #if defined( __WXMAC__ ) -#if wxOSX_USE_ATSU_TEXT - m_normalFont.MacCreateFromThemeFont( kThemeViewsFont ) ; -#else - m_normalFont.MacCreateFromUIFont( kCTFontViewsFontType ) ; -#endif + m_normalFont.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS); #else m_normalFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); #endif @@ -1004,8 +1000,16 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent, if (major < 10) style |= wxTR_ROW_LINES; + + if (style & wxTR_HAS_BUTTONS) + style |= wxTR_NO_LINES; #endif // __WXMAC__ +#ifdef __WXGTK20__ + if (style & wxTR_HAS_BUTTONS) + style |= wxTR_NO_LINES; +#endif + if ( !wxControl::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, validator, @@ -1775,6 +1779,16 @@ void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId) } wxGenericTreeItem *parent = item->GetParent(); + + // if the selected item will be deleted, select the parent ... + wxGenericTreeItem *to_be_selected = parent; + if (parent) + { + // .. unless there is a next sibling like wxMSW does it + int pos = parent->GetChildren().Index( item ); + if ((int)(parent->GetChildren().GetCount()) > pos+1) + to_be_selected = parent->GetChildren().Item( pos+1 ); + } // don't keep stale pointers around! if ( IsDescendantOf(item, m_key_current) ) @@ -1791,7 +1805,7 @@ void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId) // a different item, in idle time. if ( m_select_me && IsDescendantOf(item, m_select_me) ) { - m_select_me = parent; + m_select_me = to_be_selected; } if ( IsDescendantOf(item, m_current) ) @@ -1802,7 +1816,7 @@ void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId) // m_current = parent; m_current = NULL; - m_select_me = parent; + m_select_me = to_be_selected; } // remove the item from the tree