xref: /aoo42x/main/sc/source/ui/inc/funcutl.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_FUNCUTL_HXX
25cdf0e10cSrcweir #define SC_FUNCUTL_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _SCRBAR_HXX //autogen
28cdf0e10cSrcweir #include <vcl/scrbar.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
31cdf0e10cSrcweir #include <vcl/fixed.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <svtools/svmedit.hxx>
34cdf0e10cSrcweir #include "anyrefdg.hxx"		// formula::RefButton
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //============================================================================
38cdf0e10cSrcweir // class ValWnd
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class ValWnd : public Window
41cdf0e10cSrcweir {
42cdf0e10cSrcweir public:
43cdf0e10cSrcweir 			ValWnd( Window* pParent, const ResId& rId );
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 	void	SetValue( const String& rStrVal );
46cdf0e10cSrcweir 
47cdf0e10cSrcweir protected:
48cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir private:
51cdf0e10cSrcweir 	String		aStrValue;
52cdf0e10cSrcweir 	Rectangle	aRectOut;
53cdf0e10cSrcweir };
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 
56cdf0e10cSrcweir //============================================================================
57cdf0e10cSrcweir // class ScEditBox
58cdf0e10cSrcweir 
59cdf0e10cSrcweir class ScEditBox : public Control
60cdf0e10cSrcweir {
61cdf0e10cSrcweir private:
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	MultiLineEdit*	pMEdit;
64cdf0e10cSrcweir 	Link			aSelChangedLink;
65cdf0e10cSrcweir 	Selection		aOldSel;
66cdf0e10cSrcweir 	sal_Bool			bMouseFlag;
67cdf0e10cSrcweir 					DECL_LINK( ChangedHdl, ScEditBox* );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir protected:
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	virtual long	PreNotify( NotifyEvent& rNEvt );
72cdf0e10cSrcweir 	virtual void	SelectionChanged();
73cdf0e10cSrcweir 	virtual void	Resize();
74cdf0e10cSrcweir 	virtual void	GetFocus();
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 
77cdf0e10cSrcweir public:
78cdf0e10cSrcweir 					ScEditBox( Window* pParent, const ResId& rResId );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 					~ScEditBox();
81cdf0e10cSrcweir 
GetEdit()82cdf0e10cSrcweir 	MultiLineEdit*	GetEdit() {return pMEdit;}
83cdf0e10cSrcweir 
SetSelChangedHdl(const Link & rLink)84cdf0e10cSrcweir 	void            SetSelChangedHdl( const Link& rLink ) { aSelChangedLink = rLink; }
GetSelChangedHdl() const85cdf0e10cSrcweir 	const Link&     GetSelChangedHdl() const { return aSelChangedLink; }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	void			UpdateOldSel();
88cdf0e10cSrcweir };
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 
92cdf0e10cSrcweir //============================================================================
93cdf0e10cSrcweir // class ArgEdit
94cdf0e10cSrcweir 
95cdf0e10cSrcweir class ArgEdit : public formula::RefEdit
96cdf0e10cSrcweir {
97cdf0e10cSrcweir public:
98cdf0e10cSrcweir 			ArgEdit( Window* pParent, const ResId& rResId );
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	void	Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
101cdf0e10cSrcweir 				  ScrollBar& rArgSlider, sal_uInt16 nArgCount );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir protected:
104cdf0e10cSrcweir 	virtual void	KeyInput( const KeyEvent& rKEvt );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir private:
107cdf0e10cSrcweir 	ArgEdit*	pEdPrev;
108cdf0e10cSrcweir 	ArgEdit*	pEdNext;
109cdf0e10cSrcweir 	ScrollBar*	pSlider;
110cdf0e10cSrcweir 	sal_uInt16		nArgs;
111cdf0e10cSrcweir };
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 
114cdf0e10cSrcweir //============================================================================
115cdf0e10cSrcweir // class ArgInput
116cdf0e10cSrcweir 
117cdf0e10cSrcweir class ArgInput
118cdf0e10cSrcweir {
119cdf0e10cSrcweir private:
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	Link			aFxClickLink;
122cdf0e10cSrcweir 	Link			aRefClickLink;
123cdf0e10cSrcweir 	Link			aFxFocusLink;
124cdf0e10cSrcweir 	Link			aRefFocusLink;
125cdf0e10cSrcweir 	Link			aEdFocusLink;
126cdf0e10cSrcweir 	Link			aEdModifyLink;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	FixedText*		pFtArg;
129cdf0e10cSrcweir 	ImageButton*	pBtnFx;
130cdf0e10cSrcweir 	ArgEdit*		pEdArg;
131cdf0e10cSrcweir 	formula::RefButton*	pRefBtn;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	DECL_LINK(	FxBtnClickHdl, ImageButton* );
134cdf0e10cSrcweir 	DECL_LINK(	RefBtnClickHdl,formula::RefButton* );
135cdf0e10cSrcweir 	DECL_LINK(	FxBtnFocusHdl, ImageButton* );
136cdf0e10cSrcweir 	DECL_LINK(	RefBtnFocusHdl,formula::RefButton* );
137cdf0e10cSrcweir 	DECL_LINK(	EdFocusHdl, ArgEdit* );
138cdf0e10cSrcweir 	DECL_LINK(	EdModifyHdl,ArgEdit* );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir protected:
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	virtual void	FxClick();
143cdf0e10cSrcweir 	virtual void	RefClick();
144cdf0e10cSrcweir 	virtual void	FxFocus();
145cdf0e10cSrcweir 	virtual void	RefFocus();
146cdf0e10cSrcweir 	virtual void	EdFocus();
147cdf0e10cSrcweir 	virtual void	EdModify();
148cdf0e10cSrcweir 
149cdf0e10cSrcweir public:
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 	ArgInput();
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	void		InitArgInput (	FixedText*		pftArg,
154cdf0e10cSrcweir 								ImageButton*	pbtnFx,
155cdf0e10cSrcweir 								ArgEdit*		pedArg,
156cdf0e10cSrcweir 								formula::RefButton*	prefBtn);
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 	void		SetArgName(const String &aArg);
159cdf0e10cSrcweir 	String		GetArgName();
160cdf0e10cSrcweir 	void		SetArgNameFont(const Font&);
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	void		SetArgVal(const String &aVal);
163cdf0e10cSrcweir 	String		GetArgVal();
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 	void		SetArgSelection	(const Selection& rSel );
166cdf0e10cSrcweir 
GetArgEdPtr()167cdf0e10cSrcweir 	ArgEdit*	GetArgEdPtr() {return pEdArg;}
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 
SetFxClickHdl(const Link & rLink)170cdf0e10cSrcweir 	void            SetFxClickHdl( const Link& rLink ) { aFxClickLink = rLink; }
GetFxClickHdl() const171cdf0e10cSrcweir 	const Link&     GetFxClickHdl() const { return aFxClickLink; }
172cdf0e10cSrcweir 
SetRefClickHdl(const Link & rLink)173cdf0e10cSrcweir 	void            SetRefClickHdl( const Link& rLink ) { aRefClickLink = rLink; }
GetRefClickHdl() const174cdf0e10cSrcweir 	const Link&     GetRefClickHdl() const { return aRefClickLink; }
175cdf0e10cSrcweir 
SetFxFocusHdl(const Link & rLink)176cdf0e10cSrcweir 	void            SetFxFocusHdl( const Link& rLink ) { aFxFocusLink = rLink; }
GetFxFocusHdl() const177cdf0e10cSrcweir 	const Link&     GetFxFocusHdl() const { return aFxFocusLink; }
178cdf0e10cSrcweir 
SetRefFocusHdl(const Link & rLink)179cdf0e10cSrcweir 	void            SetRefFocusHdl( const Link& rLink ) { aRefFocusLink = rLink; }
GetRefFocusHdl() const180cdf0e10cSrcweir 	const Link&     GetRefFocusHdl() const { return aRefFocusLink; }
181cdf0e10cSrcweir 
SetEdFocusHdl(const Link & rLink)182cdf0e10cSrcweir 	void            SetEdFocusHdl( const Link& rLink ) { aEdFocusLink = rLink; }
GetEdFocusHdl() const183cdf0e10cSrcweir 	const Link&     GetEdFocusHdl() const { return aEdFocusLink; }
184cdf0e10cSrcweir 
SetEdModifyHdl(const Link & rLink)185cdf0e10cSrcweir 	void            SetEdModifyHdl( const Link& rLink ) { aEdModifyLink = rLink; }
GetEdModifyHdl() const186cdf0e10cSrcweir 	const Link&     GetEdModifyHdl() const { return aEdModifyLink; }
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	void Hide();
189cdf0e10cSrcweir 	void Show();
190cdf0e10cSrcweir 
191cdf0e10cSrcweir };
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 
194cdf0e10cSrcweir #endif
195