Generic list and tree ctrl should not use the focused selection color when the top level window is not active.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1410,7 +1410,11 @@ bool wxListLineData::SetAttributes(wxDC *dc,
|
|||||||
if ( highlighted )
|
if ( highlighted )
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
{
|
{
|
||||||
if (m_owner->HasFocus())
|
if (m_owner->HasFocus()
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
&& IsControlActive( (ControlRef)m_owner->GetHandle() )
|
||||||
|
#endif
|
||||||
|
)
|
||||||
colText = *wxWHITE;
|
colText = *wxWHITE;
|
||||||
else
|
else
|
||||||
colText = *wxBLACK;
|
colText = *wxBLACK;
|
||||||
@@ -1470,7 +1474,11 @@ void wxListLineData::Draw( wxDC *dc )
|
|||||||
if (highlighted)
|
if (highlighted)
|
||||||
{
|
{
|
||||||
int flags = wxCONTROL_SELECTED;
|
int flags = wxCONTROL_SELECTED;
|
||||||
if (m_owner->HasFocus())
|
if (m_owner->HasFocus()
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
&& IsControlActive( (ControlRef)m_owner->GetHandle() )
|
||||||
|
#endif
|
||||||
|
)
|
||||||
flags |= wxCONTROL_FOCUSED;
|
flags |= wxCONTROL_FOCUSED;
|
||||||
wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, m_gi->m_rectHighlight, flags );
|
wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, m_gi->m_rectHighlight, flags );
|
||||||
|
|
||||||
@@ -1529,7 +1537,11 @@ void wxListLineData::DrawInReportMode( wxDC *dc,
|
|||||||
if (highlighted)
|
if (highlighted)
|
||||||
{
|
{
|
||||||
int flags = wxCONTROL_SELECTED;
|
int flags = wxCONTROL_SELECTED;
|
||||||
if (m_owner->HasFocus())
|
if (m_owner->HasFocus()
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
&& IsControlActive( (ControlRef)m_owner->GetHandle() )
|
||||||
|
#endif
|
||||||
|
)
|
||||||
flags |= wxCONTROL_FOCUSED;
|
flags |= wxCONTROL_FOCUSED;
|
||||||
wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, rectHL, flags );
|
wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, rectHL, flags );
|
||||||
}
|
}
|
||||||
|
@@ -2232,7 +2232,11 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int flags = wxCONTROL_SELECTED;
|
int flags = wxCONTROL_SELECTED;
|
||||||
if (m_hasFocus)
|
if (m_hasFocus
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
&& IsControlActive( (ControlRef)GetHandle() )
|
||||||
|
#endif
|
||||||
|
)
|
||||||
flags |= wxCONTROL_FOCUSED;
|
flags |= wxCONTROL_FOCUSED;
|
||||||
if ((item == m_current) && (m_hasFocus))
|
if ((item == m_current) && (m_hasFocus))
|
||||||
flags |= wxCONTROL_CURRENT;
|
flags |= wxCONTROL_CURRENT;
|
||||||
@@ -2374,7 +2378,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
|
|||||||
// rectangle, so we want to make sure that the text is visible
|
// rectangle, so we want to make sure that the text is visible
|
||||||
// against the normal background, not the highlightbackground, so
|
// against the normal background, not the highlightbackground, so
|
||||||
// don't use the highlight text colour unless we have the focus.
|
// don't use the highlight text colour unless we have the focus.
|
||||||
&& m_hasFocus
|
&& m_hasFocus && IsControlActive( (ControlRef)GetHandle() )
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
#include "wx/layout.h"
|
#include "wx/layout.h"
|
||||||
#include "wx/statusbr.h"
|
#include "wx/statusbr.h"
|
||||||
#include "wx/menuitem.h"
|
#include "wx/menuitem.h"
|
||||||
|
#include "wx/treectrl.h"
|
||||||
|
#include "wx/listctrl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/tooltip.h"
|
#include "wx/tooltip.h"
|
||||||
@@ -167,6 +169,9 @@ static const EventTypeSpec eventList[] =
|
|||||||
{ kEventClassControl , kEventControlVisibilityChanged } ,
|
{ kEventClassControl , kEventControlVisibilityChanged } ,
|
||||||
{ kEventClassControl , kEventControlEnabledStateChanged } ,
|
{ kEventClassControl , kEventControlEnabledStateChanged } ,
|
||||||
{ kEventClassControl , kEventControlHiliteChanged } ,
|
{ kEventClassControl , kEventControlHiliteChanged } ,
|
||||||
|
|
||||||
|
{ kEventClassControl , kEventControlActivate } ,
|
||||||
|
{ kEventClassControl , kEventControlDeactivate } ,
|
||||||
#endif
|
#endif
|
||||||
{ kEventClassControl , kEventControlSetFocusPart } ,
|
{ kEventClassControl , kEventControlSetFocusPart } ,
|
||||||
|
|
||||||
@@ -294,6 +299,16 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
|
|||||||
case kEventControlHiliteChanged :
|
case kEventControlHiliteChanged :
|
||||||
thisWindow->MacHiliteChanged() ;
|
thisWindow->MacHiliteChanged() ;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
|
case kEventControlActivate :
|
||||||
|
case kEventControlDeactivate :
|
||||||
|
if ( thisWindow->IsKindOf( CLASSINFO( wxTreeCtrl ) )
|
||||||
|
|| thisWindow->IsKindOf( CLASSINFO( wxListCtrl ) )
|
||||||
|
)
|
||||||
|
thisWindow->Refresh();
|
||||||
|
|
||||||
|
//thisWindow->MacActivateStateChanged() ;
|
||||||
|
break ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// we emulate this event under Carbon CFM
|
// we emulate this event under Carbon CFM
|
||||||
|
Reference in New Issue
Block a user