diff options
author | Niklas Nebel <nn@openoffice.org> | 2000-11-09 18:56:06 +0000 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2000-11-09 18:56:06 +0000 |
commit | c7eb1252fc8eebea33eb780bf2cb6cd9274cf847 (patch) | |
tree | 36912c819c1d5ff9c7dac671c70df84fbd0bb2bf /sc/source | |
parent | c70eb2d73c992edb0f46ce2366f38cdcbcf7f2aa (diff) |
#80170# links / flags for use with api
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/inc/simpref.hxx | 15 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/simpref.cxx | 30 |
2 files changed, 38 insertions, 7 deletions
diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx index 62a2310f7630..1da3e1558123 100644 --- a/sc/source/ui/inc/simpref.hxx +++ b/sc/source/ui/inc/simpref.hxx @@ -2,9 +2,9 @@ * * $RCSfile: simpref.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:45:00 $ + * last change: $Author: nn $ $Date: 2000-11-09 19:55:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,8 +99,11 @@ class ScDocument; class ScSimpleRefDlg: public ScAnyRefDlg { private: - Link aCloseHdl; + Link aDoneHdl; + Link aAbortedHdl; + Link aChangeHdl; + FixedText aFtAssign; ScRefEdit aEdAssign; ScRefButton aRbAssign; @@ -116,6 +119,8 @@ private: ScRange theCurArea; BOOL bCloseFlag; BOOL bAutoReOpen; + BOOL bCloseOnButtonUp; + void Init(); DECL_LINK( CancelBtnHdl, void * ); @@ -144,6 +149,10 @@ public: virtual void FillInfo(SfxChildWinInfo&) const; void SetCloseHdl( const Link& rLink ); + void SetUnoLinks( const Link& rDone, const Link& rAbort, + const Link& rChange ); + + void SetFlags( BOOL bSetCloseOnButtonUp ); void SetAutoReOpen(BOOL bFlag) {bAutoReOpen=bFlag;} diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx index efe0e450975c..0be201a66f0c 100644 --- a/sc/source/ui/miscdlgs/simpref.cxx +++ b/sc/source/ui/miscdlgs/simpref.cxx @@ -2,9 +2,9 @@ * * $RCSfile: simpref.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:45:03 $ + * last change: $Author: nn $ $Date: 2000-11-09 19:56:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,7 +121,8 @@ ScSimpleRefDlg::ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP pViewData ( ptrViewData ), pDoc ( ptrViewData->GetDocument() ), bRefInputMode ( FALSE ), - bAutoReOpen ( TRUE ) + bAutoReOpen ( TRUE ), + bCloseOnButtonUp( FALSE ) { // damit die Strings in der Resource bei den FixedTexten bleiben koennen: Init(); @@ -175,6 +176,8 @@ void ScSimpleRefDlg::SetReference( const ScRange& rRef, ScDocument* pDoc ) String aRefStr; theCurArea.Format( aRefStr, ABS_DREF3D, pDoc ); aEdAssign.SetRefString( aRefStr ); + + aChangeHdl.Call( &aRefStr ); } } @@ -218,6 +221,19 @@ void ScSimpleRefDlg::SetCloseHdl( const Link& rLink ) aCloseHdl=rLink; } +void ScSimpleRefDlg::SetUnoLinks( const Link& rDone, const Link& rAbort, + const Link& rChange ) +{ + aDoneHdl = rDone; + aAbortedHdl = rAbort; + aChangeHdl = rChange; +} + +void ScSimpleRefDlg::SetFlags( BOOL bSetCloseOnButtonUp ) +{ + bCloseOnButtonUp = bSetCloseOnButtonUp; +} + void ScSimpleRefDlg::StartRefInput() { aRbAssign.DoRef(); @@ -227,7 +243,8 @@ void ScSimpleRefDlg::StartRefInput() void ScSimpleRefDlg::RefInputDone( BOOL bForced) { ScAnyRefDlg::RefInputDone(bForced); - if(bForced && bCloseFlag) OkBtnHdl(&aBtnOk); + if ( (bForced || bCloseOnButtonUp) && bCloseFlag ) + OkBtnHdl(&aBtnOk); } //------------------------------------------------------------------------ // Handler: @@ -237,7 +254,9 @@ IMPL_LINK( ScSimpleRefDlg, OkBtnHdl, void *, EMPTYARG ) bAutoReOpen=FALSE; String aResult=aEdAssign.GetText(); aCloseHdl.Call(&aResult); + Link aUnoLink = aDoneHdl; // stack var because this is deleted in DoClose DoClose( ScSimpleRefDlgWrapper::GetChildWindowId() ); + aUnoLink.Call( &aResult ); return 0; } @@ -245,8 +264,11 @@ IMPL_LINK( ScSimpleRefDlg, OkBtnHdl, void *, EMPTYARG ) IMPL_LINK( ScSimpleRefDlg, CancelBtnHdl, void *, EMPTYARG ) { bAutoReOpen=FALSE; + String aResult=aEdAssign.GetText(); aCloseHdl.Call(NULL); + Link aUnoLink = aAbortedHdl; // stack var because this is deleted in DoClose DoClose( ScSimpleRefDlgWrapper::GetChildWindowId() ); + aUnoLink.Call( &aResult ); return 0; } |