X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/48ac3cf8e054db7db5a6d8342427a6d56756b524..d40e9e06bbccc5bc4a73e4138d1f11c50cec7aa9:/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp diff --git a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp index a483db947a..6cded83c61 100644 --- a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp @@ -3021,24 +3021,34 @@ void wxTreeListMainWindow::PaintItem (wxTreeListItem *item, wxDC& dc) { #endif // !__WXMAC__ dc.SetTextForeground (colTextHilight); }else if (item->IsSelected()) { +#if defined(__WXGTK2__) || defined(__WXMAC__) + int flags = wxCONTROL_SELECTED; + if (m_hasFocus) + { + flags |= wxCONTROL_FOCUSED; +#ifdef __WXMAC__ + dc.SetTextForeground( *wxWHITE ); +#endif + } + wxRendererNative::GetDefault().DrawItemSelectionRect( m_owner, dc, wxRect( 0, item->GetY() + off_h, total_w, total_h - off_h ), flags); +#else if (!m_isDragging && m_hasFocus) { dc.SetBrush (*m_hilightBrush); -#ifndef __WXMAC__ // don't draw rect outline if we already have the background color dc.SetPen (*wxBLACK_PEN); -#endif // !__WXMAC__ }else{ dc.SetBrush (*m_hilightUnfocusedBrush); -#ifndef __WXMAC__ // don't draw rect outline if we already have the background color dc.SetPen (*wxTRANSPARENT_PEN); -#endif // !__WXMAC__ } dc.SetTextForeground (colTextHilight); +#endif // defined(__WXGTK2__) || defined(__WXMAC__) }else if (item == m_curItem) { dc.SetPen (m_hasFocus? *wxBLACK_PEN: *wxTRANSPARENT_PEN); }else{ dc.SetTextForeground (colText); } +#if !defined(__WXGTK2__) && !defined(__WXMAC__) dc.DrawRectangle (0, item->GetY() + off_h, total_w, total_h - off_h); +#endif }else{ dc.SetTextForeground (colText); } @@ -3099,24 +3109,34 @@ void wxTreeListMainWindow::PaintItem (wxTreeListItem *item, wxDC& dc) { #endif // !__WXMAC__ dc.SetTextForeground (colTextHilight); }else if (item->IsSelected()) { +#if defined(__WXGTK2__) || defined(__WXMAC__) + int flags = wxCONTROL_SELECTED; + if (m_hasFocus) + { + flags |= wxCONTROL_FOCUSED; +#ifdef __WXMAC__ + dc.SetTextForeground( *wxWHITE ); +#endif + } + wxRendererNative::GetDefault().DrawItemSelectionRect( m_owner, dc, wxRect( 0, item->GetY() + off_h, total_w, total_h - off_h ), flags); +#else if (!m_isDragging && m_hasFocus) { dc.SetBrush (*m_hilightBrush); -#ifndef __WXMAC__ // don't draw rect outline if we already have the background color dc.SetPen (*wxBLACK_PEN); -#endif // !__WXMAC__ }else{ dc.SetBrush (*m_hilightUnfocusedBrush); -#ifndef __WXMAC__ // don't draw rect outline if we already have the background color - dc.SetPen (*wxTRANSPARENT_PEN); -#endif // !__WXMAC__ + dc.SetPen (*wxTRANSPARENT_PEN); } dc.SetTextForeground (colTextHilight); +#endif // defined(__WXGTK2__) || defined(__WXMAC__) }else if (item == m_curItem) { dc.SetPen (m_hasFocus? *wxBLACK_PEN: *wxTRANSPARENT_PEN); }else{ dc.SetTextForeground (colText); } +#if !defined(__WXGTK2__) && !defined(__WXMAC__) dc.DrawRectangle (text_x, item->GetY() + off_h, text_w, total_h - off_h); +#endif }else{ dc.SetTextForeground (colText); }