Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / formula / source / ui / dlg / funcutl.cxx
blobedbfee0bef38c6f78f983f75ddb30ce96e3197b1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/svapp.hxx>
21 #include <vcl/scrbar.hxx>
23 #include "formula/funcutl.hxx"
24 #include "formula/IControlReferenceHandler.hxx"
25 #include "ControlHelper.hxx"
26 #include "ModuleHelper.hxx"
27 #include "ForResId.hrc"
30 namespace formula
32 //============================================================================
33 // class ValWnd
34 //----------------------------------------------------------------------------
36 ValWnd::ValWnd( Window* pParent, const ResId& rId ) : Window( pParent, rId )
38 Font aFnt( GetFont() );
39 aFnt.SetTransparent( sal_True );
40 aFnt.SetWeight( WEIGHT_LIGHT );
41 if ( pParent->IsBackground() )
43 Wallpaper aBack = pParent->GetBackground();
44 SetFillColor( aBack.GetColor() );
45 SetBackground( aBack );
46 aFnt.SetFillColor( aBack.GetColor() );
48 else
50 SetFillColor();
51 SetBackground();
53 SetFont( aFnt );
54 SetLineColor();
56 Size aSzWnd = GetOutputSizePixel();
57 long nHeight = GetTextHeight();
58 long nDiff = aSzWnd.Height()-nHeight;
60 aRectOut = Rectangle( Point( 1, ( nDiff<2 ) ? 1 : nDiff/2),
61 Size ( aSzWnd.Width()-2, nHeight ) );
62 SetClipRegion( Region( aRectOut ) );
65 //----------------------------------------------------------------------------
67 void ValWnd::Paint( const Rectangle& )
69 DrawText( aRectOut.TopLeft(), aStrValue );
72 //----------------------------------------------------------------------------
74 void ValWnd::SetValue( const String& rStrVal )
76 if ( aStrValue != rStrVal )
78 aStrValue = rStrVal;
79 DrawRect( aRectOut ); // alten Text loeschen
80 Paint( aRectOut ); // and neu malen
84 //============================================================================
85 // class ArgEdit
86 //----------------------------------------------------------------------------
88 ArgEdit::ArgEdit( Window* pParent, const ResId& rResId )
89 : RefEdit( pParent, NULL, rResId ),
90 pEdPrev ( NULL ),
91 pEdNext ( NULL ),
92 pSlider ( NULL ),
93 nArgs ( 0 )
97 //----------------------------------------------------------------------------
99 void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
100 ScrollBar& rArgSlider, sal_uInt16 nArgCount )
102 pEdPrev = pPrevEdit;
103 pEdNext = pNextEdit;
104 pSlider = &rArgSlider;
105 nArgs = nArgCount;
108 //----------------------------------------------------------------------------
110 // Cursor control for Edit Fields in Argument Dialog
112 void ArgEdit::KeyInput( const KeyEvent& rKEvt )
114 KeyCode aCode = rKEvt.GetKeyCode();
115 sal_Bool bUp = (aCode.GetCode() == KEY_UP);
116 sal_Bool bDown = (aCode.GetCode() == KEY_DOWN);
117 ArgEdit* pEd = NULL;
119 if ( pSlider
120 && ( !aCode.IsShift() && !aCode.IsMod1() && !aCode.IsMod2() )
121 && ( bUp || bDown ) )
123 if ( nArgs > 1 )
125 long nThumb = pSlider->GetThumbPos();
126 sal_Bool bDoScroll = sal_False;
127 sal_Bool bChangeFocus = sal_False;
129 if ( bDown )
131 if ( nArgs > 4 )
133 if ( !pEdNext )
135 nThumb++;
136 bDoScroll = ( nThumb+3 < (long)nArgs );
138 else
140 pEd = pEdNext;
141 bChangeFocus = sal_True;
144 else if ( pEdNext )
146 pEd = pEdNext;
147 bChangeFocus = sal_True;
150 else // if ( bUp )
152 if ( nArgs > 4 )
154 if ( !pEdPrev )
156 nThumb--;
157 bDoScroll = ( nThumb >= 0 );
159 else
161 pEd = pEdPrev;
162 bChangeFocus = sal_True;
165 else if ( pEdPrev )
167 pEd = pEdPrev;
168 bChangeFocus = sal_True;
172 if ( bDoScroll )
174 pSlider->SetThumbPos( nThumb );
175 ((Link&)pSlider->GetEndScrollHdl()).Call( pSlider );
177 else if ( bChangeFocus )
179 pEd->GrabFocus();
183 else
184 RefEdit::KeyInput( rKEvt );
190 /*************************************************************************
191 #* Member: ArgInput Date:13.01.97
192 #*------------------------------------------------------------------------
194 #* Class: ArgInput
196 #* Function: ArgInput class constructor
198 #* Input: ---
200 #* Output: ---
202 #************************************************************************/
204 ArgInput::ArgInput()
206 pFtArg=NULL;
207 pBtnFx=NULL;
208 pEdArg=NULL;
209 pRefBtn=NULL;
212 /*************************************************************************
213 #* Member: InitArgInput Date:13.01.97
214 #*------------------------------------------------------------------------
216 #* Class: ArgInput
218 #* Function: Initializes the class' Pointer
220 #* Input: ---
222 #* Output: ---
224 #************************************************************************/
226 void ArgInput::InitArgInput(FixedText* pftArg,
227 ImageButton* pbtnFx,
228 ArgEdit* pedArg,
229 RefButton* prefBtn)
231 pFtArg =pftArg;
232 pBtnFx =pbtnFx;
233 pEdArg =pedArg;
234 pRefBtn=prefBtn;
236 if(pBtnFx!=NULL)
238 pBtnFx->SetClickHdl ( LINK( this, ArgInput, FxBtnClickHdl ) );
239 pBtnFx->SetGetFocusHdl( LINK( this, ArgInput, FxBtnFocusHdl ) );
241 if(pRefBtn!=NULL)
243 pRefBtn->SetClickHdl ( LINK( this, ArgInput, RefBtnClickHdl ) );
244 pRefBtn->SetGetFocusHdl( LINK( this, ArgInput, RefBtnFocusHdl ) );
246 if(pEdArg!=NULL)
248 pEdArg->SetGetFocusHdl ( LINK( this, ArgInput, EdFocusHdl ) );
249 pEdArg->SetModifyHdl ( LINK( this, ArgInput, EdModifyHdl ) );
254 /*************************************************************************
255 #* Member: SetArgName Date:13.01.97
256 #*------------------------------------------------------------------------
258 #* Class: ArgInput
260 #* Function: Sets the Name for the Argument
262 #* Input: String
264 #* Output: ---
266 #************************************************************************/
267 void ArgInput::SetArgName(const String &aArg)
269 if(pFtArg !=NULL) pFtArg->SetText(aArg );
272 /*************************************************************************
273 #* Member: GetArgName Date:06.02.97
274 #*------------------------------------------------------------------------
276 #* Class: ArgInput
278 #* Function: Returns the Name for the Argument
280 #* Input: String
282 #* Output: ---
284 #************************************************************************/
285 String ArgInput::GetArgName()
287 String aPrivArgName;
288 if(pFtArg !=NULL)
289 aPrivArgName=pFtArg->GetText();
291 return aPrivArgName;
294 /*************************************************************************
295 #* Member: SetArgName Date:13.01.97
296 #*------------------------------------------------------------------------
298 #* Class: ArgInput
300 #* Function: Sets the Name for the Argument
302 #* Input: String
304 #* Output: ---
306 #************************************************************************/
307 void ArgInput::SetArgNameFont (const Font &aFont)
309 if(pFtArg !=NULL) pFtArg->SetFont(aFont);
312 /*************************************************************************
313 #* Member: SetArgSelection Date:13.01.97
314 #*------------------------------------------------------------------------
316 #* Class: ArgInput
318 #* Function: Sets up the Selection for the EditBox.
320 #* Input: String
322 #* Output: ---
324 #************************************************************************/
325 void ArgInput::SetArgSelection (const Selection& rSel )
327 if(pEdArg !=NULL) pEdArg ->SetSelection(rSel );
331 /*************************************************************************
332 #* Member: SetArgVal Date:13.01.97
333 #*------------------------------------------------------------------------
335 #* Class: ArgInput
337 #* Function: Sets the Value for the Argument
339 #* Input: String
341 #* Output: ---
343 #************************************************************************/
344 void ArgInput::SetArgVal(const String &aVal)
346 if(pEdArg !=NULL)
348 pEdArg ->SetRefString(aVal );
352 /*************************************************************************
353 #* Member: SetArgName Date:13.01.97
354 #*------------------------------------------------------------------------
356 #* Class: ArgInput
358 #* Function: Returns the Value for the Argument
360 #* Input: ---
362 #* Output: String
364 #************************************************************************/
365 String ArgInput::GetArgVal()
367 String aResult;
368 if(pEdArg!=NULL)
370 aResult=pEdArg->GetText();
372 return aResult;
375 /*************************************************************************
376 #* Member: SetArgName Date:13.01.97
377 #*------------------------------------------------------------------------
379 #* Class: ArgInput
381 #* Function: Hides the Controls
383 #* Input: ---
385 #* Output: ---
387 #************************************************************************/
388 void ArgInput::Hide()
390 if ( pFtArg && pBtnFx && pEdArg && pRefBtn)
392 pFtArg->Hide();
393 pBtnFx->Hide();
394 pEdArg->Hide();
395 pRefBtn->Hide();
399 /*************************************************************************
400 #* Member: SetArgName Date:13.01.97
401 #*------------------------------------------------------------------------
403 #* Class: ArgInput
405 #* Function: Casts the Controls again.
407 #* Input: ---
409 #* Output: ---
411 #************************************************************************/
412 void ArgInput::Show()
414 if ( pFtArg && pBtnFx && pEdArg && pRefBtn)
416 pFtArg->Show();
417 pBtnFx->Show();
418 pEdArg->Show();
419 pRefBtn->Show();
423 /*************************************************************************
424 #* Member: FxClick Date:13.01.97
425 #*------------------------------------------------------------------------
427 #* Class: ArgInput
429 #* Function: Forwards the Event.
431 #* Input: ---
433 #* Output: ---
435 #************************************************************************/
436 void ArgInput::FxClick()
438 aFxClickLink.Call(this);
441 /*************************************************************************
442 #* Member: RefClick Date:13.01.97
443 #*------------------------------------------------------------------------
445 #* Class: ArgInput
447 #* Function: Forwards the Event.
449 #* Input: ---
451 #* Output: ---
453 #************************************************************************/
454 void ArgInput::RefClick()
456 aRefClickLink.Call(this);
459 /*************************************************************************
460 #* Member: FxFocus Date:13.01.97
461 #*------------------------------------------------------------------------
463 #* Class: ArgInput
465 #* Function: Forwards the Event.
467 #* Input: ---
469 #* Output: ---
471 #************************************************************************/
472 void ArgInput::FxFocus()
474 aFxFocusLink.Call(this);
477 /*************************************************************************
478 #* Member: RefFocus Date:13.01.97
479 #*------------------------------------------------------------------------
481 #* Class: ArgInput
483 #* Function: Forwards the Event.
485 #* Input: ---
487 #* Output: ---
489 #************************************************************************/
490 void ArgInput::RefFocus()
492 aRefFocusLink.Call(this);
495 /*************************************************************************
496 #* Member: EdFocus Date:13.01.97
497 #*------------------------------------------------------------------------
499 #* Class: ArgInput
501 #* Function: Forwards the Event.
503 #* Input: ---
505 #* Output: ---
507 #************************************************************************/
508 void ArgInput::EdFocus()
510 aEdFocusLink.Call(this);
513 /*************************************************************************
514 #* Member: EdModify Date:13.01.97
515 #*------------------------------------------------------------------------
517 #* Class: ArgInput
519 #* Function: Forwards the Event.
521 #* Input: ---
523 #* Output: ---
525 #************************************************************************/
526 void ArgInput::EdModify()
528 aEdModifyLink.Call(this);
531 /*************************************************************************
532 #* Handle: FxBtnHdl Date:13.01.97
533 #*------------------------------------------------------------------------
535 #* Class: ArgInput
537 #* Function: Handle for Fx-Button Click-Event.
539 #* Input: ---
541 #* Output: ---
543 #************************************************************************/
544 IMPL_LINK( ArgInput, FxBtnClickHdl, ImageButton*, pBtn )
546 if(pBtn==pBtnFx) FxClick();
548 return 0;
551 /*************************************************************************
552 #* Handle: RefBtnClickHdl Date:13.01.97
553 #*------------------------------------------------------------------------
555 #* Class: ArgInput
557 #* Function: Handle for Fx-Button Click-Event.
559 #* Input: ---
561 #* Output: ---
563 #************************************************************************/
564 IMPL_LINK( ArgInput, RefBtnClickHdl,RefButton*, pBtn )
566 if(pRefBtn==pBtn) RefClick();
568 return 0;
571 /*************************************************************************
572 #* Handle: FxBtnFocusHdl Date:13.01.97
573 #*------------------------------------------------------------------------
575 #* Class: ArgInput
577 #* Function: Handle for Fx-Button Focus-Event.
579 #* Input: ---
581 #* Output: ---
583 #************************************************************************/
584 IMPL_LINK( ArgInput, FxBtnFocusHdl, ImageButton*, pBtn )
586 if(pBtn==pBtnFx) FxFocus();
588 return 0;
591 /*************************************************************************
592 #* Handle: RefBtnFocusHdl Date:13.01.97
593 #*------------------------------------------------------------------------
595 #* Class: ArgInput
597 #* Function: Handle for Fx-Button Focus-Event.
599 #* Input: ---
601 #* Output: ---
603 #************************************************************************/
604 IMPL_LINK( ArgInput, RefBtnFocusHdl,RefButton*, pBtn )
606 if(pRefBtn==pBtn) RefFocus();
608 return 0;
611 /*************************************************************************
612 #* Handle: EdFocusHdl Date:13.01.97
613 #*------------------------------------------------------------------------
615 #* Class: ArgInput
617 #* Function: Handle for Fx-Button Focus-Event.
619 #* Input: ---
621 #* Output: ---
623 #************************************************************************/
624 IMPL_LINK( ArgInput, EdFocusHdl, ArgEdit*, pEd )
626 if(pEd==pEdArg) EdFocus();
628 return 0;
631 /*************************************************************************
632 #* Handle: RefBtnClickHdl Date:13.01.97
633 #*------------------------------------------------------------------------
635 #* Class: ArgInput
637 #* Function: Handle for Fx-Button Focus-Event.
639 #* Input: ---
641 #* Output: ---
643 #************************************************************************/
644 IMPL_LINK( ArgInput, EdModifyHdl,ArgEdit*, pEd )
646 if(pEd==pEdArg) EdModify();
648 return 0;
651 /*************************************************************************
652 #* Member: EditBox Date:20.01.97
653 #*------------------------------------------------------------------------
655 #* Class: EditBox
657 #* Function: Constructor from Class ArgInput
659 #* Input: Parent, Resource
661 #* Output: ---
663 #************************************************************************/
664 EditBox::EditBox( Window* pParent, const ResId& rResId )
665 :Control(pParent,rResId),
666 bMouseFlag(sal_False)
668 WinBits nStyle=GetStyle();
669 SetStyle( nStyle| WB_DIALOGCONTROL);
671 pMEdit=new MultiLineEdit(this,WB_LEFT | WB_VSCROLL | (nStyle & WB_TABSTOP) |
672 WB_NOBORDER | WB_NOHIDESELECTION | WB_IGNORETAB);
673 pMEdit->Show();
674 aOldSel=pMEdit->GetSelection();
675 Resize();
676 WinBits nWinStyle=GetStyle() | WB_DIALOGCONTROL;
677 SetStyle(nWinStyle);
679 // #105582# the HelpId from the resource must be set for the MultiLineEdit,
680 // not for the control that contains it.
681 pMEdit->SetHelpId( GetHelpId() );
682 SetHelpId( "" );
685 EditBox::~EditBox()
687 MultiLineEdit* pTheEdit=pMEdit;
688 pMEdit->Disable();
689 pMEdit=NULL;
690 delete pTheEdit;
692 /*************************************************************************
693 #* Member: EditBox Date:20.01.97
694 #*------------------------------------------------------------------------
696 #* Class: EditBox
698 #* Function: When the seleccion is changed this function will be called
700 #* Input: ---
702 #* Output: ---
704 #************************************************************************/
705 void EditBox::SelectionChanged()
707 aSelChangedLink.Call(this);
710 /*************************************************************************
711 #* Member: EditBox Date:20.05.98
712 #*------------------------------------------------------------------------
714 #* Class: EditBox
716 #* Function: When the size is changed, MultiLineEdit must
717 #* be adapted..
719 #* Input: ---
721 #* Output: ---
723 #************************************************************************/
724 void EditBox::Resize()
726 Size aSize=GetOutputSizePixel();
727 if(pMEdit!=NULL) pMEdit->SetOutputSizePixel(aSize);
730 /*************************************************************************
731 #* Member: GetFocus Date:26.05.98
732 #*------------------------------------------------------------------------
734 #* Class: EditBox
736 #* Function: When the Control is activated,
737 #* the Selection is repealed and the Cursor set
738 #* at the end.
740 #* Input: ---
742 #* Output: ---
744 #************************************************************************/
745 void EditBox::GetFocus()
747 if(pMEdit!=NULL)
749 pMEdit->GrabFocus();
755 /*************************************************************************
756 #* Member: EditBox Date:20.01.97
757 #*------------------------------------------------------------------------
759 #* Class: EditBox
761 #* Function: When an Event is cleared, this Routine is
762 #* first called and a PostUserEvent is sent.
764 #* Input: Notify-Event
766 #* Output: ---
768 #************************************************************************/
769 long EditBox::PreNotify( NotifyEvent& rNEvt )
771 long nResult=sal_True;
773 if(pMEdit==NULL) return nResult;
775 sal_uInt16 nSwitch=rNEvt.GetType();
776 if(nSwitch==EVENT_KEYINPUT)// || nSwitch==EVENT_KEYUP)
778 const KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode();
779 sal_uInt16 nKey=aKeyCode.GetCode();
780 if( (nKey==KEY_RETURN && !aKeyCode.IsShift()) || nKey==KEY_TAB )
782 nResult=GetParent()->Notify(rNEvt);
784 else
786 nResult=Control::PreNotify(rNEvt);
787 Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ) );
791 else
793 nResult=Control::PreNotify(rNEvt);
795 if(nSwitch==EVENT_MOUSEBUTTONDOWN || nSwitch==EVENT_MOUSEBUTTONUP)
797 bMouseFlag=sal_True;
798 Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ) );
801 return nResult;
804 /*************************************************************************
805 #* Member: EditBox Date:21.01.97
806 #*------------------------------------------------------------------------
808 #* Class: EditBox
810 #* Function: When an Event cleared wurde, this routine is
811 #* first called.
813 #* Input: Key-Event
815 #* Output: ---
817 #************************************************************************/
818 IMPL_LINK_NOARG(EditBox, ChangedHdl)
820 if(pMEdit!=NULL)
822 Selection aNewSel=pMEdit->GetSelection();
824 if(aNewSel.Min()!=aOldSel.Min() || aNewSel.Max()!=aOldSel.Max())
826 SelectionChanged();
827 aOldSel=aNewSel;
830 return 0;
833 void EditBox::UpdateOldSel()
835 // if selection is set for editing a function, store it as aOldSel,
836 // so SelectionChanged isn't called in the next ChangedHdl call
838 if (pMEdit)
839 aOldSel = pMEdit->GetSelection();
841 //----------------------------------------------------------------------------
843 //============================================================================
844 // class RefEdit
845 //----------------------------------------------------------------------------
847 #define SC_ENABLE_TIME 100
849 RefEdit::RefEdit( Window* _pParent,IControlReferenceHandler* pParent, const ResId& rResId ) :
850 Edit( _pParent, rResId ),
851 pAnyRefDlg( pParent )
853 aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) );
854 aTimer.SetTimeout( SC_ENABLE_TIME );
857 RefEdit::~RefEdit()
859 aTimer.SetTimeoutHdl( Link() );
860 aTimer.Stop();
863 void RefEdit::SetRefString( const XubString& rStr )
865 Edit::SetText( rStr );
868 void RefEdit::SetRefValid(bool bValid)
870 if (bValid)
872 SetControlForeground();
873 SetControlBackground();
875 else
877 SetControlForeground(COL_WHITE);
878 SetControlBackground(0xff6563);
882 void RefEdit::SetText( const XubString& rStr )
884 Edit::SetText( rStr );
885 UpdateHdl( &aTimer );
888 void RefEdit::StartUpdateData()
890 aTimer.Start();
893 void RefEdit::SetRefDialog( IControlReferenceHandler* pDlg )
895 pAnyRefDlg = pDlg;
897 if( pDlg )
899 aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) );
900 aTimer.SetTimeout( SC_ENABLE_TIME );
902 else
904 aTimer.SetTimeoutHdl( Link() );
905 aTimer.Stop();
909 void RefEdit::Modify()
911 Edit::Modify();
912 if( pAnyRefDlg )
913 pAnyRefDlg->HideReference();
916 void RefEdit::KeyInput( const KeyEvent& rKEvt )
918 const KeyCode& rKeyCode = rKEvt.GetKeyCode();
919 if( pAnyRefDlg && !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
920 pAnyRefDlg->ReleaseFocus( this );
921 else
922 Edit::KeyInput( rKEvt );
925 void RefEdit::GetFocus()
927 Edit::GetFocus();
928 StartUpdateData();
931 void RefEdit::LoseFocus()
933 Edit::LoseFocus();
934 if( pAnyRefDlg )
935 pAnyRefDlg->HideReference();
938 IMPL_LINK_NOARG(RefEdit, UpdateHdl)
940 if( pAnyRefDlg )
941 pAnyRefDlg->ShowReference( GetText() );
942 return 0;
946 //============================================================================
947 // class RefButton
948 //----------------------------------------------------------------------------
949 RefButton::RefButton( Window* _pParent, const ResId& rResId) :
950 ImageButton( _pParent, rResId ),
951 aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
952 aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ),
953 pAnyRefDlg( NULL ),
954 pRefEdit( NULL )
956 SetStartImage();
959 RefButton::RefButton( Window* _pParent, const ResId& rResId, RefEdit* pEdit, IControlReferenceHandler* _pDlg ) :
960 ImageButton( _pParent, rResId ),
961 aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
962 aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ),
963 pAnyRefDlg( _pDlg ),
964 pRefEdit( pEdit )
966 SetStartImage();
969 void RefButton::SetStartImage()
971 SetModeImage( aImgRefStart );
974 void RefButton::SetEndImage()
976 SetModeImage( aImgRefDone );
979 void RefButton::SetReferences( IControlReferenceHandler* pDlg, RefEdit* pEdit )
981 pAnyRefDlg = pDlg;
982 pRefEdit = pEdit;
985 //----------------------------------------------------------------------------
987 void RefButton::Click()
989 if( pAnyRefDlg )
990 pAnyRefDlg->ToggleCollapsed( pRefEdit, this );
993 void RefButton::KeyInput( const KeyEvent& rKEvt )
995 const KeyCode& rKeyCode = rKEvt.GetKeyCode();
996 if( pAnyRefDlg && !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
997 pAnyRefDlg->ReleaseFocus( pRefEdit );
998 else
999 ImageButton::KeyInput( rKEvt );
1002 void RefButton::GetFocus()
1004 ImageButton::GetFocus();
1005 if( pRefEdit )
1006 pRefEdit->StartUpdateData();
1009 void RefButton::LoseFocus()
1011 ImageButton::LoseFocus();
1012 if( pRefEdit )
1013 pRefEdit->Modify();
1017 } // formula
1019 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */