1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: funcutl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef FORMULA_CONTROL_HELPER_HXX_INCLUDED
31 #define FORMULA_CONTROL_HELPER_HXX_INCLUDED
33 #include "formula/funcutl.hxx"
34 #include <svtools/svmedit.hxx>
38 //============================================================================
40 class ValWnd
: public Window
43 ValWnd( Window
* pParent
, const ResId
& rId
);
45 void SetValue( const String
& rStrVal
);
48 virtual void Paint( const Rectangle
& rRect
);
55 //============================================================================
57 class EditBox
: public Control
61 MultiLineEdit
* pMEdit
;
65 DECL_LINK( ChangedHdl
, EditBox
* );
69 virtual long PreNotify( NotifyEvent
& rNEvt
);
70 virtual void SelectionChanged();
71 virtual void Resize();
72 virtual void GetFocus();
76 EditBox( Window
* pParent
,
77 WinBits nWinStyle
= WB_LEFT
| WB_BORDER
);
78 EditBox( Window
* pParent
, const ResId
& rResId
);
82 MultiLineEdit
* GetEdit() {return pMEdit
;}
84 void SetSelChangedHdl( const Link
& rLink
) { aSelChangedLink
= rLink
; }
85 const Link
& GetSelChangedHdl() const { return aSelChangedLink
; }
90 //============================================================================
93 class ArgEdit
: public RefEdit
96 ArgEdit( Window
* pParent
, const ResId
& rResId
);
98 void Init( ArgEdit
* pPrevEdit
, ArgEdit
* pNextEdit
,
99 ScrollBar
& rArgSlider
, USHORT nArgCount
);
102 virtual void KeyInput( const KeyEvent
& rKEvt
);
112 //============================================================================
131 DECL_LINK( FxBtnClickHdl
, ImageButton
* );
132 DECL_LINK( RefBtnClickHdl
,RefButton
* );
133 DECL_LINK( FxBtnFocusHdl
, ImageButton
* );
134 DECL_LINK( RefBtnFocusHdl
,RefButton
* );
135 DECL_LINK( EdFocusHdl
, ArgEdit
* );
136 DECL_LINK( EdModifyHdl
,ArgEdit
* );
140 virtual void FxClick();
141 virtual void RefClick();
142 virtual void FxFocus();
143 virtual void RefFocus();
144 virtual void EdFocus();
145 virtual void EdModify();
151 void InitArgInput ( FixedText
* pftArg
,
156 void SetArgName(const String
&aArg
);
158 void SetArgNameFont(const Font
&);
160 void SetArgVal(const String
&aVal
);
163 void SetArgSelection (const Selection
& rSel
);
164 void ReplaceSelOfArg (const String
& rStr
);
166 Selection
GetArgSelection();
169 ArgEdit
* GetArgEdPtr() {return pEdArg
;}
172 void SetFxClickHdl( const Link
& rLink
) { aFxClickLink
= rLink
; }
173 const Link
& GetFxClickHdl() const { return aFxClickLink
; }
175 void SetRefClickHdl( const Link
& rLink
) { aRefClickLink
= rLink
; }
176 const Link
& GetRefClickHdl() const { return aRefClickLink
; }
178 void SetFxFocusHdl( const Link
& rLink
) { aFxFocusLink
= rLink
; }
179 const Link
& GetFxFocusHdl() const { return aFxFocusLink
; }
181 void SetRefFocusHdl( const Link
& rLink
) { aRefFocusLink
= rLink
; }
182 const Link
& GetRefFocusHdl() const { return aRefFocusLink
; }
184 void SetEdFocusHdl( const Link
& rLink
) { aEdFocusLink
= rLink
; }
185 const Link
& GetEdFocusHdl() const { return aEdFocusLink
; }
187 void SetEdModifyHdl( const Link
& rLink
) { aEdModifyLink
= rLink
; }
188 const Link
& GetEdModifyHdl() const { return aEdModifyLink
; }
196 #endif // FORMULA_FORMULA_HELPER_HXX_INCLUDED