diff options
author | Rüdiger Timm <rt@openoffice.org> | 2007-07-05 07:43:42 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2007-07-05 07:43:42 +0000 |
commit | 8e69405b60d1426fa645b4b8ff36a6e977e414da (patch) | |
tree | 8fbf61de88f067578a6026035b31a2ae30fb41d5 /vcl/source/window/window2.cxx | |
parent | 662a366c16717f570f8c815b6042c93c730cbddc (diff) |
INTEGRATION: CWS aquavcl01 (1.22.16); FILE MERGED
2007/06/20 19:00:28 pl 1.22.16.1: #i78510# enable native focus markers for selected controls
Diffstat (limited to 'vcl/source/window/window2.cxx')
-rw-r--r-- | vcl/source/window/window2.cxx | 79 |
1 files changed, 61 insertions, 18 deletions
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 6644cd6353e0..305278686374 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -4,9 +4,9 @@ * * $RCSfile: window2.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: hr $ $Date: 2007-06-27 20:36:03 $ + * last change: $Author: rt $ $Date: 2007-07-05 08:43:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -405,26 +405,47 @@ void Window::ShowFocus( const Rectangle& rRect ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); + if( mpWindowImpl->mbInShowFocus ) + return; + mpWindowImpl->mbInShowFocus = TRUE; + ImplWinData* pWinData = ImplGetWinData(); - if ( !mpWindowImpl->mbInPaint ) + // native themeing suggest not to use focus rects + if( ! ( mpWindowImpl->mbUseNativeFocus && + IsNativeWidgetEnabled() ) ) { - if ( mpWindowImpl->mbFocusVisible ) + if ( !mpWindowImpl->mbInPaint ) { - if ( *(pWinData->mpFocusRect) == rRect ) - return; + if ( mpWindowImpl->mbFocusVisible ) + { + if ( *(pWinData->mpFocusRect) == rRect ) + { + mpWindowImpl->mbInShowFocus = FALSE; + return; + } - ImplInvertFocus( *(pWinData->mpFocusRect) ); - } + ImplInvertFocus( *(pWinData->mpFocusRect) ); + } - ImplInvertFocus( rRect ); + ImplInvertFocus( rRect ); + } + if ( !pWinData->mpFocusRect ) + pWinData->mpFocusRect = new Rectangle( rRect ); + else + *(pWinData->mpFocusRect) = rRect; + mpWindowImpl->mbFocusVisible = TRUE; } - - if ( !pWinData->mpFocusRect ) - pWinData->mpFocusRect = new Rectangle( rRect ); else - *(pWinData->mpFocusRect) = rRect; - mpWindowImpl->mbFocusVisible = TRUE; + { + if( ! mpWindowImpl->mbNativeFocusVisible ) + { + mpWindowImpl->mbNativeFocusVisible = TRUE; + if ( !mpWindowImpl->mbInPaint ) + Invalidate(); + } + } + mpWindowImpl->mbInShowFocus = FALSE; } // ----------------------------------------------------------------------- @@ -433,12 +454,34 @@ void Window::HideFocus() { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - if ( !mpWindowImpl->mbFocusVisible ) + if( mpWindowImpl->mbInHideFocus ) return; + mpWindowImpl->mbInHideFocus = TRUE; + + // native themeing can suggest not to use focus rects + if( ! ( mpWindowImpl->mbUseNativeFocus && + IsNativeWidgetEnabled() ) ) + { + if ( !mpWindowImpl->mbFocusVisible ) + { + mpWindowImpl->mbInHideFocus = FALSE; + return; + } - if ( !mpWindowImpl->mbInPaint ) - ImplInvertFocus( *(ImplGetWinData()->mpFocusRect) ); - mpWindowImpl->mbFocusVisible = FALSE; + if ( !mpWindowImpl->mbInPaint ) + ImplInvertFocus( *(ImplGetWinData()->mpFocusRect) ); + mpWindowImpl->mbFocusVisible = FALSE; + } + else + { + if( mpWindowImpl->mbNativeFocusVisible ) + { + mpWindowImpl->mbNativeFocusVisible = FALSE; + if ( !mpWindowImpl->mbInPaint ) + Invalidate(); + } + } + mpWindowImpl->mbInHideFocus = FALSE; } // ----------------------------------------------------------------------- |