summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-08-03 13:07:02 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-08-03 13:07:02 +0000
commitfa63103fdb277ef251e61353bce6de2a729b05d2 (patch)
treea1cbc24dd0a7ff29ac08800f6bd43e14d2c9e978 /vcl/source
parent1953421acff7397e64456fe7c0d38fe150ab69ac (diff)
INTEGRATION: CWS aquavcl02 (1.86.12); FILE MERGED
2007/07/31 09:08:22 pjanik 1.86.12.2: RESYNC: (1.86-1.87); FILE MERGED 2007/07/17 14:28:30 pl 1.86.12.1: #i79475# enable native focus drawing for edit fields
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/edit.cxx36
1 files changed, 33 insertions, 3 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index e1b649f2572e..d4f1c5ede89e 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: edit.cxx,v $
*
- * $Revision: 1.87 $
+ * $Revision: 1.88 $
*
- * last change: $Author: rt $ $Date: 2007-07-24 10:06:15 $
+ * last change: $Author: hr $ $Date: 2007-08-03 14:07:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1891,6 +1891,19 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG
// -----------------------------------------------------------------------
+static void ImplInvalidateOutermostBorder( Window* pWin )
+{
+ // allow control to show focused state
+ Window *pInvalWin = pWin, *pBorder = pWin;
+ while( ( pBorder = pInvalWin->GetWindow( WINDOW_BORDER ) ) != pInvalWin && pBorder &&
+ pInvalWin->ImplGetFrame() == pBorder->ImplGetFrame() )
+ {
+ pInvalWin = pBorder;
+ }
+
+ pInvalWin->Invalidate( INVALIDATE_CHILDREN | INVALIDATE_UPDATE );
+}
+
void Edit::GetFocus()
{
if ( mpSubEdit )
@@ -1921,7 +1934,15 @@ void Edit::GetFocus()
ImplShowCursor();
- if ( maSelection.Len() )
+ // FIXME: this is currently only on aqua
+ // check for other platforms that need similar handling
+ if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
+ IsNativeWidgetEnabled() &&
+ IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
+ {
+ ImplInvalidateOutermostBorder( this );
+ }
+ else if ( maSelection.Len() )
{
// Selektion malen
if ( !HasPaintEvent() )
@@ -1952,6 +1973,15 @@ void Edit::LoseFocus()
{
if ( !mpSubEdit )
{
+ // FIXME: this is currently only on aqua
+ // check for other platforms that need similar handling
+ if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
+ IsNativeWidgetEnabled() &&
+ IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
+ {
+ ImplInvalidateOutermostBorder( this );
+ }
+
if ( !mbActivePopup && !( GetStyle() & WB_NOHIDESELECTION ) && maSelection.Len() )
ImplInvalidateOrRepaint(); // Selektion malen
}