diff options
author | Daniel Rentz <dr@openoffice.org> | 2002-03-13 10:45:16 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2002-03-13 10:45:16 +0000 |
commit | 1dde1c3516df7e18fcbe904213160d2d1370625f (patch) | |
tree | f3fec4901e5f16fcb1862ac5c0f637a533a8b5e3 /sc/source/ui/miscdlgs/solvrdlg.cxx | |
parent | abdc9fde06ca5d2e54e97fc85de32cf2ba22e686 (diff) |
#96965# keyboard control for ref dialogs
Diffstat (limited to 'sc/source/ui/miscdlgs/solvrdlg.cxx')
-rw-r--r-- | sc/source/ui/miscdlgs/solvrdlg.cxx | 65 |
1 files changed, 39 insertions, 26 deletions
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx index a2edfe0d0197..845fb6e82e32 100644 --- a/sc/source/ui/miscdlgs/solvrdlg.cxx +++ b/sc/source/ui/miscdlgs/solvrdlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: solvrdlg.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: nn $ $Date: 2001-07-30 15:49:01 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:44:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -139,21 +139,25 @@ void __EXPORT ScSolverDlg::Init() aBtnOk. SetClickHdl ( LINK( this, ScSolverDlg, BtnHdl ) ); aBtnCancel. SetClickHdl ( LINK( this, ScSolverDlg, BtnHdl ) ); - aEdFormulaCell. SetGetFocusHdl ( LINK( this, ScSolverDlg, EdGetFocusHdl ) ); - aEdVariableCell.SetGetFocusHdl ( LINK( this, ScSolverDlg, EdGetFocusHdl ) ); - aEdTargetVal. SetGetFocusHdl ( LINK( this, ScSolverDlg, EdGetFocusHdl ) ); - aEdFormulaCell. SetLoseFocusHdl ( LINK( this, ScSolverDlg, EdLoseFocusHdl ) ); - aEdVariableCell.SetLoseFocusHdl ( LINK( this, ScSolverDlg, EdLoseFocusHdl ) ); + + Link aLink = LINK( this, ScSolverDlg, GetFocusHdl ); + aEdFormulaCell. SetGetFocusHdl ( aLink ); + aRBFormulaCell. SetGetFocusHdl ( aLink ); + aEdVariableCell.SetGetFocusHdl ( aLink ); + aRBVariableCell.SetGetFocusHdl ( aLink ); + aEdTargetVal. SetGetFocusHdl ( aLink ); + + aLink = LINK( this, ScSolverDlg, LoseFocusHdl ); + aEdFormulaCell. SetLoseFocusHdl ( aLink ); + aRBFormulaCell. SetLoseFocusHdl ( aLink ); + aEdVariableCell.SetLoseFocusHdl ( aLink ); + aRBVariableCell.SetLoseFocusHdl ( aLink ); theFormulaCell.Format( aStr, SCA_ABS ); aEdFormulaCell.SetText( aStr ); aEdFormulaCell.GrabFocus(); pEdActive = &aEdFormulaCell; - bMouseInputMode = TRUE; - - //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Enable(); } //---------------------------------------------------------------------------- @@ -167,10 +171,11 @@ BOOL __EXPORT ScSolverDlg::Close() void ScSolverDlg::SetActive() { - if ( bDlgLostFocus && bMouseInputMode ) + if ( bDlgLostFocus ) { bDlgLostFocus = FALSE; - pEdActive->GrabFocus(); + if( pEdActive ) + pEdActive->GrabFocus(); } else { @@ -183,7 +188,7 @@ void ScSolverDlg::SetActive() void ScSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDoc ) { - if ( bMouseInputMode && pEdActive ) + if( pEdActive ) { if ( rRef.aStart != rRef.aEnd ) RefInputStart(pEdActive); @@ -234,6 +239,13 @@ void ScSolverDlg::RaiseError( ScSolverErr eError ) //---------------------------------------------------------------------------- +BOOL ScSolverDlg::IsRefInputMode() const +{ + return pEdActive != NULL; +} + +//---------------------------------------------------------------------------- + BOOL __EXPORT ScSolverDlg::CheckTargetValue( String& rStrVal ) { ULONG n1 = 0; @@ -304,26 +316,27 @@ IMPL_LINK( ScSolverDlg, BtnHdl, PushButton*, pBtn ) //---------------------------------------------------------------------------- -IMPL_LINK( ScSolverDlg, EdGetFocusHdl, ScRefEdit*, pEd ) +IMPL_LINK( ScSolverDlg, GetFocusHdl, Control*, pCtrl ) { - pEdActive = pEd; - bMouseInputMode = ( pEd != &aEdTargetVal ); + Edit* pEdit = NULL; + pEdActive = NULL; - //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - /* - if ( bMouseInputMode ) - SFX_APPWINDOW->Enable(); - else - SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg - */ - pEd->SetSelection( Selection(0,SELECTION_MAX) ); + if( (pCtrl == (Control*)&aEdFormulaCell) || (pCtrl == (Control*)&aRBFormulaCell) ) + pEdit = pEdActive = &aEdFormulaCell; + else if( (pCtrl == (Control*)&aEdVariableCell) || (pCtrl == (Control*)&aRBVariableCell) ) + pEdit = pEdActive = &aEdVariableCell; + else if( pCtrl == (Control*)&aEdTargetVal ) + pEdit = &aEdTargetVal; + + if( pEdit ) + pEdit->SetSelection( Selection( 0, SELECTION_MAX ) ); return NULL; } //---------------------------------------------------------------------------- -IMPL_LINK( ScSolverDlg, EdLoseFocusHdl, ScRefEdit*, pEd ) +IMPL_LINK( ScSolverDlg, LoseFocusHdl, Control*, pCtrl ) { bDlgLostFocus = !IsActive(); return NULL; |