From 1dde1c3516df7e18fcbe904213160d2d1370625f Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 13 Mar 2002 10:45:16 +0000 Subject: #96965# keyboard control for ref dialogs --- sc/source/ui/inc/anyrefdg.hxx | 180 ++++++++++++++++++++++-------------------- sc/source/ui/inc/condfrmt.hxx | 8 +- sc/source/ui/inc/crnrdlg.hxx | 8 +- sc/source/ui/inc/formula.hxx | 8 +- sc/source/ui/inc/miscdlgs.hrc | 8 +- sc/source/ui/inc/solvrdlg.hxx | 11 ++- sc/source/ui/inc/tabopdlg.hxx | 8 +- sc/source/ui/inc/tabview.hxx | 6 +- 8 files changed, 126 insertions(+), 111 deletions(-) (limited to 'sc/source/ui/inc') diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index bdaab68f304a..e1f29a087129 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: anyrefdg.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: nn $ $Date: 2001-11-28 11:45:35 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,16 +62,16 @@ #ifndef SC_ANYREFDG_HXX #define SC_ANYREFDG_HXX -#ifndef _IMAGEBTN_HXX //autogen +#ifndef _IMAGEBTN_HXX #include #endif -#ifndef _EDIT_HXX //autogen +#ifndef _EDIT_HXX #include #endif -#ifndef _ACCEL_HXX //autogen +#ifndef _ACCEL_HXX #include #endif -#ifndef _BASEDLGS_HXX //autogen +#ifndef _BASEDLGS_HXX #include #endif @@ -80,6 +80,7 @@ class ScRange; class ScDocument; class ScTabViewShell; class ScAnyRefDlg; +class ScRefButton; class ScFormulaCell; class ScCompiler; @@ -88,123 +89,134 @@ class ScCompiler; class ScRefEdit : public Edit { private: + Timer aTimer; + ScAnyRefDlg* pAnyRefDlg; // parent dialog + BOOL bSilentFocus; // for SilentGrabFocus() - Timer aTimer; - ScAnyRefDlg* pAnyRefDlg; // Dialog + DECL_LINK( UpdateHdl, Timer* ); - DECL_LINK( UpdateHdl, Timer*); +protected: + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void GetFocus(); + virtual void LoseFocus(); public: - ScRefEdit( ScAnyRefDlg* pParent, const ResId& rResId); - ScRefEdit( Window *pParent, const ResId& rResId); - ~ScRefEdit(); + ScRefEdit( ScAnyRefDlg* pParent, const ResId& rResId ); + ScRefEdit( Window* pParent, const ResId& rResId ); + virtual ~ScRefEdit(); - void SetRefString( const XubString& rStr ); - virtual void SetText( const XubString& rStr ); + void SetRefString( const XubString& rStr ); + virtual void SetText( const XubString& rStr ); + virtual void Modify(); - virtual void GetFocus(); - virtual void LoseFocus(); - virtual void Modify(); - void StartUpdateData(); + void StartUpdateData(); - void SetRefDialog(ScAnyRefDlg *pDlg); - ScAnyRefDlg* GetRefDialog() {return pAnyRefDlg;} + void SilentGrabFocus(); // does not update any references + void SetRefDialog( ScAnyRefDlg* pDlg ); + inline ScAnyRefDlg* GetRefDialog() { return pAnyRefDlg; } }; +//============================================================================ + class ScRefButton : public ImageButton { -public: - ScRefButton( ScAnyRefDlg* pParent, const ResId& rResId, ScRefEdit* pEdit ); - ScRefButton( Window *pParent, const ResId& rResId); - - void SetReferences( ScAnyRefDlg* pRefDlg,ScRefEdit* pEdit ); +private: + Image aImgRefStart; // Symbol fuer Ref.-Eingabe starten + Image aImgRefDone; // Symbol fuer Ref.-Eingabe beenden + ScAnyRefDlg* pAnyRefDlg; // parent dialog + ScRefEdit* pRefEdit; // zugeordnetes Edit-Control - void SetStartImage(); - void SetEndImage(); - void DoRef() { Click(); } - virtual void GetFocus(); - virtual void LoseFocus(); +protected: + virtual void Click(); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void GetFocus(); + virtual void LoseFocus(); +public: + ScRefButton( ScAnyRefDlg* pParent, const ResId& rResId, ScRefEdit* pEdit ); + ScRefButton( Window* pParent, const ResId& rResId ); -protected: - virtual void Click(); + void SetReferences( ScAnyRefDlg* pDlg, ScRefEdit* pEdit ); -private: - Image aImgRefStart; // Symbol fuer Ref.-Eingabe starten - Image aImgRefDone; // Symbol fuer Ref.-Eingabe beenden - ScAnyRefDlg* pDlg; // Dialog - ScRefEdit* pRefEdit; // zugeordnetes Edit-Control + void SetStartImage(); + void SetEndImage(); + inline void DoRef() { Click(); } }; //============================================================================ + class ScAnyRefDlg : public SfxModelessDialog { -friend ScRefButton; + friend class ScRefButton; + friend class ScRefEdit; private: - SfxBindings* pMyBindings; - Edit* pRefEdit; // aktives Eingabefeld - ScRefButton* pRefBtn; // Button dazu - String sOldDialogText; // Originaltitel des Dialogfensters - Size aOldDialogSize; // Originalgroesse Dialogfenster - Point aOldEditPos; // Originalposition des Eingabefeldes - Size aOldEditSize; // Originalgroesse des Eingabefeldes - Point aOldButtonPos; // Originalpositiuon des Buttons - BOOL* pHiddenMarks; // Merkfeld fuer versteckte Controls - Accelerator* pAccel; // fuer Enter/Escape - BOOL bAccInserted; - BOOL bHighLightRef; - BOOL bEnableColorRef; - ScFormulaCell* pRefCell; - ScCompiler* pRefComp; - Window* pActiveWin; - Timer aTimer; - String aDocName; // document on which the dialog was opened - - DECL_LINK( UpdateFocusHdl, Timer*); - DECL_LINK( AccelSelectHdl, Accelerator * ); + SfxBindings* pMyBindings; + ScRefEdit* pRefEdit; // aktives Eingabefeld + ScRefButton* pRefBtn; // Button dazu + String sOldDialogText; // Originaltitel des Dialogfensters + Size aOldDialogSize; // Originalgroesse Dialogfenster + Point aOldEditPos; // Originalposition des Eingabefeldes + Size aOldEditSize; // Originalgroesse des Eingabefeldes + Point aOldButtonPos; // Originalpositiuon des Buttons + BOOL* pHiddenMarks; // Merkfeld fuer versteckte Controls + Accelerator* pAccel; // fuer Enter/Escape + BOOL bAccInserted; + BOOL bHighLightRef; + BOOL bEnableColorRef; + ScFormulaCell* pRefCell; + ScCompiler* pRefComp; + Window* pActiveWin; + Timer aTimer; + String aDocName; // document on which the dialog was opened + + DECL_LINK( UpdateFocusHdl, Timer* ); + DECL_LINK( AccelSelectHdl, Accelerator* ); protected: - BOOL DoClose( USHORT nId ); + BOOL DoClose( USHORT nId ); - void EnableSpreadsheets(BOOL bFlag=TRUE, BOOL bChilds=TRUE); - void SetDispatcherLock( BOOL bLock ); + void EnableSpreadsheets( BOOL bFlag = TRUE, BOOL bChilds = TRUE ); + void SetDispatcherLock( BOOL bLock ); - virtual long PreNotify( NotifyEvent& rNEvt ); - - virtual void RefInputStart( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); - virtual void RefInputDone( BOOL bForced = FALSE ); - void ShowSimpleReference( const XubString& rStr ); - void ShowFormulaReference( const XubString& rStr ); + virtual long PreNotify( NotifyEvent& rNEvt ); + virtual void RefInputStart( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); + virtual void RefInputDone( BOOL bForced = FALSE ); + void ShowSimpleReference( const XubString& rStr ); + void ShowFormulaReference( const XubString& rStr ); public: - ScAnyRefDlg( SfxBindings* pB, SfxChildWindow* pCW, - Window* pParent, USHORT nResId); - virtual ~ScAnyRefDlg(); + ScAnyRefDlg( SfxBindings* pB, SfxChildWindow* pCW, + Window* pParent, USHORT nResId); + virtual ~ScAnyRefDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; + virtual void AddRefEntry(); - virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; - virtual void AddRefEntry(); + virtual BOOL IsRefInputMode() const; + virtual BOOL IsTableLocked() const; + virtual BOOL IsDocAllowed( SfxObjectShell* pDocSh ) const; - virtual BOOL IsRefInputMode() const; - virtual BOOL IsTableLocked() const; - virtual BOOL IsDocAllowed(SfxObjectShell* pDocSh) const; + void ShowReference( const XubString& rStr ); + void HideReference( BOOL bDoneRefMode = TRUE ); - void ShowReference( const XubString& rStr ); - void HideReference( BOOL bDoneRefMode = TRUE ); + void ToggleCollapsed( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); + void ReleaseFocus( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); - void ViewShellChanged(ScTabViewShell* pScViewShell); - void SwitchToDocument(); - SfxBindings& GetBindings(); + void ViewShellChanged( ScTabViewShell* pScViewShell ); + void SwitchToDocument(); + SfxBindings& GetBindings(); - virtual void SetActive() = 0; -// virtual BOOL Close(); - virtual void StateChanged( StateChangedType nStateChange ); + virtual void SetActive() = 0; +// virtual BOOL Close(); + virtual void StateChanged( StateChangedType nStateChange ); }; +//============================================================================ #endif // SC_ANYREFDG_HXX diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx index 1a178734e0af..2d896fc9e128 100644 --- a/sc/source/ui/inc/condfrmt.hxx +++ b/sc/source/ui/inc/condfrmt.hxx @@ -2,9 +2,9 @@ * * $RCSfile: condfrmt.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2001-05-23 15:05:18 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -182,8 +182,8 @@ private: DECL_LINK( ChangeCond31Hdl, void * ); DECL_LINK( ChangeCond32Hdl, void * ); - DECL_LINK( EdGetFocusHdl, ScRefEdit* ); - DECL_LINK( EdLoseFocusHdl, ScRefEdit* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); DECL_LINK( BtnHdl, PushButton* ); #endif // _CONDFRMT_CXX }; diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx index d9e33e763376..d3d091f0615f 100644 --- a/sc/source/ui/inc/crnrdlg.hxx +++ b/sc/source/ui/inc/crnrdlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: crnrdlg.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2001-05-23 10:52:56 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -143,8 +143,8 @@ private: DECL_LINK( ColClickHdl, void * ); DECL_LINK( RowClickHdl, void * ); DECL_LINK( Range2DataModifyHdl, void * ); - DECL_LINK( EdGetFocusHdl, ScRefEdit* ); - DECL_LINK( EdLoseFocusHdl, ScRefEdit* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); #endif }; diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index a258eecf0c4d..c9817bca3a63 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -2,9 +2,9 @@ * * $RCSfile: formula.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:58 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -219,7 +219,7 @@ private: Font aFntBold; Font aFntLight; USHORT nEdFocus; - Selection theCurSel; +// Selection theCurSel; BOOL bEditFlag; ScFuncDesc* pFuncDesc; USHORT nArgs; @@ -272,6 +272,8 @@ private: xub_StrLen GetFunctionPos(xub_StrLen nPos); void UpdateTokenArray( const String& rStrExp); + ScRefEdit* GetCurrRefEdit(); + DECL_LINK( ScrollHdl, ScParaWin* ); DECL_LINK( ModifyHdl, ScParaWin* ); DECL_LINK( FxHdl, ScParaWin* ); diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc index 38b27ffe0911..4bed24674a05 100644 --- a/sc/source/ui/inc/miscdlgs.hrc +++ b/sc/source/ui/inc/miscdlgs.hrc @@ -2,9 +2,9 @@ * * $RCSfile: miscdlgs.hrc,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dr $ $Date: 2001-05-30 13:33:54 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -163,13 +163,13 @@ #define BTN_RIGHT 3 #define BTN_TOP 4 #define BTN_BOTTOM 5 -#define FL_SEP1 10 +#define FL_SEP11 10 #define FL_TYPE 11 #define BTN_ARITHMETIC 12 #define BTN_GEOMETRIC 13 #define BTN_DATE 14 #define BTN_AUTOFILL 15 -#define FL_SEP2 20 +#define FL_SEP12 20 #define FL_TIME_UNIT 21 #define BTN_DAY 22 #define BTN_DAY_OF_WEEK 23 diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx index a7c82debfbbe..fe6dfc4f3fcd 100644 --- a/sc/source/ui/inc/solvrdlg.hxx +++ b/sc/source/ui/inc/solvrdlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: solvrdlg.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2001-05-23 17:01:30 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,7 +101,7 @@ public: ~ScSolverDlg(); virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); - virtual BOOL IsRefInputMode() const { return bMouseInputMode; } + virtual BOOL IsRefInputMode() const; virtual void SetActive(); virtual BOOL Close(); @@ -129,7 +129,6 @@ private: ScDocument* pDoc; const USHORT nCurTab; ScRefEdit* pEdActive; - BOOL bMouseInputMode; BOOL bDlgLostFocus; const String errMsgInvalidVar; const String errMsgInvalidForm; @@ -143,8 +142,8 @@ private: void RaiseError( ScSolverErr eError ); DECL_LINK( BtnHdl, PushButton* ); - DECL_LINK( EdGetFocusHdl, ScRefEdit* ); - DECL_LINK( EdLoseFocusHdl, ScRefEdit* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); #endif // _SOLVERDLG_CXX }; diff --git a/sc/source/ui/inc/tabopdlg.hxx b/sc/source/ui/inc/tabopdlg.hxx index 708fc59dd0b3..5a5b61bba9ef 100644 --- a/sc/source/ui/inc/tabopdlg.hxx +++ b/sc/source/ui/inc/tabopdlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: tabopdlg.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2001-05-23 17:01:30 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,8 +147,8 @@ private: void RaiseError( ScTabOpErr eError ); DECL_LINK( BtnHdl, PushButton* ); - DECL_LINK( EdGetFocusHdl, ScRefEdit* ); - DECL_LINK( EdLoseFocusHdl, ScRefEdit* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); #endif // _TABOPDLG_CXX }; diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 15071f6470fb..7ff46b66b3b7 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -2,9 +2,9 @@ * * $RCSfile: tabview.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: nn $ $Date: 2001-10-02 18:32:43 $ + * last change: $Author: dr $ $Date: 2002-03-13 11:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -381,6 +381,8 @@ public: void MoveCursorEnter( BOOL bShift ); // Shift fuer Richtung (kein Markieren) + BOOL MoveCursorKeyInput( const KeyEvent& rKeyEvent ); + void FindNextUnprot( BOOL bShift, BOOL bInSelection = TRUE ); void SetTabNo( USHORT nTab, BOOL bNew = FALSE ); -- cgit