xref: /aoo41x/main/sc/source/ui/inc/parawin.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_PARAWIN_HXX
25cdf0e10cSrcweir #define SC_PARAWIN_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "funcutl.hxx"
28cdf0e10cSrcweir #include "global.hxx"		// ScAddress
29cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
30cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
31cdf0e10cSrcweir #include <vcl/lstbox.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <vcl/group.hxx>
34cdf0e10cSrcweir #include <svtools/svmedit.hxx>
35cdf0e10cSrcweir #include <vcl/tabpage.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #ifndef _SVSTDARR_STRINGS
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #define _SVSTDARR_STRINGS
40cdf0e10cSrcweir #include <svl/svstdarr.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir #include <vcl/tabctrl.hxx>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir #include <vector>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class ScFuncDesc;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir //============================================================================
50cdf0e10cSrcweir #define	NOT_FOUND 0xffff
51cdf0e10cSrcweir //============================================================================
52cdf0e10cSrcweir 
53cdf0e10cSrcweir class ScParaWin : public TabPage
54cdf0e10cSrcweir {
55cdf0e10cSrcweir private:
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 		Link			aScrollLink;
58cdf0e10cSrcweir 		Link			aFxLink;
59cdf0e10cSrcweir 		Link			aArgModifiedLink;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir         ::std::vector<sal_uInt16>   aVisibleArgMapping;
62cdf0e10cSrcweir 		const ScFuncDesc*	pFuncDesc;
63cdf0e10cSrcweir 		ScAnyRefDlg*	pMyParent;
64cdf0e10cSrcweir 		sal_uInt16			nArgs;      // unsuppressed arguments
65cdf0e10cSrcweir 		Font			aFntBold;
66cdf0e10cSrcweir 		Font			aFntLight;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 		FixedInfo		aFtEditDesc;
69cdf0e10cSrcweir 		FixedText		aFtArgName;
70cdf0e10cSrcweir 		FixedInfo		aFtArgDesc;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 		ImageButton		aBtnFx1;
73cdf0e10cSrcweir 		FixedText		aFtArg1;
74cdf0e10cSrcweir 		ArgEdit			aEdArg1;
75cdf0e10cSrcweir 		formula::RefButton		aRefBtn1;
76cdf0e10cSrcweir 		ImageButton		aBtnFx2;
77cdf0e10cSrcweir 		FixedText		aFtArg2;
78cdf0e10cSrcweir 		ArgEdit			aEdArg2;
79cdf0e10cSrcweir 		formula::RefButton		aRefBtn2;
80cdf0e10cSrcweir 		ImageButton		aBtnFx3;
81cdf0e10cSrcweir 		FixedText		aFtArg3;
82cdf0e10cSrcweir 		ArgEdit			aEdArg3;
83cdf0e10cSrcweir 		formula::RefButton		aRefBtn3;
84cdf0e10cSrcweir 		ImageButton		aBtnFx4;
85cdf0e10cSrcweir 		FixedText		aFtArg4;
86cdf0e10cSrcweir 		ArgEdit			aEdArg4;
87cdf0e10cSrcweir 		formula::RefButton		aRefBtn4;
88cdf0e10cSrcweir 		ScrollBar		aSlider;
89cdf0e10cSrcweir 		sal_Bool			bRefMode;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 		sal_uInt16			nEdFocus;
92cdf0e10cSrcweir 		sal_uInt16			nActiveLine;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 		ArgInput		aArgInput[4];
95cdf0e10cSrcweir 		String			aDefaultString;
96cdf0e10cSrcweir 		SvStrings		aParaArray;
97cdf0e10cSrcweir 		DECL_LINK( ScrollHdl, ScrollBar* );
98cdf0e10cSrcweir 		DECL_LINK( ModifyHdl, ArgInput* );
99cdf0e10cSrcweir 		DECL_LINK( GetEdFocusHdl, ArgInput* );
100cdf0e10cSrcweir 		DECL_LINK( GetFxFocusHdl, ArgInput* );
101cdf0e10cSrcweir 		DECL_LINK( GetFxHdl, ArgInput* );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir protected:
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 		virtual void	SliderMoved();
106cdf0e10cSrcweir 		virtual void	ArgumentModified();
107cdf0e10cSrcweir 		virtual void	FxClick();
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 		void			InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
110cdf0e10cSrcweir 										ArgEdit& rEdArg, formula::RefButton& rRefBtn);
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 		void			DelParaArray();
113cdf0e10cSrcweir 		void			SetArgumentDesc(const String& aText);
114cdf0e10cSrcweir 		void			SetArgumentText(const String& aText);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 		void			SetArgName		(sal_uInt16 no,const String &aArg);
118cdf0e10cSrcweir 		void			SetArgNameFont	(sal_uInt16 no,const Font&);
119cdf0e10cSrcweir 		void			SetArgVal		(sal_uInt16 no,const String &aArg);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 		void			HideParaLine(sal_uInt16 no);
122cdf0e10cSrcweir 		void			ShowParaLine(sal_uInt16 no);
123cdf0e10cSrcweir 		void			UpdateArgDesc( sal_uInt16 nArg );
124cdf0e10cSrcweir 		void			UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
125cdf0e10cSrcweir 
126cdf0e10cSrcweir public:
127cdf0e10cSrcweir 						ScParaWin(ScAnyRefDlg* pParent,Point aPos);
128cdf0e10cSrcweir 						~ScParaWin();
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 		void			SetFunctionDesc(const ScFuncDesc* pFDesc);
131cdf0e10cSrcweir 		void			SetArgumentOffset(sal_uInt16 nOffset);
132cdf0e10cSrcweir 		void	    	SetEditDesc(const String& aText);
133cdf0e10cSrcweir 		void			UpdateParas();
134cdf0e10cSrcweir 		void			ClearAll();
135cdf0e10cSrcweir 
IsRefMode()136cdf0e10cSrcweir 		sal_Bool			IsRefMode() {return bRefMode;}
SetRefMode(sal_Bool bFlag)137cdf0e10cSrcweir 		void			SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;}
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 		sal_uInt16	    	GetActiveLine();
140cdf0e10cSrcweir 		void			SetActiveLine(sal_uInt16 no);
141cdf0e10cSrcweir 		formula::RefEdit*		GetActiveEdit();
142cdf0e10cSrcweir 		String			GetActiveArgName();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 		String			GetArgument(sal_uInt16 no);
145cdf0e10cSrcweir 		void			SetArgument(sal_uInt16 no, const String& aString);
146cdf0e10cSrcweir 		void			SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont);
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 		void			SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen
149cdf0e10cSrcweir 		sal_uInt16			GetSliderPos();
150cdf0e10cSrcweir 		void			SetSliderPos(sal_uInt16 nSliderPos);
151cdf0e10cSrcweir 
SetScrollHdl(const Link & rLink)152cdf0e10cSrcweir 		void            SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; }
GetScrollHdl() const153cdf0e10cSrcweir 		const Link&     GetScrollHdl() const { return aScrollLink; }
154cdf0e10cSrcweir 
SetArgModifiedHdl(const Link & rLink)155cdf0e10cSrcweir 		void            SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; }
GetArgModifiedHdl() const156cdf0e10cSrcweir 		const Link&     GetArgModifiedHdl() const { return aArgModifiedLink; }
157cdf0e10cSrcweir 
SetFxHdl(const Link & rLink)158cdf0e10cSrcweir 		void            SetFxHdl( const Link& rLink ) { aFxLink = rLink; }
GetFxHdl() const159cdf0e10cSrcweir 		const Link&     GetFxHdl() const { return aFxLink; }
160cdf0e10cSrcweir };
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 
166cdf0e10cSrcweir #endif // SC_PARAWIN_HXX
167cdf0e10cSrcweir 
168