update dev300-m58
[ooovba.git] / sc / source / ui / inc / funcutl.hxx
blob3202b30b275217ee90b79dda76992a819aaa75b5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: funcutl.hxx,v $
10 * $Revision: 1.5.32.2 $
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 ************************************************************************/
31 #ifndef SC_FUNCUTL_HXX
32 #define SC_FUNCUTL_HXX
34 #ifndef _SCRBAR_HXX //autogen
35 #include <vcl/scrbar.hxx>
36 #endif
37 #ifndef _FIXED_HXX //autogen
38 #include <vcl/fixed.hxx>
39 #endif
40 #include <svtools/svmedit.hxx>
41 #include "anyrefdg.hxx" // formula::RefButton
44 //============================================================================
45 // class ValWnd
47 class ValWnd : public Window
49 public:
50 ValWnd( Window* pParent, const ResId& rId );
52 void SetValue( const String& rStrVal );
54 protected:
55 virtual void Paint( const Rectangle& rRect );
57 private:
58 String aStrValue;
59 Rectangle aRectOut;
63 //============================================================================
64 // class ScEditBox
66 class ScEditBox : public Control
68 private:
70 MultiLineEdit* pMEdit;
71 Link aSelChangedLink;
72 Selection aOldSel;
73 BOOL bMouseFlag;
74 DECL_LINK( ChangedHdl, ScEditBox* );
76 protected:
78 virtual long PreNotify( NotifyEvent& rNEvt );
79 virtual void SelectionChanged();
80 virtual void Resize();
81 virtual void GetFocus();
84 public:
85 ScEditBox( Window* pParent, const ResId& rResId );
87 ~ScEditBox();
89 MultiLineEdit* GetEdit() {return pMEdit;}
91 void SetSelChangedHdl( const Link& rLink ) { aSelChangedLink = rLink; }
92 const Link& GetSelChangedHdl() const { return aSelChangedLink; }
94 void UpdateOldSel();
99 //============================================================================
100 // class ArgEdit
102 class ArgEdit : public formula::RefEdit
104 public:
105 ArgEdit( Window* pParent, const ResId& rResId );
107 void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
108 ScrollBar& rArgSlider, USHORT nArgCount );
110 protected:
111 virtual void KeyInput( const KeyEvent& rKEvt );
113 private:
114 ArgEdit* pEdPrev;
115 ArgEdit* pEdNext;
116 ScrollBar* pSlider;
117 USHORT nArgs;
121 //============================================================================
122 // class ArgInput
124 class ArgInput
126 private:
128 Link aFxClickLink;
129 Link aRefClickLink;
130 Link aFxFocusLink;
131 Link aRefFocusLink;
132 Link aEdFocusLink;
133 Link aEdModifyLink;
135 FixedText* pFtArg;
136 ImageButton* pBtnFx;
137 ArgEdit* pEdArg;
138 formula::RefButton* pRefBtn;
140 DECL_LINK( FxBtnClickHdl, ImageButton* );
141 DECL_LINK( RefBtnClickHdl,formula::RefButton* );
142 DECL_LINK( FxBtnFocusHdl, ImageButton* );
143 DECL_LINK( RefBtnFocusHdl,formula::RefButton* );
144 DECL_LINK( EdFocusHdl, ArgEdit* );
145 DECL_LINK( EdModifyHdl,ArgEdit* );
147 protected:
149 virtual void FxClick();
150 virtual void RefClick();
151 virtual void FxFocus();
152 virtual void RefFocus();
153 virtual void EdFocus();
154 virtual void EdModify();
156 public:
158 ArgInput();
160 void InitArgInput ( FixedText* pftArg,
161 ImageButton* pbtnFx,
162 ArgEdit* pedArg,
163 formula::RefButton* prefBtn);
165 void SetArgName(const String &aArg);
166 String GetArgName();
167 void SetArgNameFont(const Font&);
169 void SetArgVal(const String &aVal);
170 String GetArgVal();
172 void SetArgSelection (const Selection& rSel );
174 ArgEdit* GetArgEdPtr() {return pEdArg;}
177 void SetFxClickHdl( const Link& rLink ) { aFxClickLink = rLink; }
178 const Link& GetFxClickHdl() const { return aFxClickLink; }
180 void SetRefClickHdl( const Link& rLink ) { aRefClickLink = rLink; }
181 const Link& GetRefClickHdl() const { return aRefClickLink; }
183 void SetFxFocusHdl( const Link& rLink ) { aFxFocusLink = rLink; }
184 const Link& GetFxFocusHdl() const { return aFxFocusLink; }
186 void SetRefFocusHdl( const Link& rLink ) { aRefFocusLink = rLink; }
187 const Link& GetRefFocusHdl() const { return aRefFocusLink; }
189 void SetEdFocusHdl( const Link& rLink ) { aEdFocusLink = rLink; }
190 const Link& GetEdFocusHdl() const { return aEdFocusLink; }
192 void SetEdModifyHdl( const Link& rLink ) { aEdModifyLink = rLink; }
193 const Link& GetEdModifyHdl() const { return aEdModifyLink; }
195 void Hide();
196 void Show();
201 #endif