xref: /trunk/main/sc/source/ui/inc/parawin.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_PARAWIN_HXX
25 #define SC_PARAWIN_HXX
26 
27 #include "funcutl.hxx"
28 #include "global.hxx"		// ScAddress
29 #include <svtools/stdctrl.hxx>
30 #ifndef _LSTBOX_HXX //autogen
31 #include <vcl/lstbox.hxx>
32 #endif
33 #include <vcl/group.hxx>
34 #include <svtools/svmedit.hxx>
35 #include <vcl/tabpage.hxx>
36 
37 #ifndef _SVSTDARR_STRINGS
38 
39 #define _SVSTDARR_STRINGS
40 #include <svl/svstdarr.hxx>
41 
42 #endif
43 #include <vcl/tabctrl.hxx>
44 
45 #include <vector>
46 
47 class ScFuncDesc;
48 
49 //============================================================================
50 #define	NOT_FOUND 0xffff
51 //============================================================================
52 
53 class ScParaWin : public TabPage
54 {
55 private:
56 
57 		Link			aScrollLink;
58 		Link			aFxLink;
59 		Link			aArgModifiedLink;
60 
61         ::std::vector<sal_uInt16>   aVisibleArgMapping;
62 		const ScFuncDesc*	pFuncDesc;
63 		ScAnyRefDlg*	pMyParent;
64 		sal_uInt16			nArgs;      // unsuppressed arguments
65 		Font			aFntBold;
66 		Font			aFntLight;
67 
68 		FixedInfo		aFtEditDesc;
69 		FixedText		aFtArgName;
70 		FixedInfo		aFtArgDesc;
71 
72 		ImageButton		aBtnFx1;
73 		FixedText		aFtArg1;
74 		ArgEdit			aEdArg1;
75 		formula::RefButton		aRefBtn1;
76 		ImageButton		aBtnFx2;
77 		FixedText		aFtArg2;
78 		ArgEdit			aEdArg2;
79 		formula::RefButton		aRefBtn2;
80 		ImageButton		aBtnFx3;
81 		FixedText		aFtArg3;
82 		ArgEdit			aEdArg3;
83 		formula::RefButton		aRefBtn3;
84 		ImageButton		aBtnFx4;
85 		FixedText		aFtArg4;
86 		ArgEdit			aEdArg4;
87 		formula::RefButton		aRefBtn4;
88 		ScrollBar		aSlider;
89 		sal_Bool			bRefMode;
90 
91 		sal_uInt16			nEdFocus;
92 		sal_uInt16			nActiveLine;
93 
94 		ArgInput		aArgInput[4];
95 		String			aDefaultString;
96 		SvStrings		aParaArray;
97 		DECL_LINK( ScrollHdl, ScrollBar* );
98 		DECL_LINK( ModifyHdl, ArgInput* );
99 		DECL_LINK( GetEdFocusHdl, ArgInput* );
100 		DECL_LINK( GetFxFocusHdl, ArgInput* );
101 		DECL_LINK( GetFxHdl, ArgInput* );
102 
103 protected:
104 
105 		virtual void	SliderMoved();
106 		virtual void	ArgumentModified();
107 		virtual void	FxClick();
108 
109 		void			InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
110 										ArgEdit& rEdArg, formula::RefButton& rRefBtn);
111 
112 		void			DelParaArray();
113 		void			SetArgumentDesc(const String& aText);
114 		void			SetArgumentText(const String& aText);
115 
116 
117 		void			SetArgName		(sal_uInt16 no,const String &aArg);
118 		void			SetArgNameFont	(sal_uInt16 no,const Font&);
119 		void			SetArgVal		(sal_uInt16 no,const String &aArg);
120 
121 		void			HideParaLine(sal_uInt16 no);
122 		void			ShowParaLine(sal_uInt16 no);
123 		void			UpdateArgDesc( sal_uInt16 nArg );
124 		void			UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
125 
126 public:
127 						ScParaWin(ScAnyRefDlg* pParent,Point aPos);
128 						~ScParaWin();
129 
130 		void			SetFunctionDesc(const ScFuncDesc* pFDesc);
131 		void			SetArgumentOffset(sal_uInt16 nOffset);
132 		void	    	SetEditDesc(const String& aText);
133 		void			UpdateParas();
134 		void			ClearAll();
135 
IsRefMode()136 		sal_Bool			IsRefMode() {return bRefMode;}
SetRefMode(sal_Bool bFlag)137 		void			SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;}
138 
139 		sal_uInt16	    	GetActiveLine();
140 		void			SetActiveLine(sal_uInt16 no);
141 		formula::RefEdit*		GetActiveEdit();
142 		String			GetActiveArgName();
143 
144 		String			GetArgument(sal_uInt16 no);
145 		void			SetArgument(sal_uInt16 no, const String& aString);
146 		void			SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont);
147 
148 		void			SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen
149 		sal_uInt16			GetSliderPos();
150 		void			SetSliderPos(sal_uInt16 nSliderPos);
151 
SetScrollHdl(const Link & rLink)152 		void            SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; }
GetScrollHdl() const153 		const Link&     GetScrollHdl() const { return aScrollLink; }
154 
SetArgModifiedHdl(const Link & rLink)155 		void            SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; }
GetArgModifiedHdl() const156 		const Link&     GetArgModifiedHdl() const { return aArgModifiedLink; }
157 
SetFxHdl(const Link & rLink)158 		void            SetFxHdl( const Link& rLink ) { aFxLink = rLink; }
GetFxHdl() const159 		const Link&     GetFxHdl() const { return aFxLink; }
160 };
161 
162 
163 
164 
165 
166 #endif // SC_PARAWIN_HXX
167 
168