corrected background selection for mac and added appearance savvy disclosure triangles

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-03-11 22:05:58 +00:00
parent 45a9c81318
commit 7263a166db

View File

@@ -38,6 +38,10 @@
#include "wx/settings.h"
#include "wx/dcclient.h"
#ifdef __WXMAC__
#include "wx/mac/private.h"
#endif
// -----------------------------------------------------------------------------
// array types
// -----------------------------------------------------------------------------
@@ -2121,7 +2125,20 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
if ( item->IsSelected() )
{
// under mac selections are only a rectangle in case they don't have the focus
#ifdef __WXMAC__
if ( !m_hasFocus )
{
dc.SetBrush( *wxTRANSPARENT_BRUSH ) ;
dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) , 1 , wxSOLID ) ) ;
}
else
{
dc.SetBrush( *m_hilightBrush ) ;
}
#else
dc.SetBrush(*(m_hasFocus ? m_hilightBrush : m_hilightUnfocusedBrush));
#endif
}
else
{
@@ -2302,10 +2319,25 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
if (HasFlag(wxTR_AQUA_BUTTONS))
{
#ifdef __WXMAC__
wxMacPortSetter helper(&dc) ;
wxMacWindowClipper clipper(this) ;
wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
int loc_x = x - 5 ;
int loc_y = y_mid - 6 ;
MacWindowToRootWindow( & loc_x , & loc_y ) ;
Rect bounds = { loc_y , loc_x , loc_y + 18 , loc_x + 12 } ;
ThemeButtonDrawInfo info = { kThemeStateActive , item->IsExpanded() ? kThemeDisclosureDown : kThemeDisclosureRight ,
kThemeAdornmentNone };
DrawThemeButton( &bounds, kThemeDisclosureButton ,
&info , NULL , NULL , NULL , NULL ) ;
#else
if (item->IsExpanded())
dc.DrawBitmap( *m_arrowDown, x-5, y_mid-6, TRUE );
else
dc.DrawBitmap( *m_arrowRight, x-5, y_mid-6, TRUE );
#endif
}
else
{