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