diff options
author | Christian Lippka <cl@openoffice.org> | 2002-02-15 13:28:33 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2002-02-15 13:28:33 +0000 |
commit | 9a7b280c959b8d8be7b74674be4b39e5af77c69a (patch) | |
tree | e3355b4b8c3a82725a7c748023413271e6a4a238 /svx/source/dialog/dlgctrl.cxx | |
parent | 6b273c0c47ead0b5064dd561dcf9646e8c1033a0 (diff) |
#97511# added focus rect for rectangle control
Diffstat (limited to 'svx/source/dialog/dlgctrl.cxx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 57db91077dca..ba5aa7582924 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgctrl.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: thb $ $Date: 2001-06-28 09:23:12 $ + * last change: $Author: cl $ $Date: 2002-02-15 14:28:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -238,6 +238,8 @@ void SvxRectCtl::MouseButtonDown( const MouseEvent& rMEvt ) if( WINDOW_TABPAGE == GetParent()->GetType() ) ( (SvxTabPage*) GetParent() )->PointChanged( this, eRP ); } + + SetFocusRectangle(); } // ----------------------------------------------------------------------- @@ -315,6 +317,8 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt ) if( WINDOW_TABPAGE == GetParent()->GetType() ) ( (SvxTabPage*) GetParent() )->PointChanged( this, eRP ); + + SetFocusRectangle(); } } @@ -468,6 +472,33 @@ void SvxRectCtl::Paint( const Rectangle& rRect ) } } +void SvxRectCtl::GetFocus() +{ + Control::GetFocus(); + + SetFocusRectangle(); +} + +void SvxRectCtl::LoseFocus() +{ + Control::HideFocus(); + + HideFocus(); +} + +void SvxRectCtl::SetFocusRectangle() +{ + if( HasFocus() && IsEnabled() && (eCS != CS_ANGLE || aPtNew != aPtMM) ) + { + Size aBtnSize( 16, 16 ); + Size aDstBtnSize( PixelToLogic( aBtnSize ) ); + Point aToCenter( aDstBtnSize.Width() >> 1, aDstBtnSize.Height() >> 1); + + Rectangle aFocusRect( aPtNew - aToCenter, aDstBtnSize ); + ShowFocus( aFocusRect ); + } +} + /************************************************************************* |* |* Konvertiert RECT_POINT in Point |