cleanup in preparation for patch 1376506

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2005-12-09 16:18:01 +00:00
parent 04f109ec63
commit dac390e90b

View File

@@ -2553,25 +2553,38 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
// panel wants to track the window which was the last to have focus in it, // panel wants to track the window which was the last to have focus in it,
// so we want to set ourselves as the window which last had focus // so we want to set ourselves as the window which last had focus
// //
// notice that it's also important to do it upwards the tree becaus // notice that it's also important to do it upwards the tree because
// otherwise when the top level panel gets focus, it won't set it back to // otherwise when the top level panel gets focus, it won't set it back to
// us, but to some other sibling // us, but to some other sibling
// CS:don't know if this is still needed: // CS: don't know if this is still needed:
//wxChildFocusEvent eventFocus(this); //wxChildFocusEvent eventFocus(this);
//(void)GetEventHandler()->ProcessEvent(eventFocus); //(void)GetEventHandler()->ProcessEvent(eventFocus);
bool bIsFocusEvent = (event.GetEventType() == wxEVT_SET_FOCUS);
// enable this for patch 1376506
#if 0
if ( bIsFocusEvent )
SetUserFocusWindow( GetControlOwner( GetPeer()->GetControlRef() ) );
else
SetUserFocusWindow( kUserFocusAuto );
#endif
if ( MacGetTopLevelWindow() && m_peer->NeedsFocusRect() ) if ( MacGetTopLevelWindow() && m_peer->NeedsFocusRect() )
{ {
#if !wxMAC_USE_CORE_GRAPHICS #if wxMAC_USE_CORE_GRAPHICS
GetParent()->Refresh() ;
#else
wxMacWindowStateSaver sv( this ) ; wxMacWindowStateSaver sv( this ) ;
Rect rect ; Rect rect ;
m_peer->GetRect( &rect ) ; m_peer->GetRect( &rect ) ;
// auf den umgebenden Rahmen zur<75>ck // auf den umgebenden Rahmen zur<75>ck
InsetRect( &rect, -1 , -1 ) ; InsetRect( &rect, -1 , -1 ) ;
wxTopLevelWindowMac* top = MacGetTopLevelWindow(); wxTopLevelWindowMac* top = MacGetTopLevelWindow();
if (top ) if ( top )
{ {
wxPoint pt(0,0) ; wxPoint pt(0,0) ;
wxMacControl::Convert( &pt , GetParent()->m_peer , top->m_peer ) ; wxMacControl::Convert( &pt , GetParent()->m_peer , top->m_peer ) ;
@@ -2581,19 +2594,14 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
rect.bottom += pt.y ; rect.bottom += pt.y ;
} }
if ( event.GetEventType() == wxEVT_SET_FOCUS ) DrawThemeFocusRect( &rect , bIsFocusEvent ) ;
DrawThemeFocusRect( &rect , true ) ; if ( !bIsFocusEvent )
else
{ {
DrawThemeFocusRect( &rect , false ) ;
// as this erases part of the frame we have to redraw borders // as this erases part of the frame we have to redraw borders
// and because our z-ordering is not always correct (staticboxes) // and because our z-ordering is not always correct (staticboxes)
// we have to invalidate things, we cannot simple redraw // we have to invalidate things, we cannot simple redraw
MacInvalidateBorders() ; MacInvalidateBorders() ;
} }
#else
GetParent()->Refresh() ;
#endif #endif
} }