xref: /AOO41X/main/svtools/source/dialogs/property.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svtools.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #ifndef GCC
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir //------------------------------------------------------------------
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir //#include "Svitems.hxx"
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #include "property.hxx"
40*cdf0e10cSrcweir /*
41*cdf0e10cSrcweir #include "property.hrc"
42*cdf0e10cSrcweir #include "Scresid.hxx"
43*cdf0e10cSrcweir */
44*cdf0e10cSrcweir #define FRAME_OFFSET 4
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir SvXPropertyControl::SvXPropertyControl( Window* pParent, WinBits nWinStyle)
48*cdf0e10cSrcweir 			:	Control(pParent,nWinStyle)
49*cdf0e10cSrcweir {
50*cdf0e10cSrcweir }
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir SvXPropertyControl::SvXPropertyControl( Window* pParent, const ResId& rResId )
53*cdf0e10cSrcweir 			:	Control(pParent,rResId )
54*cdf0e10cSrcweir {
55*cdf0e10cSrcweir }
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir //------------------------------------------------------------------
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir SvXPropertyEdit::SvXPropertyEdit( Window* pParent, WinBits nWinStyle)
60*cdf0e10cSrcweir 		:		SvXPropertyControl(pParent,nWinStyle),
61*cdf0e10cSrcweir 				aEdit(this,WB_BORDER | WB_TABSTOP)
62*cdf0e10cSrcweir {
63*cdf0e10cSrcweir 	pListener=NULL;
64*cdf0e10cSrcweir 	aEdit.SetModifyHdl(
65*cdf0e10cSrcweir 		LINK( this, SvXPropertyEdit, ModifiedHdl ));
66*cdf0e10cSrcweir 	aEdit.SetGetFocusHdl(
67*cdf0e10cSrcweir 		LINK( this, SvXPropertyEdit, GetFocusHdl));
68*cdf0e10cSrcweir 	aEdit.SetLoseFocusHdl(
69*cdf0e10cSrcweir 		LINK( this, SvXPropertyEdit, LoseFocusHdl));
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir 	aEdit.Show();
72*cdf0e10cSrcweir }
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir SvXPropertyEdit::SvXPropertyEdit( Window* pParent, const ResId& rResId)
75*cdf0e10cSrcweir 		:		SvXPropertyControl(pParent,rResId),
76*cdf0e10cSrcweir 				aEdit(this,WB_BORDER | WB_TABSTOP)
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir 	pListener=NULL;
79*cdf0e10cSrcweir 	aEdit.SetModifyHdl(
80*cdf0e10cSrcweir 		LINK( this, SvXPropertyEdit, ModifiedHdl ));
81*cdf0e10cSrcweir 	aEdit.SetGetFocusHdl(
82*cdf0e10cSrcweir 		LINK( this, SvXPropertyEdit, GetFocusHdl));
83*cdf0e10cSrcweir 	aEdit.SetLoseFocusHdl(
84*cdf0e10cSrcweir 		LINK( this, SvXPropertyEdit, LoseFocusHdl));
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	Size aSize=GetSizePixel();
87*cdf0e10cSrcweir 	SetCtrSize(aSize);
88*cdf0e10cSrcweir 	aEdit.Show();
89*cdf0e10cSrcweir }
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir void SvXPropertyEdit::SetSvXPropertyCtrListener(SvXPropertyCtrListener* pCtrListener)
92*cdf0e10cSrcweir {
93*cdf0e10cSrcweir 	pListener=pCtrListener;
94*cdf0e10cSrcweir }
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir SvXPropertyCtrListener* SvXPropertyEdit::GetSvXPropertyCtrListener()
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir 	return pListener;
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir void SvXPropertyEdit::SetCtrSize(const Size& rSize)
103*cdf0e10cSrcweir {
104*cdf0e10cSrcweir 	SetSizePixel(rSize);
105*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
106*cdf0e10cSrcweir 	Point aPos(0,0);
107*cdf0e10cSrcweir 	aEdit.SetPosPixel(aPos);
108*cdf0e10cSrcweir 	aEdit.SetSizePixel(aSize);
109*cdf0e10cSrcweir }
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir void SvXPropertyEdit::SetLocked(sal_Bool bLocked)
112*cdf0e10cSrcweir {
113*cdf0e10cSrcweir 	if(bLocked)
114*cdf0e10cSrcweir 		Disable();
115*cdf0e10cSrcweir 	else
116*cdf0e10cSrcweir 		Enable();
117*cdf0e10cSrcweir }
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir void SvXPropertyEdit::SetProperty(const String &rString)
120*cdf0e10cSrcweir {
121*cdf0e10cSrcweir 	aEdit.SetText(rString);
122*cdf0e10cSrcweir }
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir String SvXPropertyEdit::GetProperty() const
125*cdf0e10cSrcweir {
126*cdf0e10cSrcweir 	return aEdit.GetText();
127*cdf0e10cSrcweir }
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir sal_Bool SvXPropertyEdit::HasList()
130*cdf0e10cSrcweir {
131*cdf0e10cSrcweir 	return sal_False;
132*cdf0e10cSrcweir };
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir void SvXPropertyEdit::ClearList()
136*cdf0e10cSrcweir {
137*cdf0e10cSrcweir 	return;
138*cdf0e10cSrcweir }
139*cdf0e10cSrcweir void SvXPropertyEdit::InsertEntry( const String&,sal_uInt16 )
140*cdf0e10cSrcweir {
141*cdf0e10cSrcweir 	return;
142*cdf0e10cSrcweir }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir void SvXPropertyEdit::SetMyName(const String &rString)
145*cdf0e10cSrcweir {
146*cdf0e10cSrcweir 	aName=rString;
147*cdf0e10cSrcweir }
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir String SvXPropertyEdit::GetMyName()const
150*cdf0e10cSrcweir {
151*cdf0e10cSrcweir 	return aName;
152*cdf0e10cSrcweir }
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir void SvXPropertyEdit::SetMyData(void* pDat)
155*cdf0e10cSrcweir {
156*cdf0e10cSrcweir 	pData=pDat;
157*cdf0e10cSrcweir }
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir void* SvXPropertyEdit::GetMyData()
160*cdf0e10cSrcweir {
161*cdf0e10cSrcweir 	return pData;
162*cdf0e10cSrcweir }
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir IMPL_LINK( SvXPropertyEdit, ModifiedHdl, Edit*, EMPTYARG )
166*cdf0e10cSrcweir {
167*cdf0e10cSrcweir 	if(pListener!=NULL)
168*cdf0e10cSrcweir 		pListener->Modified(this);
169*cdf0e10cSrcweir 	return 0;
170*cdf0e10cSrcweir }
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir IMPL_LINK( SvXPropertyEdit, GetFocusHdl, Edit*, EMPTYARG )
173*cdf0e10cSrcweir {
174*cdf0e10cSrcweir 	if(pListener!=NULL)
175*cdf0e10cSrcweir 		pListener->GetFocus(this);
176*cdf0e10cSrcweir 	return 0;
177*cdf0e10cSrcweir }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir IMPL_LINK( SvXPropertyEdit, LoseFocusHdl, Edit*, EMPTYARG )
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir 	if(pListener!=NULL)
182*cdf0e10cSrcweir 		pListener->LoseFocus(this);
183*cdf0e10cSrcweir 	return 0;
184*cdf0e10cSrcweir }
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir //------------------------------------------------------------------
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir SvXPropertyListBox::SvXPropertyListBox( Window* pParent, WinBits nWinStyle)
189*cdf0e10cSrcweir 		:		SvXPropertyControl(pParent,nWinStyle),
190*cdf0e10cSrcweir 				aListBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
191*cdf0e10cSrcweir {
192*cdf0e10cSrcweir 	pListener=NULL;
193*cdf0e10cSrcweir 	aListBox.SetSelectHdl(
194*cdf0e10cSrcweir 		LINK( this, SvXPropertyListBox, ModifiedHdl ));
195*cdf0e10cSrcweir 	aListBox.SetGetFocusHdl(
196*cdf0e10cSrcweir 		LINK( this, SvXPropertyListBox, GetFocusHdl));
197*cdf0e10cSrcweir 	aListBox.SetLoseFocusHdl(
198*cdf0e10cSrcweir 		LINK( this, SvXPropertyListBox, LoseFocusHdl));
199*cdf0e10cSrcweir 	aListBox.Show();
200*cdf0e10cSrcweir }
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir SvXPropertyListBox::SvXPropertyListBox( Window* pParent, const ResId& rResId)
203*cdf0e10cSrcweir 		:		SvXPropertyControl(pParent,rResId),
204*cdf0e10cSrcweir 				aListBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
205*cdf0e10cSrcweir {
206*cdf0e10cSrcweir 	pListener=NULL;
207*cdf0e10cSrcweir 	aListBox.SetSelectHdl(
208*cdf0e10cSrcweir 		LINK( this, SvXPropertyListBox, ModifiedHdl ));
209*cdf0e10cSrcweir 	aListBox.SetGetFocusHdl(
210*cdf0e10cSrcweir 		LINK( this, SvXPropertyListBox, GetFocusHdl));
211*cdf0e10cSrcweir 	aListBox.SetLoseFocusHdl(
212*cdf0e10cSrcweir 		LINK( this, SvXPropertyListBox, LoseFocusHdl));
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 	Size aSize=GetSizePixel();
215*cdf0e10cSrcweir 	SetCtrSize(aSize);
216*cdf0e10cSrcweir 	aListBox.Show();
217*cdf0e10cSrcweir }
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir void SvXPropertyListBox::SetSvXPropertyCtrListener(SvXPropertyCtrListener* pCtrListener)
220*cdf0e10cSrcweir {
221*cdf0e10cSrcweir 	pListener=pCtrListener;
222*cdf0e10cSrcweir }
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir SvXPropertyCtrListener* SvXPropertyListBox::GetSvXPropertyCtrListener()
225*cdf0e10cSrcweir {
226*cdf0e10cSrcweir 	return pListener;
227*cdf0e10cSrcweir }
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir void SvXPropertyListBox::SetCtrSize(const Size& rSize)
231*cdf0e10cSrcweir {
232*cdf0e10cSrcweir 	SetSizePixel(rSize);
233*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
234*cdf0e10cSrcweir 	Point aPos(0,0);
235*cdf0e10cSrcweir 	aListBox.SetPosPixel(aPos);
236*cdf0e10cSrcweir 	aListBox.SetSizePixel(aSize);
237*cdf0e10cSrcweir }
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir void SvXPropertyListBox::SetLocked(sal_Bool bLocked)
240*cdf0e10cSrcweir {
241*cdf0e10cSrcweir 	if(bLocked)
242*cdf0e10cSrcweir 		Disable();
243*cdf0e10cSrcweir 	else
244*cdf0e10cSrcweir 		Enable();
245*cdf0e10cSrcweir }
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir void SvXPropertyListBox::SetProperty(const String &rString)
248*cdf0e10cSrcweir {
249*cdf0e10cSrcweir 	aListBox.SelectEntry(rString);
250*cdf0e10cSrcweir }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir String SvXPropertyListBox::GetProperty()const
253*cdf0e10cSrcweir {
254*cdf0e10cSrcweir 	return aListBox.GetSelectEntry();
255*cdf0e10cSrcweir }
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir sal_Bool SvXPropertyListBox::HasList()
258*cdf0e10cSrcweir {
259*cdf0e10cSrcweir 	return sal_True;
260*cdf0e10cSrcweir }
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir void SvXPropertyListBox::ClearList()
264*cdf0e10cSrcweir {
265*cdf0e10cSrcweir 	aListBox.Clear();
266*cdf0e10cSrcweir }
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir void SvXPropertyListBox::InsertEntry( const String& rString,sal_uInt16 nPos)
269*cdf0e10cSrcweir {
270*cdf0e10cSrcweir 	aListBox.InsertEntry(rString,nPos);
271*cdf0e10cSrcweir }
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir void SvXPropertyListBox::SetMyName(const String &rString)
274*cdf0e10cSrcweir {
275*cdf0e10cSrcweir 	aName=rString;
276*cdf0e10cSrcweir }
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir String SvXPropertyListBox::GetMyName()const
279*cdf0e10cSrcweir {
280*cdf0e10cSrcweir 	return aName;
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir void SvXPropertyListBox::SetMyData(void* pDat)
284*cdf0e10cSrcweir {
285*cdf0e10cSrcweir 	pData=pDat;
286*cdf0e10cSrcweir }
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir void* SvXPropertyListBox::GetMyData()
289*cdf0e10cSrcweir {
290*cdf0e10cSrcweir 	return pData;
291*cdf0e10cSrcweir }
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir IMPL_LINK( SvXPropertyListBox, ModifiedHdl, ListBox*, EMPTYARG )
294*cdf0e10cSrcweir {
295*cdf0e10cSrcweir 	if(pListener!=NULL)
296*cdf0e10cSrcweir 		pListener->Modified(this);
297*cdf0e10cSrcweir 	return 0;
298*cdf0e10cSrcweir }
299*cdf0e10cSrcweir 
300*cdf0e10cSrcweir IMPL_LINK( SvXPropertyListBox, GetFocusHdl, ListBox*, EMPTYARG )
301*cdf0e10cSrcweir {
302*cdf0e10cSrcweir 	if(pListener!=NULL)
303*cdf0e10cSrcweir 		pListener->GetFocus(this);
304*cdf0e10cSrcweir 	return 0;
305*cdf0e10cSrcweir }
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir IMPL_LINK( SvXPropertyListBox, LoseFocusHdl, ListBox*, EMPTYARG )
308*cdf0e10cSrcweir {
309*cdf0e10cSrcweir 	if(pListener!=NULL)
310*cdf0e10cSrcweir 		pListener->LoseFocus(this);
311*cdf0e10cSrcweir 	return 0;
312*cdf0e10cSrcweir }
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir //------------------------------------------------------------------
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, WinBits nWinStyle)
318*cdf0e10cSrcweir 		:		SvXPropertyControl(pParent,nWinStyle),
319*cdf0e10cSrcweir 				aComboBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
320*cdf0e10cSrcweir {
321*cdf0e10cSrcweir 	pListener=NULL;
322*cdf0e10cSrcweir 	aComboBox.SetModifyHdl(
323*cdf0e10cSrcweir 		LINK( this, SvXPropertyComboBox, ModifiedHdl ));
324*cdf0e10cSrcweir 	aComboBox.SetGetFocusHdl(
325*cdf0e10cSrcweir 		LINK( this, SvXPropertyComboBox, GetFocusHdl));
326*cdf0e10cSrcweir 	aComboBox.SetLoseFocusHdl(
327*cdf0e10cSrcweir 		LINK( this, SvXPropertyComboBox, LoseFocusHdl));
328*cdf0e10cSrcweir 	aComboBox.Show();
329*cdf0e10cSrcweir }
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, const ResId& rResId)
332*cdf0e10cSrcweir 		:		SvXPropertyControl(pParent,rResId),
333*cdf0e10cSrcweir 				aComboBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
334*cdf0e10cSrcweir {
335*cdf0e10cSrcweir 	pListener=NULL;
336*cdf0e10cSrcweir 	aComboBox.SetModifyHdl(
337*cdf0e10cSrcweir 		LINK( this, SvXPropertyComboBox, ModifiedHdl ));
338*cdf0e10cSrcweir 	aComboBox.SetGetFocusHdl(
339*cdf0e10cSrcweir 		LINK( this, SvXPropertyComboBox, GetFocusHdl));
340*cdf0e10cSrcweir 	aComboBox.SetLoseFocusHdl(
341*cdf0e10cSrcweir 		LINK( this, SvXPropertyComboBox, LoseFocusHdl));
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir 	Size aSize=GetSizePixel();
344*cdf0e10cSrcweir 	SetCtrSize(aSize);
345*cdf0e10cSrcweir 	aComboBox.Show();
346*cdf0e10cSrcweir }
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir void SvXPropertyComboBox::SetLocked(sal_Bool bLocked)
349*cdf0e10cSrcweir {
350*cdf0e10cSrcweir 	if(bLocked)
351*cdf0e10cSrcweir 		Disable();
352*cdf0e10cSrcweir 	else
353*cdf0e10cSrcweir 		Enable();
354*cdf0e10cSrcweir }
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir void SvXPropertyComboBox::SetSvXPropertyCtrListener(SvXPropertyCtrListener* pCtrListener)
357*cdf0e10cSrcweir {
358*cdf0e10cSrcweir 	pListener=pCtrListener;
359*cdf0e10cSrcweir }
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir SvXPropertyCtrListener* SvXPropertyComboBox::GetSvXPropertyCtrListener()
362*cdf0e10cSrcweir {
363*cdf0e10cSrcweir 	return pListener;
364*cdf0e10cSrcweir }
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir void SvXPropertyComboBox::SetCtrSize(const Size& rSize)
368*cdf0e10cSrcweir {
369*cdf0e10cSrcweir 	SetSizePixel(rSize);
370*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
371*cdf0e10cSrcweir 	Point aPos(0,0);
372*cdf0e10cSrcweir 	aComboBox.SetPosPixel(aPos);
373*cdf0e10cSrcweir 	aComboBox.SetSizePixel(aSize);
374*cdf0e10cSrcweir }
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir void SvXPropertyComboBox::SetProperty(const String &rString)
378*cdf0e10cSrcweir {
379*cdf0e10cSrcweir 	aComboBox.SetText(rString);
380*cdf0e10cSrcweir }
381*cdf0e10cSrcweir 
382*cdf0e10cSrcweir String SvXPropertyComboBox::GetProperty()	const
383*cdf0e10cSrcweir {
384*cdf0e10cSrcweir 	return aComboBox.GetText();
385*cdf0e10cSrcweir }
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir sal_Bool SvXPropertyComboBox::HasList()
388*cdf0e10cSrcweir {
389*cdf0e10cSrcweir 	return sal_True;
390*cdf0e10cSrcweir }
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir void SvXPropertyComboBox::ClearList()
393*cdf0e10cSrcweir {
394*cdf0e10cSrcweir 	aComboBox.Clear();
395*cdf0e10cSrcweir }
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir void SvXPropertyComboBox::InsertEntry( const String& rString,sal_uInt16 nPos)
398*cdf0e10cSrcweir {
399*cdf0e10cSrcweir 	aComboBox.InsertEntry(rString,nPos);
400*cdf0e10cSrcweir }
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir void SvXPropertyComboBox::SetMyName(const String &rString)
403*cdf0e10cSrcweir {
404*cdf0e10cSrcweir 	aName=rString;
405*cdf0e10cSrcweir }
406*cdf0e10cSrcweir 
407*cdf0e10cSrcweir String SvXPropertyComboBox::GetMyName()const
408*cdf0e10cSrcweir {
409*cdf0e10cSrcweir 	return aName;
410*cdf0e10cSrcweir }
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir void SvXPropertyComboBox::SetMyData(void* pDat)
413*cdf0e10cSrcweir {
414*cdf0e10cSrcweir 	pData=pDat;
415*cdf0e10cSrcweir }
416*cdf0e10cSrcweir 
417*cdf0e10cSrcweir void* SvXPropertyComboBox::GetMyData()
418*cdf0e10cSrcweir {
419*cdf0e10cSrcweir 	return pData;
420*cdf0e10cSrcweir }
421*cdf0e10cSrcweir 
422*cdf0e10cSrcweir IMPL_LINK( SvXPropertyComboBox, ModifiedHdl, ComboBox*, EMPTYARG )
423*cdf0e10cSrcweir {
424*cdf0e10cSrcweir 	if(pListener!=NULL)
425*cdf0e10cSrcweir 		pListener->Modified(this);
426*cdf0e10cSrcweir 	return 0;
427*cdf0e10cSrcweir }
428*cdf0e10cSrcweir 
429*cdf0e10cSrcweir IMPL_LINK( SvXPropertyComboBox, GetFocusHdl, ComboBox*, EMPTYARG )
430*cdf0e10cSrcweir {
431*cdf0e10cSrcweir 	if(pListener!=NULL)
432*cdf0e10cSrcweir 		pListener->GetFocus(this);
433*cdf0e10cSrcweir 	return 0;
434*cdf0e10cSrcweir }
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir IMPL_LINK( SvXPropertyComboBox, LoseFocusHdl, ComboBox*, EMPTYARG )
437*cdf0e10cSrcweir {
438*cdf0e10cSrcweir 	if(pListener!=NULL)
439*cdf0e10cSrcweir 		pListener->LoseFocus(this);
440*cdf0e10cSrcweir 	return 0;
441*cdf0e10cSrcweir }
442*cdf0e10cSrcweir //------------------------------------------------------------------
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir SvPropertyLine::SvPropertyLine( Window* pParent,WinBits nWinStyle)
445*cdf0e10cSrcweir 		:	Control(pParent,nWinStyle),
446*cdf0e10cSrcweir 			aName(this,WB_BORDER),
447*cdf0e10cSrcweir 			pSvXPropertyControl(NULL),
448*cdf0e10cSrcweir 			aXButton(this,WB_BORDER),
449*cdf0e10cSrcweir 			bIsLocked(sal_False),
450*cdf0e10cSrcweir 			bIsHyperlink(sal_False)
451*cdf0e10cSrcweir {
452*cdf0e10cSrcweir 	bNeedsRepaint = sal_True;
453*cdf0e10cSrcweir 	bHasXButton = sal_False;
454*cdf0e10cSrcweir 	aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
455*cdf0e10cSrcweir 	aName.Show();
456*cdf0e10cSrcweir 	aXButton.Show();
457*cdf0e10cSrcweir 	eKindOfCtr = KOC_UNDEFINED;
458*cdf0e10cSrcweir 	Wallpaper aWall = GetBackground();
459*cdf0e10cSrcweir 	aWall.SetColor( Color( COL_TRANSPARENT ) );
460*cdf0e10cSrcweir 	SetBackground( aWall );
461*cdf0e10cSrcweir }
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir SvPropertyLine::SvPropertyLine( Window* pParent,const ResId& rResId )
464*cdf0e10cSrcweir 		:	Control(pParent,rResId),
465*cdf0e10cSrcweir 			aName		(this,WB_BORDER),
466*cdf0e10cSrcweir 			pSvXPropertyControl(NULL),
467*cdf0e10cSrcweir 			aXButton	(this,WB_BORDER),
468*cdf0e10cSrcweir 			bIsLocked(sal_False),
469*cdf0e10cSrcweir 			bIsHyperlink(sal_False)
470*cdf0e10cSrcweir {
471*cdf0e10cSrcweir 	bNeedsRepaint = sal_True;
472*cdf0e10cSrcweir 	bHasXButton = sal_False;
473*cdf0e10cSrcweir 	eKindOfCtr = KOC_UNDEFINED;
474*cdf0e10cSrcweir 	aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
475*cdf0e10cSrcweir 	aName.Show();
476*cdf0e10cSrcweir 	aXButton.Show();
477*cdf0e10cSrcweir 	Wallpaper aWall = GetBackground();
478*cdf0e10cSrcweir 	aWall.SetColor( Color( COL_TRANSPARENT ) );
479*cdf0e10cSrcweir 	SetBackground( aWall );
480*cdf0e10cSrcweir 	Resize();
481*cdf0e10cSrcweir }
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir void SvPropertyLine::SetSvXPropertyControl(SvXPropertyControl* pXControl)
484*cdf0e10cSrcweir {
485*cdf0e10cSrcweir 	pSvXPropertyControl=pXControl;
486*cdf0e10cSrcweir 	pSvXPropertyControl->Show();
487*cdf0e10cSrcweir 	Resize();
488*cdf0e10cSrcweir }
489*cdf0e10cSrcweir 
490*cdf0e10cSrcweir SvXPropertyControl* SvPropertyLine::GetSvXPropertyControl()
491*cdf0e10cSrcweir {
492*cdf0e10cSrcweir 	return pSvXPropertyControl;
493*cdf0e10cSrcweir }
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir void SvPropertyLine::Resize()
496*cdf0e10cSrcweir {
497*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
498*cdf0e10cSrcweir 	Size a2Size=aSize;
499*cdf0e10cSrcweir 
500*cdf0e10cSrcweir 	aSize.Width()=nNameWidth;
501*cdf0e10cSrcweir 	a2Size.Width()-=nNameWidth;
502*cdf0e10cSrcweir 
503*cdf0e10cSrcweir 	Point aPos(0,0);
504*cdf0e10cSrcweir 	aName.SetPosPixel(aPos);
505*cdf0e10cSrcweir 	aName.SetSizePixel(aSize);
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir 	sal_uInt16 nXButtonWidth=0;
508*cdf0e10cSrcweir 
509*cdf0e10cSrcweir 	if(bHasXButton)
510*cdf0e10cSrcweir 	{
511*cdf0e10cSrcweir 		nXButtonWidth=(sal_uInt16)aSize.Height();
512*cdf0e10cSrcweir 	}
513*cdf0e10cSrcweir 	a2Size.Width()=a2Size.Width()-nXButtonWidth;
514*cdf0e10cSrcweir 
515*cdf0e10cSrcweir 	aPos.X()+=aSize.Width();
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir 	if(pSvXPropertyControl!=NULL)
518*cdf0e10cSrcweir 	{
519*cdf0e10cSrcweir 		pSvXPropertyControl->SetPosPixel(aPos);
520*cdf0e10cSrcweir 		pSvXPropertyControl->SetCtrSize(a2Size);
521*cdf0e10cSrcweir 	}
522*cdf0e10cSrcweir 
523*cdf0e10cSrcweir 	if(bHasXButton)
524*cdf0e10cSrcweir 	{
525*cdf0e10cSrcweir 		aPos.X()=GetOutputSizePixel().Width()
526*cdf0e10cSrcweir 					-nXButtonWidth;
527*cdf0e10cSrcweir 		aSize.Width()=nXButtonWidth;
528*cdf0e10cSrcweir 		aXButton	.SetSizePixel(aSize);
529*cdf0e10cSrcweir 		aXButton	.SetPosPixel(aPos);
530*cdf0e10cSrcweir 	}
531*cdf0e10cSrcweir }
532*cdf0e10cSrcweir 
533*cdf0e10cSrcweir void SvPropertyLine::SetNeedsRepaint(sal_Bool bFlag)
534*cdf0e10cSrcweir {
535*cdf0e10cSrcweir 	bNeedsRepaint=bFlag;
536*cdf0e10cSrcweir }
537*cdf0e10cSrcweir 
538*cdf0e10cSrcweir sal_Bool SvPropertyLine::NeedsRepaint()
539*cdf0e10cSrcweir {
540*cdf0e10cSrcweir 	return bNeedsRepaint;
541*cdf0e10cSrcweir }
542*cdf0e10cSrcweir 
543*cdf0e10cSrcweir void SvPropertyLine::SetName(const String& rString )
544*cdf0e10cSrcweir {
545*cdf0e10cSrcweir 	aName.SetText(rString);
546*cdf0e10cSrcweir 	aName.Invalidate();
547*cdf0e10cSrcweir }
548*cdf0e10cSrcweir 
549*cdf0e10cSrcweir String SvPropertyLine::GetName() const
550*cdf0e10cSrcweir {
551*cdf0e10cSrcweir 	return aName.GetText();
552*cdf0e10cSrcweir }
553*cdf0e10cSrcweir 
554*cdf0e10cSrcweir void SvPropertyLine::SetKindOfControl(eKindOfControl eKOC)
555*cdf0e10cSrcweir {
556*cdf0e10cSrcweir 	eKindOfCtr=eKOC;
557*cdf0e10cSrcweir }
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir eKindOfControl SvPropertyLine::GetKindOfControl()
560*cdf0e10cSrcweir {
561*cdf0e10cSrcweir 	return eKindOfCtr;
562*cdf0e10cSrcweir }
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir void SvPropertyLine::ShowXButton()
565*cdf0e10cSrcweir {
566*cdf0e10cSrcweir 	bHasXButton=sal_True;
567*cdf0e10cSrcweir 	aXButton.Show();
568*cdf0e10cSrcweir 	Resize();
569*cdf0e10cSrcweir }
570*cdf0e10cSrcweir void SvPropertyLine::HideXButton()
571*cdf0e10cSrcweir {
572*cdf0e10cSrcweir 	bHasXButton=sal_False;
573*cdf0e10cSrcweir 	aXButton.Hide();
574*cdf0e10cSrcweir 	Resize();
575*cdf0e10cSrcweir }
576*cdf0e10cSrcweir sal_Bool SvPropertyLine::IsVisibleXButton()
577*cdf0e10cSrcweir {
578*cdf0e10cSrcweir 	return bHasXButton;
579*cdf0e10cSrcweir }
580*cdf0e10cSrcweir 
581*cdf0e10cSrcweir void SvPropertyLine::ShowAsHyperLink(sal_Bool nFlag)
582*cdf0e10cSrcweir {
583*cdf0e10cSrcweir 	bIsHyperlink=nFlag;
584*cdf0e10cSrcweir 	if(nFlag)
585*cdf0e10cSrcweir 	{
586*cdf0e10cSrcweir 		Font aFont=GetFont();
587*cdf0e10cSrcweir 		aFont.SetUnderline(UNDERLINE_SINGLE);
588*cdf0e10cSrcweir 		aFont.SetColor(Color(COL_BLUE));
589*cdf0e10cSrcweir 		aName.SetFont(aFont);
590*cdf0e10cSrcweir 	}
591*cdf0e10cSrcweir 	else
592*cdf0e10cSrcweir 	{
593*cdf0e10cSrcweir 		Font aFont=GetFont();
594*cdf0e10cSrcweir 		aName.SetFont(aFont);
595*cdf0e10cSrcweir 	}
596*cdf0e10cSrcweir }
597*cdf0e10cSrcweir 
598*cdf0e10cSrcweir sal_Bool SvPropertyLine::IsShownAsHyperlink()
599*cdf0e10cSrcweir {
600*cdf0e10cSrcweir 	return bIsHyperlink;
601*cdf0e10cSrcweir }
602*cdf0e10cSrcweir 
603*cdf0e10cSrcweir void SvPropertyLine::Locked(sal_Bool nFlag)
604*cdf0e10cSrcweir {
605*cdf0e10cSrcweir 	bIsLocked=nFlag;
606*cdf0e10cSrcweir 	if(pSvXPropertyControl!=NULL)
607*cdf0e10cSrcweir 		pSvXPropertyControl->SetLocked(nFlag);
608*cdf0e10cSrcweir }
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir sal_Bool SvPropertyLine::IsLineLocked()
611*cdf0e10cSrcweir {
612*cdf0e10cSrcweir 	return bIsLocked;
613*cdf0e10cSrcweir }
614*cdf0e10cSrcweir 
615*cdf0e10cSrcweir void SvPropertyLine::SetNameWidth(sal_uInt16 nWidth)
616*cdf0e10cSrcweir {
617*cdf0e10cSrcweir 	nNameWidth=nWidth;
618*cdf0e10cSrcweir 	Resize();
619*cdf0e10cSrcweir }
620*cdf0e10cSrcweir 
621*cdf0e10cSrcweir void SvPropertyLine::SetClickHdl(const Link& rLink)
622*cdf0e10cSrcweir {
623*cdf0e10cSrcweir 	aXButton.SetClickHdl(rLink );
624*cdf0e10cSrcweir }
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir //----------------------------------------------------------
627*cdf0e10cSrcweir 
628*cdf0e10cSrcweir SvXPropEvListener::SvXPropEvListener()
629*cdf0e10cSrcweir {
630*cdf0e10cSrcweir 	pTheActiveControl=NULL;
631*cdf0e10cSrcweir }
632*cdf0e10cSrcweir 
633*cdf0e10cSrcweir SvXPropEvListener::~SvXPropEvListener()
634*cdf0e10cSrcweir {
635*cdf0e10cSrcweir }
636*cdf0e10cSrcweir 
637*cdf0e10cSrcweir void SvXPropEvListener::Modified (SvXPropertyControl *pSvXPCtr)
638*cdf0e10cSrcweir {
639*cdf0e10cSrcweir 	pTheActiveControl=pSvXPCtr;
640*cdf0e10cSrcweir 	aModifyLink.Call(this);
641*cdf0e10cSrcweir }
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir void SvXPropEvListener::GetFocus (SvXPropertyControl *pSvXPCtr)
644*cdf0e10cSrcweir {
645*cdf0e10cSrcweir 	pTheActiveControl=pSvXPCtr;
646*cdf0e10cSrcweir 	aGetFocusLink.Call(this);
647*cdf0e10cSrcweir }
648*cdf0e10cSrcweir 
649*cdf0e10cSrcweir void SvXPropEvListener::LoseFocus (SvXPropertyControl *pSvXPCtr)
650*cdf0e10cSrcweir {
651*cdf0e10cSrcweir 	pTheActiveControl=pSvXPCtr;
652*cdf0e10cSrcweir 	aLoseFocusLink.Call(this);
653*cdf0e10cSrcweir }
654*cdf0e10cSrcweir 
655*cdf0e10cSrcweir void SvXPropEvListener::KeyInput (SvXPropertyControl *pSvXPCtr,const KeyCode& theKeyCode)
656*cdf0e10cSrcweir {
657*cdf0e10cSrcweir 	pTheActiveControl=pSvXPCtr;
658*cdf0e10cSrcweir 	aKeyCode=theKeyCode;
659*cdf0e10cSrcweir 	aKeyInputLink.Call(this);
660*cdf0e10cSrcweir }
661*cdf0e10cSrcweir 
662*cdf0e10cSrcweir SvXPropertyControl *	SvXPropEvListener::GetPropertyControl()
663*cdf0e10cSrcweir {
664*cdf0e10cSrcweir 	return pTheActiveControl;
665*cdf0e10cSrcweir }
666*cdf0e10cSrcweir 
667*cdf0e10cSrcweir KeyCode SvXPropEvListener::GetKeyCode() const
668*cdf0e10cSrcweir {
669*cdf0e10cSrcweir 	return aKeyCode;
670*cdf0e10cSrcweir }
671*cdf0e10cSrcweir 
672*cdf0e10cSrcweir //------------------------------------------------------------------
673*cdf0e10cSrcweir 
674*cdf0e10cSrcweir SvListBoxForProperties::SvListBoxForProperties( Window* pParent, WinBits nWinStyle)
675*cdf0e10cSrcweir 		:	Control(pParent,nWinStyle),
676*cdf0e10cSrcweir 			aPlayGround(this,WB_DIALOGCONTROL),
677*cdf0e10cSrcweir 			aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG),
678*cdf0e10cSrcweir 			pPropDataControl(NULL)
679*cdf0e10cSrcweir {
680*cdf0e10cSrcweir 
681*cdf0e10cSrcweir 	aListener.SetModifyHdl	 (LINK( this, SvListBoxForProperties,	ModifyHdl));
682*cdf0e10cSrcweir 	aListener.SetGetFocusHdl (LINK( this, SvListBoxForProperties, GetFocusHdl));
683*cdf0e10cSrcweir 	aListener.SetLoseFocusHdl(LINK( this, SvListBoxForProperties,LoseFocusHdl));
684*cdf0e10cSrcweir 	aListener.SetKeyInputHdl (LINK( this, SvListBoxForProperties, KeyInputHdl));
685*cdf0e10cSrcweir 
686*cdf0e10cSrcweir 	nYOffset=0;
687*cdf0e10cSrcweir 	nTheNameSize=0;
688*cdf0e10cSrcweir 	ListBox aListBox(this,WB_DROPDOWN);
689*cdf0e10cSrcweir 	aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
690*cdf0e10cSrcweir 	nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height();
691*cdf0e10cSrcweir 	Wallpaper aWall = aPlayGround.GetBackground();
692*cdf0e10cSrcweir 	aWall.SetColor( Color( COL_TRANSPARENT ) );
693*cdf0e10cSrcweir 	aPlayGround.SetBackground( aWall );
694*cdf0e10cSrcweir 	aPlayGround.Show();
695*cdf0e10cSrcweir 	aVScroll.Hide();
696*cdf0e10cSrcweir 	aVScroll.SetScrollHdl(
697*cdf0e10cSrcweir 		LINK( this, SvListBoxForProperties, ScrollHdl ));
698*cdf0e10cSrcweir 
699*cdf0e10cSrcweir }
700*cdf0e10cSrcweir 
701*cdf0e10cSrcweir 
702*cdf0e10cSrcweir SvListBoxForProperties::SvListBoxForProperties( Window* pParent, const ResId& rResId )
703*cdf0e10cSrcweir 			:		Control(pParent,rResId),
704*cdf0e10cSrcweir 					aPlayGround(this,0),
705*cdf0e10cSrcweir 					aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG),
706*cdf0e10cSrcweir 					pPropDataControl(NULL)
707*cdf0e10cSrcweir {
708*cdf0e10cSrcweir 	nTheNameSize=0;
709*cdf0e10cSrcweir 	nYOffset=0;
710*cdf0e10cSrcweir 	ListBox aListBox(this,WB_DROPDOWN);
711*cdf0e10cSrcweir 	aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
712*cdf0e10cSrcweir 	nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height();
713*cdf0e10cSrcweir 	Wallpaper aWall = aPlayGround.GetBackground();
714*cdf0e10cSrcweir 	aWall.SetColor( Color( COL_TRANSPARENT ) );
715*cdf0e10cSrcweir 	aPlayGround.SetBackground( aWall );
716*cdf0e10cSrcweir 	aPlayGround.Show();
717*cdf0e10cSrcweir 	aVScroll.Hide();
718*cdf0e10cSrcweir 	aVScroll.SetScrollHdl( LINK( this, SvListBoxForProperties, ScrollHdl ) );
719*cdf0e10cSrcweir 	UpdateVScroll();
720*cdf0e10cSrcweir 	Resize();
721*cdf0e10cSrcweir }
722*cdf0e10cSrcweir 
723*cdf0e10cSrcweir SvListBoxForProperties::~SvListBoxForProperties()
724*cdf0e10cSrcweir {
725*cdf0e10cSrcweir 	Clear();
726*cdf0e10cSrcweir }
727*cdf0e10cSrcweir 
728*cdf0e10cSrcweir void SvListBoxForProperties::Clear()
729*cdf0e10cSrcweir {
730*cdf0e10cSrcweir 	for(sal_uInt16 i=0;i<PLineArray.Count();i++)
731*cdf0e10cSrcweir 	{
732*cdf0e10cSrcweir 		SvPropertyLine* pPropLine=PLineArray[i];
733*cdf0e10cSrcweir 
734*cdf0e10cSrcweir 		switch(pPropLine->GetKindOfControl())
735*cdf0e10cSrcweir 		{
736*cdf0e10cSrcweir 			case	KOC_LISTBOX:
737*cdf0e10cSrcweir 			case	KOC_COMBOBOX:
738*cdf0e10cSrcweir 			case	KOC_EDIT:		delete pPropLine->GetSvXPropertyControl();
739*cdf0e10cSrcweir 									break;
740*cdf0e10cSrcweir 			default:
741*cdf0e10cSrcweir 									break;
742*cdf0e10cSrcweir 		}
743*cdf0e10cSrcweir 		delete pPropLine;
744*cdf0e10cSrcweir 	}
745*cdf0e10cSrcweir 	PLineArray.Remove(0,PLineArray.Count());
746*cdf0e10cSrcweir }
747*cdf0e10cSrcweir 
748*cdf0e10cSrcweir 
749*cdf0e10cSrcweir void SvListBoxForProperties::Resize()
750*cdf0e10cSrcweir {
751*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
752*cdf0e10cSrcweir 	Size a2Size=aSize;
753*cdf0e10cSrcweir 	Size aVScrollSize;
754*cdf0e10cSrcweir 
755*cdf0e10cSrcweir 	if(aVScroll.IsVisible())
756*cdf0e10cSrcweir 	{
757*cdf0e10cSrcweir 		Point aPos(0,0);
758*cdf0e10cSrcweir 		aVScrollSize=aVScroll.GetSizePixel();
759*cdf0e10cSrcweir 		aVScrollSize.Height()=aSize.Height();
760*cdf0e10cSrcweir 		a2Size.Width()-=aVScrollSize.Width();
761*cdf0e10cSrcweir 		aPos.X()=a2Size.Width();
762*cdf0e10cSrcweir 		aVScroll.SetPosPixel(aPos);
763*cdf0e10cSrcweir 		aVScroll.SetSizePixel(aVScrollSize);
764*cdf0e10cSrcweir 	}
765*cdf0e10cSrcweir 
766*cdf0e10cSrcweir 	aPlayGround.SetPosPixel(Point(0,0));
767*cdf0e10cSrcweir 	aPlayGround.SetSizePixel(a2Size);
768*cdf0e10cSrcweir 	UpdatePosNSize();
769*cdf0e10cSrcweir }
770*cdf0e10cSrcweir 
771*cdf0e10cSrcweir void SvListBoxForProperties::SetController( SvPropertyDataControl *pPDC)
772*cdf0e10cSrcweir {
773*cdf0e10cSrcweir 	pPropDataControl=pPDC;
774*cdf0e10cSrcweir }
775*cdf0e10cSrcweir 
776*cdf0e10cSrcweir sal_uInt16 SvListBoxForProperties::CalcVisibleLines()
777*cdf0e10cSrcweir {
778*cdf0e10cSrcweir 	Size aSize=aPlayGround.GetOutputSizePixel();
779*cdf0e10cSrcweir 	sal_uInt16 nResult=0;
780*cdf0e10cSrcweir 	if(nRowHeight!=0)
781*cdf0e10cSrcweir 		nResult=(sal_uInt16) aSize.Height()/nRowHeight;
782*cdf0e10cSrcweir 
783*cdf0e10cSrcweir 	return nResult;
784*cdf0e10cSrcweir }
785*cdf0e10cSrcweir 
786*cdf0e10cSrcweir void SvListBoxForProperties::UpdateVScroll()
787*cdf0e10cSrcweir {
788*cdf0e10cSrcweir 	sal_uInt16 nLines=CalcVisibleLines();
789*cdf0e10cSrcweir 	aVScroll.SetPageSize(nLines-1);
790*cdf0e10cSrcweir 	aVScroll.SetVisibleSize(nLines-1);
791*cdf0e10cSrcweir 	aVScroll.SetRange(Range(0,PLineArray.Count()-1));
792*cdf0e10cSrcweir 	if(PLineArray.Count()<=nLines)
793*cdf0e10cSrcweir 	{
794*cdf0e10cSrcweir 		aVScroll.Hide();
795*cdf0e10cSrcweir 	}
796*cdf0e10cSrcweir 	else
797*cdf0e10cSrcweir 	{
798*cdf0e10cSrcweir 		sal_Bool bFlag=aVScroll.IsVisible();
799*cdf0e10cSrcweir 		aVScroll.Show();
800*cdf0e10cSrcweir 		if(!bFlag)Resize();
801*cdf0e10cSrcweir 	}
802*cdf0e10cSrcweir 
803*cdf0e10cSrcweir 
804*cdf0e10cSrcweir }
805*cdf0e10cSrcweir 
806*cdf0e10cSrcweir void SvListBoxForProperties::UpdatePosNSize()
807*cdf0e10cSrcweir {
808*cdf0e10cSrcweir 	Point aPos(0,nYOffset);
809*cdf0e10cSrcweir 
810*cdf0e10cSrcweir 	for(sal_uInt16 i=0; i<PLineArray.Count();i++)
811*cdf0e10cSrcweir 	{
812*cdf0e10cSrcweir 		if((PLineArray[i])->NeedsRepaint())
813*cdf0e10cSrcweir 		{
814*cdf0e10cSrcweir 			(PLineArray[i])->SetPosPixel(aPos);
815*cdf0e10cSrcweir 			Size aSize=aPlayGround.GetOutputSizePixel();
816*cdf0e10cSrcweir 			aSize.Height()=nRowHeight;
817*cdf0e10cSrcweir 			(PLineArray[i])->SetSizePixel(aSize);
818*cdf0e10cSrcweir 			(PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
819*cdf0e10cSrcweir 			(PLineArray[i])->Invalidate();
820*cdf0e10cSrcweir 			(PLineArray[i])->Update();
821*cdf0e10cSrcweir 			(PLineArray[i])->Show();
822*cdf0e10cSrcweir 			(PLineArray[i])->SetNeedsRepaint(sal_False);
823*cdf0e10cSrcweir 		}
824*cdf0e10cSrcweir 		else
825*cdf0e10cSrcweir 		{
826*cdf0e10cSrcweir 			if((PLineArray[i])->IsVisible())
827*cdf0e10cSrcweir 			{
828*cdf0e10cSrcweir 				Size aSize=aPlayGround.GetOutputSizePixel();
829*cdf0e10cSrcweir 				aSize.Height()=nRowHeight;
830*cdf0e10cSrcweir 				(PLineArray[i])->SetSizePixel(aSize);
831*cdf0e10cSrcweir 				(PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
832*cdf0e10cSrcweir 				(PLineArray[i])->Invalidate();
833*cdf0e10cSrcweir 			}
834*cdf0e10cSrcweir 		}
835*cdf0e10cSrcweir 
836*cdf0e10cSrcweir 		aPos.Y()+=nRowHeight;
837*cdf0e10cSrcweir 	}
838*cdf0e10cSrcweir 	aPlayGround.Invalidate();
839*cdf0e10cSrcweir 	aPlayGround.Update();
840*cdf0e10cSrcweir }
841*cdf0e10cSrcweir 
842*cdf0e10cSrcweir void SvListBoxForProperties::UpdatePlayGround()
843*cdf0e10cSrcweir {
844*cdf0e10cSrcweir 	Point aPos(0,0);
845*cdf0e10cSrcweir 	long nThumbPos=aVScroll.GetThumbPos();
846*cdf0e10cSrcweir 	long nLines=aVScroll.GetPageSize();
847*cdf0e10cSrcweir 	long nDelta=aVScroll.GetDelta();
848*cdf0e10cSrcweir 
849*cdf0e10cSrcweir 	sal_uInt16 nStart,nEnd;
850*cdf0e10cSrcweir 	Size aSize=aPlayGround.GetOutputSizePixel();
851*cdf0e10cSrcweir 	Point aPEnd;
852*cdf0e10cSrcweir 	aPEnd.X()=aSize.Width();
853*cdf0e10cSrcweir 
854*cdf0e10cSrcweir 	if(nDelta>0)
855*cdf0e10cSrcweir 	{
856*cdf0e10cSrcweir 		nStart=(sal_uInt16)(nThumbPos+nLines+1-nDelta);
857*cdf0e10cSrcweir 		nEnd=(sal_uInt16)(nThumbPos+nLines);
858*cdf0e10cSrcweir 		aPos.Y()=(nLines+1-nDelta)*nRowHeight;
859*cdf0e10cSrcweir 	}
860*cdf0e10cSrcweir 	else
861*cdf0e10cSrcweir 	{
862*cdf0e10cSrcweir 		nStart=(sal_uInt16)nThumbPos;
863*cdf0e10cSrcweir 		nEnd=(sal_uInt16)(nThumbPos-nDelta);
864*cdf0e10cSrcweir 		aPEnd.Y()=(nThumbPos-nDelta)*nRowHeight;;
865*cdf0e10cSrcweir 	}
866*cdf0e10cSrcweir 
867*cdf0e10cSrcweir 	aSize.Height()=nRowHeight;
868*cdf0e10cSrcweir 
869*cdf0e10cSrcweir 	nDelta=-nDelta*nRowHeight;
870*cdf0e10cSrcweir 
871*cdf0e10cSrcweir 	aPlayGround.Scroll(0,nDelta,SCROLL_CHILDREN);
872*cdf0e10cSrcweir 
873*cdf0e10cSrcweir 	for(sal_uInt16 i=nStart; i<=nEnd;i++)
874*cdf0e10cSrcweir 	{
875*cdf0e10cSrcweir 		(PLineArray[i])->SetPosSizePixel(aPos,aSize);
876*cdf0e10cSrcweir 		(PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
877*cdf0e10cSrcweir 		(PLineArray[i])->Show();
878*cdf0e10cSrcweir 		aPos.Y()+=nRowHeight;
879*cdf0e10cSrcweir 	}
880*cdf0e10cSrcweir 	aPlayGround.Update();
881*cdf0e10cSrcweir }
882*cdf0e10cSrcweir 
883*cdf0e10cSrcweir void SvListBoxForProperties::UpdateAll()
884*cdf0e10cSrcweir {
885*cdf0e10cSrcweir 	UpdatePosNSize();
886*cdf0e10cSrcweir 	UpdatePlayGround();
887*cdf0e10cSrcweir 	//UpdateVScroll();
888*cdf0e10cSrcweir }
889*cdf0e10cSrcweir 
890*cdf0e10cSrcweir void SvListBoxForProperties::DisableUpdate()
891*cdf0e10cSrcweir {
892*cdf0e10cSrcweir 	bUpdate=sal_False;
893*cdf0e10cSrcweir }
894*cdf0e10cSrcweir 
895*cdf0e10cSrcweir void SvListBoxForProperties::EnableUpdate()
896*cdf0e10cSrcweir {
897*cdf0e10cSrcweir 	bUpdate=sal_True;
898*cdf0e10cSrcweir 	UpdateAll();
899*cdf0e10cSrcweir }
900*cdf0e10cSrcweir 
901*cdf0e10cSrcweir void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const String & rValue )
902*cdf0e10cSrcweir {
903*cdf0e10cSrcweir 	sal_uInt16 i, iEnd = PLineArray.Count();
904*cdf0e10cSrcweir 	for( i = 0 ; i < iEnd ; i++ )
905*cdf0e10cSrcweir 	{
906*cdf0e10cSrcweir 		SvPropertyLine* pPropLine = PLineArray[ i ];
907*cdf0e10cSrcweir 		SvXPropertyControl* pSvXPCtr=pPropLine->GetSvXPropertyControl();
908*cdf0e10cSrcweir 		if( pSvXPCtr && pSvXPCtr->GetMyName() == rEntryName )
909*cdf0e10cSrcweir 		{
910*cdf0e10cSrcweir 			pSvXPCtr->SetProperty( rValue );
911*cdf0e10cSrcweir 		}
912*cdf0e10cSrcweir 	}
913*cdf0e10cSrcweir }
914*cdf0e10cSrcweir 
915*cdf0e10cSrcweir sal_uInt16 SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData)
916*cdf0e10cSrcweir {
917*cdf0e10cSrcweir 	return InsertEntry(aPropData);
918*cdf0e10cSrcweir }
919*cdf0e10cSrcweir 
920*cdf0e10cSrcweir sal_uInt16 SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, sal_uInt16 nPos)
921*cdf0e10cSrcweir {
922*cdf0e10cSrcweir 	sal_uInt16 nInsPos=nPos;
923*cdf0e10cSrcweir 	SvPropertyLine* pPropLine=new SvPropertyLine(&aPlayGround,WB_TABSTOP | WB_DIALOGCONTROL);
924*cdf0e10cSrcweir 
925*cdf0e10cSrcweir 	if(nPos==LISTBOX_APPEND)
926*cdf0e10cSrcweir 	{
927*cdf0e10cSrcweir 		nInsPos=PLineArray.Count();
928*cdf0e10cSrcweir 		PLineArray.Insert(pPropLine,nInsPos);
929*cdf0e10cSrcweir 	}
930*cdf0e10cSrcweir 	else
931*cdf0e10cSrcweir 	{
932*cdf0e10cSrcweir 		PLineArray.Insert(pPropLine,nPos);
933*cdf0e10cSrcweir 	}
934*cdf0e10cSrcweir 	pPropLine->SetNameWidth(nTheNameSize);
935*cdf0e10cSrcweir 	UpdateVScroll();
936*cdf0e10cSrcweir 	UpdatePosNSize();
937*cdf0e10cSrcweir 	ChangeEntry(aPropData,nInsPos);
938*cdf0e10cSrcweir 	return nInsPos;
939*cdf0e10cSrcweir }
940*cdf0e10cSrcweir 
941*cdf0e10cSrcweir void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, sal_uInt16 nPos)
942*cdf0e10cSrcweir {
943*cdf0e10cSrcweir 	if(nPos<PLineArray.Count())
944*cdf0e10cSrcweir 	{
945*cdf0e10cSrcweir 		SvPropertyLine* pPropLine=PLineArray[nPos];
946*cdf0e10cSrcweir 
947*cdf0e10cSrcweir 		switch(pPropLine->GetKindOfControl())
948*cdf0e10cSrcweir 		{
949*cdf0e10cSrcweir 			case	KOC_LISTBOX:
950*cdf0e10cSrcweir 			case	KOC_COMBOBOX:
951*cdf0e10cSrcweir 			case	KOC_EDIT:		delete pPropLine->GetSvXPropertyControl();
952*cdf0e10cSrcweir 									break;
953*cdf0e10cSrcweir 			default:
954*cdf0e10cSrcweir 									break;
955*cdf0e10cSrcweir 		}
956*cdf0e10cSrcweir 
957*cdf0e10cSrcweir 		switch(aPropData.eKind)
958*cdf0e10cSrcweir 		{
959*cdf0e10cSrcweir 			case	KOC_LISTBOX:
960*cdf0e10cSrcweir 									pPropLine->SetSvXPropertyControl(
961*cdf0e10cSrcweir 											new SvXPropertyComboBox(pPropLine,WB_TABSTOP));
962*cdf0e10cSrcweir 									pPropLine->SetKindOfControl(aPropData.eKind);
963*cdf0e10cSrcweir 									break;
964*cdf0e10cSrcweir 			case	KOC_COMBOBOX:
965*cdf0e10cSrcweir 									pPropLine->SetSvXPropertyControl(
966*cdf0e10cSrcweir 											new SvXPropertyComboBox(pPropLine,WB_TABSTOP));
967*cdf0e10cSrcweir 									pPropLine->SetKindOfControl(aPropData.eKind);
968*cdf0e10cSrcweir 									break;
969*cdf0e10cSrcweir 			case	KOC_EDIT:
970*cdf0e10cSrcweir 									pPropLine->SetSvXPropertyControl(
971*cdf0e10cSrcweir 											new SvXPropertyEdit(pPropLine,WB_TABSTOP));
972*cdf0e10cSrcweir 									pPropLine->SetKindOfControl(aPropData.eKind);
973*cdf0e10cSrcweir 									break;
974*cdf0e10cSrcweir 			case	KOC_USERDEFINED:
975*cdf0e10cSrcweir 									pPropLine->SetSvXPropertyControl(aPropData.pControl);
976*cdf0e10cSrcweir 									aPropData.pControl->SetParent(pPropLine);
977*cdf0e10cSrcweir 									pPropLine->SetKindOfControl(aPropData.eKind);
978*cdf0e10cSrcweir 									break;
979*cdf0e10cSrcweir 			default:
980*cdf0e10cSrcweir 									pPropLine->SetSvXPropertyControl(NULL);
981*cdf0e10cSrcweir 									pPropLine->SetKindOfControl(KOC_UNDEFINED);
982*cdf0e10cSrcweir 									break;
983*cdf0e10cSrcweir 		}
984*cdf0e10cSrcweir 
985*cdf0e10cSrcweir 		SvXPropertyControl* pSvXPCtr=pPropLine->GetSvXPropertyControl();
986*cdf0e10cSrcweir 
987*cdf0e10cSrcweir 		if(pSvXPCtr!=NULL)
988*cdf0e10cSrcweir 		{
989*cdf0e10cSrcweir 			pSvXPCtr->SetSvXPropertyCtrListener(&aListener);
990*cdf0e10cSrcweir 			pSvXPCtr->SetProperty(aPropData.aValue);
991*cdf0e10cSrcweir 			pSvXPCtr->SetMyData(aPropData.pDataPtr);
992*cdf0e10cSrcweir 			pSvXPCtr->SetMyName(aPropData.aName);
993*cdf0e10cSrcweir 
994*cdf0e10cSrcweir 			if(pSvXPCtr->HasList())
995*cdf0e10cSrcweir 			{
996*cdf0e10cSrcweir 				for(sal_uInt16 i=0;i<aPropData.theValues.Count();i++)
997*cdf0e10cSrcweir 				{
998*cdf0e10cSrcweir 					pSvXPCtr->InsertEntry(*(aPropData.theValues[i]));
999*cdf0e10cSrcweir 				}
1000*cdf0e10cSrcweir 			}
1001*cdf0e10cSrcweir 		}
1002*cdf0e10cSrcweir 
1003*cdf0e10cSrcweir 		pPropLine->SetName(aPropData.aName);
1004*cdf0e10cSrcweir 
1005*cdf0e10cSrcweir 		sal_uInt16 nTextWidth=(sal_uInt16)aPlayGround.GetTextWidth(aPropData.aName);
1006*cdf0e10cSrcweir 
1007*cdf0e10cSrcweir 		if ( nTheNameSize < nTextWidth )
1008*cdf0e10cSrcweir 			nTheNameSize = nTextWidth;
1009*cdf0e10cSrcweir 
1010*cdf0e10cSrcweir 		if ( aPropData.bHasVisibleXButton )
1011*cdf0e10cSrcweir 		{
1012*cdf0e10cSrcweir 			pPropLine->SetClickHdl(LINK( this, SvListBoxForProperties, ClickHdl ) );
1013*cdf0e10cSrcweir 			pPropLine->ShowXButton();
1014*cdf0e10cSrcweir 		}
1015*cdf0e10cSrcweir 		else
1016*cdf0e10cSrcweir 			pPropLine->HideXButton();
1017*cdf0e10cSrcweir 
1018*cdf0e10cSrcweir 		pPropLine->Locked(aPropData.bIsLocked);
1019*cdf0e10cSrcweir 
1020*cdf0e10cSrcweir 		pPropLine->ShowAsHyperLink(aPropData.bIsHyperLink);
1021*cdf0e10cSrcweir 		pPropLine->SetData(aPropData.pDataPtr);
1022*cdf0e10cSrcweir 	}
1023*cdf0e10cSrcweir }
1024*cdf0e10cSrcweir 
1025*cdf0e10cSrcweir sal_uInt16 SvListBoxForProperties::GetFirstVisibleEntry()
1026*cdf0e10cSrcweir {
1027*cdf0e10cSrcweir 	return 0;
1028*cdf0e10cSrcweir }
1029*cdf0e10cSrcweir void SvListBoxForProperties::SetFirstVisibleEntry(sal_uInt16)
1030*cdf0e10cSrcweir {
1031*cdf0e10cSrcweir 	return;
1032*cdf0e10cSrcweir }
1033*cdf0e10cSrcweir 
1034*cdf0e10cSrcweir void SvListBoxForProperties::SetSelectedEntry(sal_uInt16)
1035*cdf0e10cSrcweir {
1036*cdf0e10cSrcweir 	return;
1037*cdf0e10cSrcweir }
1038*cdf0e10cSrcweir 
1039*cdf0e10cSrcweir sal_uInt16 SvListBoxForProperties::GetSelectedEntry()
1040*cdf0e10cSrcweir {
1041*cdf0e10cSrcweir 	return 0;
1042*cdf0e10cSrcweir }
1043*cdf0e10cSrcweir 
1044*cdf0e10cSrcweir IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB )
1045*cdf0e10cSrcweir {
1046*cdf0e10cSrcweir 	if(pSB!=NULL)
1047*cdf0e10cSrcweir 	{
1048*cdf0e10cSrcweir 		long nDelta=aVScroll.GetDelta();
1049*cdf0e10cSrcweir 		nYOffset=-aVScroll.GetThumbPos()*nRowHeight;
1050*cdf0e10cSrcweir 		//aPlayGround.SetUpdateMode(sal_False);
1051*cdf0e10cSrcweir 
1052*cdf0e10cSrcweir 		long nThumbPos=aVScroll.GetThumbPos();
1053*cdf0e10cSrcweir 		long nLines=aVScroll.GetPageSize();
1054*cdf0e10cSrcweir 
1055*cdf0e10cSrcweir 		UpdatePlayGround();
1056*cdf0e10cSrcweir 
1057*cdf0e10cSrcweir 		for(long i=nThumbPos-nDelta; i<nThumbPos+nLines-nDelta;i++)
1058*cdf0e10cSrcweir 		{
1059*cdf0e10cSrcweir 			if(i>=nThumbPos && i<=nThumbPos+nLines)
1060*cdf0e10cSrcweir 			{
1061*cdf0e10cSrcweir 				(PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->
1062*cdf0e10cSrcweir                     SetNeedsRepaint(sal_True);
1063*cdf0e10cSrcweir 			}
1064*cdf0e10cSrcweir 			else
1065*cdf0e10cSrcweir 			{
1066*cdf0e10cSrcweir 				(PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->Hide();
1067*cdf0e10cSrcweir 				(PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->
1068*cdf0e10cSrcweir                     SetNeedsRepaint(sal_False);
1069*cdf0e10cSrcweir 			}
1070*cdf0e10cSrcweir 		}
1071*cdf0e10cSrcweir 	}
1072*cdf0e10cSrcweir 	return 0;
1073*cdf0e10cSrcweir }
1074*cdf0e10cSrcweir 
1075*cdf0e10cSrcweir IMPL_LINK( SvListBoxForProperties, ClickHdl, PushButton*,pPB)
1076*cdf0e10cSrcweir {
1077*cdf0e10cSrcweir 	if(pPB!=NULL)
1078*cdf0e10cSrcweir 	{
1079*cdf0e10cSrcweir 	   SvPropertyLine *pPropLine=(SvPropertyLine *)pPB->GetParent();
1080*cdf0e10cSrcweir 	   SvXPropertyControl* pSvXPCtr=pPropLine->GetSvXPropertyControl();
1081*cdf0e10cSrcweir 	   pPropDataControl->Clicked(pSvXPCtr->GetMyName(),
1082*cdf0e10cSrcweir 							pSvXPCtr->GetProperty(),pSvXPCtr->GetMyData());
1083*cdf0e10cSrcweir 	}
1084*cdf0e10cSrcweir 	return 0;
1085*cdf0e10cSrcweir }
1086*cdf0e10cSrcweir 
1087*cdf0e10cSrcweir IMPL_LINK( SvListBoxForProperties, ModifyHdl,SvXPropEvListener*, pSvXPEvL)
1088*cdf0e10cSrcweir {
1089*cdf0e10cSrcweir 	if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
1090*cdf0e10cSrcweir 	{
1091*cdf0e10cSrcweir 
1092*cdf0e10cSrcweir 		SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
1093*cdf0e10cSrcweir 
1094*cdf0e10cSrcweir 		pPropDataControl->Modified(pSvXPCtr->GetMyName(),
1095*cdf0e10cSrcweir 							pSvXPCtr->GetProperty(),pSvXPCtr->GetMyData());
1096*cdf0e10cSrcweir 
1097*cdf0e10cSrcweir 	}
1098*cdf0e10cSrcweir 	return 0;
1099*cdf0e10cSrcweir }
1100*cdf0e10cSrcweir 
1101*cdf0e10cSrcweir IMPL_LINK( SvListBoxForProperties, GetFocusHdl,SvXPropEvListener*, pSvXPEvL)
1102*cdf0e10cSrcweir {
1103*cdf0e10cSrcweir 	if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
1104*cdf0e10cSrcweir 	{
1105*cdf0e10cSrcweir 		SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
1106*cdf0e10cSrcweir 
1107*cdf0e10cSrcweir 		pPropDataControl->Select(pSvXPCtr->GetMyName(),pSvXPCtr->GetMyData());
1108*cdf0e10cSrcweir 	}
1109*cdf0e10cSrcweir 	return 0;
1110*cdf0e10cSrcweir }
1111*cdf0e10cSrcweir 
1112*cdf0e10cSrcweir IMPL_LINK( SvListBoxForProperties, LoseFocusHdl,SvXPropEvListener*, pSvXPEvL)
1113*cdf0e10cSrcweir {
1114*cdf0e10cSrcweir 	if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
1115*cdf0e10cSrcweir 	{
1116*cdf0e10cSrcweir 		SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
1117*cdf0e10cSrcweir 
1118*cdf0e10cSrcweir 		pPropDataControl->Commit(pSvXPCtr->GetMyName(),
1119*cdf0e10cSrcweir 					pSvXPCtr->GetProperty(),pSvXPCtr->GetMyData());
1120*cdf0e10cSrcweir 		/*
1121*cdf0e10cSrcweir 		{
1122*cdf0e10cSrcweir 			pSvXPCtr->SetProperty(
1123*cdf0e10cSrcweir 				pPropDataControl->GetTheCorrectProperty());
1124*cdf0e10cSrcweir 		}
1125*cdf0e10cSrcweir 		*/
1126*cdf0e10cSrcweir 	}
1127*cdf0e10cSrcweir 	return 0;
1128*cdf0e10cSrcweir }
1129*cdf0e10cSrcweir 
1130*cdf0e10cSrcweir IMPL_LINK( SvListBoxForProperties, KeyInputHdl,SvXPropEvListener*, pSvXPEvL)
1131*cdf0e10cSrcweir {
1132*cdf0e10cSrcweir 		//  FIXME  - This code does not make a lot of sense.
1133*cdf0e10cSrcweir 	if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
1134*cdf0e10cSrcweir 	{
1135*cdf0e10cSrcweir 		/*SvXPropertyControl* pSvXPCtr=*/aListener.GetPropertyControl();
1136*cdf0e10cSrcweir 	}
1137*cdf0e10cSrcweir 	return 0;
1138*cdf0e10cSrcweir }
1139*cdf0e10cSrcweir 
1140*cdf0e10cSrcweir 
1141*cdf0e10cSrcweir 
1142*cdf0e10cSrcweir 
1143*cdf0e10cSrcweir SvTabPageForProperties::SvTabPageForProperties(Window* pParent,WinBits nWinStyle)
1144*cdf0e10cSrcweir 			:	TabPage(pParent,nWinStyle),
1145*cdf0e10cSrcweir 				aLbProp(this)
1146*cdf0e10cSrcweir {
1147*cdf0e10cSrcweir 	aLbProp.Show();
1148*cdf0e10cSrcweir }
1149*cdf0e10cSrcweir 
1150*cdf0e10cSrcweir void SvTabPageForProperties::Resize()
1151*cdf0e10cSrcweir {
1152*cdf0e10cSrcweir 	Point aPos(3,3);
1153*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
1154*cdf0e10cSrcweir 	aSize.Width()-=6;
1155*cdf0e10cSrcweir 	aSize.Height()-=6;
1156*cdf0e10cSrcweir 
1157*cdf0e10cSrcweir 	aLbProp.SetPosSizePixel(aPos,aSize);
1158*cdf0e10cSrcweir }
1159*cdf0e10cSrcweir 
1160*cdf0e10cSrcweir SvListBoxForProperties* SvTabPageForProperties::GetTheListBox()
1161*cdf0e10cSrcweir {
1162*cdf0e10cSrcweir 	return &aLbProp;
1163*cdf0e10cSrcweir }
1164*cdf0e10cSrcweir 
1165*cdf0e10cSrcweir 
1166*cdf0e10cSrcweir SvPropertyBox::SvPropertyBox( Window* pParent, WinBits nWinStyle)
1167*cdf0e10cSrcweir 			: Control(pParent,nWinStyle),
1168*cdf0e10cSrcweir 			  aTabControl(this)
1169*cdf0e10cSrcweir {
1170*cdf0e10cSrcweir 	aTabControl.Show();
1171*cdf0e10cSrcweir }
1172*cdf0e10cSrcweir 
1173*cdf0e10cSrcweir SvPropertyBox::SvPropertyBox( Window* pParent, const ResId& rResId )
1174*cdf0e10cSrcweir 			: Control(pParent,rResId),
1175*cdf0e10cSrcweir 			  aTabControl(this)
1176*cdf0e10cSrcweir {
1177*cdf0e10cSrcweir 	aTabControl.Show();
1178*cdf0e10cSrcweir 	Resize();
1179*cdf0e10cSrcweir }
1180*cdf0e10cSrcweir 
1181*cdf0e10cSrcweir SvPropertyBox::~SvPropertyBox()
1182*cdf0e10cSrcweir {
1183*cdf0e10cSrcweir 	ClearAll();
1184*cdf0e10cSrcweir }
1185*cdf0e10cSrcweir 
1186*cdf0e10cSrcweir 
1187*cdf0e10cSrcweir void SvPropertyBox::ClearAll()
1188*cdf0e10cSrcweir {
1189*cdf0e10cSrcweir 	sal_uInt16 nCount=aTabControl.GetPageCount();
1190*cdf0e10cSrcweir 
1191*cdf0e10cSrcweir 	for(sal_uInt16 i=nCount;i>=1;i--)
1192*cdf0e10cSrcweir 	{
1193*cdf0e10cSrcweir 		SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1194*cdf0e10cSrcweir 									aTabControl.GetTabPage(i);
1195*cdf0e10cSrcweir 		aTabControl.RemovePage(i);
1196*cdf0e10cSrcweir 		delete pPage;
1197*cdf0e10cSrcweir 	}
1198*cdf0e10cSrcweir }
1199*cdf0e10cSrcweir 
1200*cdf0e10cSrcweir 
1201*cdf0e10cSrcweir void SvPropertyBox::Resize()
1202*cdf0e10cSrcweir {
1203*cdf0e10cSrcweir 	Point aPos(3,3);
1204*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
1205*cdf0e10cSrcweir 	aSize.Width()-=6;
1206*cdf0e10cSrcweir 	aSize.Height()-=6;
1207*cdf0e10cSrcweir 
1208*cdf0e10cSrcweir 	aTabControl.SetPosSizePixel(aPos,aSize);
1209*cdf0e10cSrcweir 
1210*cdf0e10cSrcweir 	sal_uInt16 nCount=aTabControl.GetPageCount();
1211*cdf0e10cSrcweir 
1212*cdf0e10cSrcweir 	aSize=aTabControl.GetTabPageSizePixel();
1213*cdf0e10cSrcweir 	for(sal_uInt16 i=1;i<=nCount;i++)
1214*cdf0e10cSrcweir 	{
1215*cdf0e10cSrcweir 		SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1216*cdf0e10cSrcweir 									aTabControl.GetTabPage(i);
1217*cdf0e10cSrcweir 		pPage->SetSizePixel(aSize);
1218*cdf0e10cSrcweir 	}
1219*cdf0e10cSrcweir 
1220*cdf0e10cSrcweir }
1221*cdf0e10cSrcweir 
1222*cdf0e10cSrcweir 
1223*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::AppendPage( const String & rText )
1224*cdf0e10cSrcweir {
1225*cdf0e10cSrcweir 	sal_uInt16 nId=aTabControl.GetPageCount()+1;
1226*cdf0e10cSrcweir 	aTabControl.InsertPage( nId,rText);
1227*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=new SvTabPageForProperties(&aTabControl);
1228*cdf0e10cSrcweir 	pPage->SetSizePixel(aTabControl.GetTabPageSizePixel());
1229*cdf0e10cSrcweir 	pPage->GetTheListBox()->SetController(pThePropDataCtr);
1230*cdf0e10cSrcweir 	aTabControl.SetTabPage( nId, pPage);
1231*cdf0e10cSrcweir 	aTabControl.SetCurPageId(nId);
1232*cdf0e10cSrcweir 	return nId;
1233*cdf0e10cSrcweir }
1234*cdf0e10cSrcweir 
1235*cdf0e10cSrcweir void SvPropertyBox::SetPage( sal_uInt16 nId)
1236*cdf0e10cSrcweir {
1237*cdf0e10cSrcweir 	aTabControl.SetCurPageId(nId);
1238*cdf0e10cSrcweir }
1239*cdf0e10cSrcweir 
1240*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::GetCurPage()
1241*cdf0e10cSrcweir {
1242*cdf0e10cSrcweir 	return aTabControl.GetCurPageId();
1243*cdf0e10cSrcweir }
1244*cdf0e10cSrcweir 
1245*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::CalcVisibleLines()
1246*cdf0e10cSrcweir {
1247*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1248*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1249*cdf0e10cSrcweir 	return pPage->GetTheListBox()->CalcVisibleLines();
1250*cdf0e10cSrcweir }
1251*cdf0e10cSrcweir void SvPropertyBox::EnableUpdate()
1252*cdf0e10cSrcweir {
1253*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1254*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1255*cdf0e10cSrcweir 	pPage->GetTheListBox()->EnableUpdate();
1256*cdf0e10cSrcweir }
1257*cdf0e10cSrcweir 
1258*cdf0e10cSrcweir void SvPropertyBox::DisableUpdate()
1259*cdf0e10cSrcweir {
1260*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1261*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1262*cdf0e10cSrcweir 	pPage->GetTheListBox()->DisableUpdate();
1263*cdf0e10cSrcweir }
1264*cdf0e10cSrcweir 
1265*cdf0e10cSrcweir void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr)
1266*cdf0e10cSrcweir {
1267*cdf0e10cSrcweir 	pThePropDataCtr=pDataCtr;
1268*cdf0e10cSrcweir 	sal_uInt16 nCount=aTabControl.GetPageCount();
1269*cdf0e10cSrcweir 
1270*cdf0e10cSrcweir 	for(sal_uInt16 i=1;i<=nCount;i++)
1271*cdf0e10cSrcweir 	{
1272*cdf0e10cSrcweir 		SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1273*cdf0e10cSrcweir 									aTabControl.GetTabPage(i);
1274*cdf0e10cSrcweir 
1275*cdf0e10cSrcweir 		pPage->GetTheListBox()->SetController(pThePropDataCtr);
1276*cdf0e10cSrcweir 	}
1277*cdf0e10cSrcweir 
1278*cdf0e10cSrcweir }
1279*cdf0e10cSrcweir 
1280*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::InsertEntry( const SvPropertyData& rData, sal_uInt16 nPos)
1281*cdf0e10cSrcweir {
1282*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1283*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1284*cdf0e10cSrcweir 	return pPage->GetTheListBox()->InsertEntry(rData,nPos);
1285*cdf0e10cSrcweir }
1286*cdf0e10cSrcweir 
1287*cdf0e10cSrcweir void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, sal_uInt16 nPos)
1288*cdf0e10cSrcweir {
1289*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1290*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1291*cdf0e10cSrcweir 	pPage->GetTheListBox()->ChangeEntry(rData,nPos);
1292*cdf0e10cSrcweir }
1293*cdf0e10cSrcweir 
1294*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::AppendEntry( const SvPropertyData& rData)
1295*cdf0e10cSrcweir {
1296*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1297*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1298*cdf0e10cSrcweir 	return pPage->GetTheListBox()->AppendEntry(rData);
1299*cdf0e10cSrcweir }
1300*cdf0e10cSrcweir 
1301*cdf0e10cSrcweir void SvPropertyBox::SetPropertyValue( const String & rEntryName, const String & rValue )
1302*cdf0e10cSrcweir {
1303*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1304*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1305*cdf0e10cSrcweir 	pPage->GetTheListBox()->SetPropertyValue( rEntryName, rValue );
1306*cdf0e10cSrcweir }
1307*cdf0e10cSrcweir 
1308*cdf0e10cSrcweir void SvPropertyBox::SetFirstVisibleEntry(sal_uInt16 nPos)
1309*cdf0e10cSrcweir {
1310*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1311*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1312*cdf0e10cSrcweir 	pPage->GetTheListBox()->SetFirstVisibleEntry(nPos);
1313*cdf0e10cSrcweir }
1314*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::GetFirstVisibleEntry()
1315*cdf0e10cSrcweir {
1316*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1317*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1318*cdf0e10cSrcweir 	return pPage->GetTheListBox()->GetFirstVisibleEntry();
1319*cdf0e10cSrcweir }
1320*cdf0e10cSrcweir 
1321*cdf0e10cSrcweir void SvPropertyBox::SetSelectedEntry(sal_uInt16 nPos)
1322*cdf0e10cSrcweir {
1323*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1324*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1325*cdf0e10cSrcweir 	pPage->GetTheListBox()->SetSelectedEntry(nPos);
1326*cdf0e10cSrcweir }
1327*cdf0e10cSrcweir sal_uInt16 SvPropertyBox::GetSelectedEntry()
1328*cdf0e10cSrcweir {
1329*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1330*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1331*cdf0e10cSrcweir 	return pPage->GetTheListBox()->GetSelectedEntry();
1332*cdf0e10cSrcweir }
1333*cdf0e10cSrcweir 
1334*cdf0e10cSrcweir void SvPropertyBox::ClearTable()
1335*cdf0e10cSrcweir {
1336*cdf0e10cSrcweir 	SvTabPageForProperties* pPage=(SvTabPageForProperties*)
1337*cdf0e10cSrcweir 				aTabControl.GetTabPage(aTabControl.GetCurPageId());
1338*cdf0e10cSrcweir 	pPage->GetTheListBox()->Clear();
1339*cdf0e10cSrcweir }
1340*cdf0e10cSrcweir 
1341*cdf0e10cSrcweir SvBasicPropertyDataControl::~SvBasicPropertyDataControl()
1342*cdf0e10cSrcweir {
1343*cdf0e10cSrcweir }
1344*cdf0e10cSrcweir 
1345*cdf0e10cSrcweir void SvBasicPropertyDataControl::Modified(const String& aName,
1346*cdf0e10cSrcweir 								const String& aVal,void* pData)
1347*cdf0e10cSrcweir {
1348*cdf0e10cSrcweir 	aEntryName=aName;
1349*cdf0e10cSrcweir 	aEntryProperty=aVal;
1350*cdf0e10cSrcweir 	pTheData=pData;
1351*cdf0e10cSrcweir 	aModifyLink.Call(this);
1352*cdf0e10cSrcweir }
1353*cdf0e10cSrcweir 
1354*cdf0e10cSrcweir void SvBasicPropertyDataControl::Clicked(	const String& aName,
1355*cdf0e10cSrcweir 									const String& aVal,
1356*cdf0e10cSrcweir 									void* pData)		//Xtension-Button pressed
1357*cdf0e10cSrcweir {
1358*cdf0e10cSrcweir 	aEntryName=aName;
1359*cdf0e10cSrcweir 	aEntryProperty=aVal;
1360*cdf0e10cSrcweir 	pTheData=pData;
1361*cdf0e10cSrcweir 	aClickedLink.Call(this);
1362*cdf0e10cSrcweir }
1363*cdf0e10cSrcweir 
1364*cdf0e10cSrcweir void SvBasicPropertyDataControl::Commit(		const String& aName,
1365*cdf0e10cSrcweir 									const String& aVal,
1366*cdf0e10cSrcweir 									void* pData)		//User accept changes
1367*cdf0e10cSrcweir {
1368*cdf0e10cSrcweir 	aEntryName=aName;
1369*cdf0e10cSrcweir 	aEntryProperty=aVal;
1370*cdf0e10cSrcweir 	pTheData=pData;
1371*cdf0e10cSrcweir 	aCommitLink.Call(this);
1372*cdf0e10cSrcweir }
1373*cdf0e10cSrcweir 
1374*cdf0e10cSrcweir void SvBasicPropertyDataControl::Select(		const String& aName,
1375*cdf0e10cSrcweir 									void* pData)		//User select new Row
1376*cdf0e10cSrcweir {
1377*cdf0e10cSrcweir 	aEntryName=aName;
1378*cdf0e10cSrcweir 	pTheData=pData;
1379*cdf0e10cSrcweir 	aSelectLink.Call(this);
1380*cdf0e10cSrcweir }
1381*cdf0e10cSrcweir 
1382*cdf0e10cSrcweir void SvBasicPropertyDataControl::LinkClicked(const String&, void*)
1383*cdf0e10cSrcweir {
1384*cdf0e10cSrcweir }
1385*cdf0e10cSrcweir 
1386*cdf0e10cSrcweir 
1387*cdf0e10cSrcweir String	SvBasicPropertyDataControl::GetName() const //Tell's the name of the Property
1388*cdf0e10cSrcweir {
1389*cdf0e10cSrcweir 	return aEntryName;
1390*cdf0e10cSrcweir }
1391*cdf0e10cSrcweir 
1392*cdf0e10cSrcweir String	SvBasicPropertyDataControl::GetProperty() const //Tell's the content of the Property
1393*cdf0e10cSrcweir {
1394*cdf0e10cSrcweir 	return aEntryProperty;
1395*cdf0e10cSrcweir }
1396*cdf0e10cSrcweir 
1397*cdf0e10cSrcweir void*	SvBasicPropertyDataControl::GetData() //Tell's the storage
1398*cdf0e10cSrcweir {
1399*cdf0e10cSrcweir 	return pTheData;
1400*cdf0e10cSrcweir }
1401*cdf0e10cSrcweir 
1402*cdf0e10cSrcweir /*
1403*cdf0e10cSrcweir String SvBasicPropertyDataControl::GetTheCorrectProperty() const
1404*cdf0e10cSrcweir {
1405*cdf0e10cSrcweir 	return aCorrectProperty;
1406*cdf0e10cSrcweir }
1407*cdf0e10cSrcweir */
1408*cdf0e10cSrcweir 
1409*cdf0e10cSrcweir void SvBasicPropertyDataControl::SetTheCorrectProperty(const String& aString)
1410*cdf0e10cSrcweir {
1411*cdf0e10cSrcweir 	aCorrectProperty=aString;
1412*cdf0e10cSrcweir }
1413*cdf0e10cSrcweir 
1414*cdf0e10cSrcweir void SvBasicPropertyDataControl::SetIsCorrect(sal_Bool nFlag)
1415*cdf0e10cSrcweir {
1416*cdf0e10cSrcweir 	bCorrectness=nFlag;
1417*cdf0e10cSrcweir }
1418*cdf0e10cSrcweir 
1419*cdf0e10cSrcweir 
1420*cdf0e10cSrcweir 
1421*cdf0e10cSrcweir //========================================================================
1422*cdf0e10cSrcweir // Property-Dialog:
1423*cdf0e10cSrcweir /* zum TESTEN im CALC*/
1424*cdf0e10cSrcweir //========================================================================
1425*cdf0e10cSrcweir /*
1426*cdf0e10cSrcweir ScPropertyDlg::ScPropertyDlg( Window* pParent) :
1427*cdf0e10cSrcweir 	ModalDialog 	( pParent, ScResId( RID_SCDLG_PROPERTIES) ),
1428*cdf0e10cSrcweir 	aPropListBox	( this, ResId( CTR_PROPLINE) ),
1429*cdf0e10cSrcweir 	aKindOfListBox	(this,ResId( LB_KIND_OF_PROP)),
1430*cdf0e10cSrcweir 	aModAnswer		(this,ResId(FT_ANSMOD	)),
1431*cdf0e10cSrcweir 	aClickAnswer	(this,ResId(FT_ANSCLICK )),
1432*cdf0e10cSrcweir 	aCommitAnswer	(this,ResId(FT_ANSCOMMIT)),
1433*cdf0e10cSrcweir 	aSelectAnswer	(this,ResId(FT_ANSSELECT)),
1434*cdf0e10cSrcweir 	anOk(this,ResId( BTN_OK)),
1435*cdf0e10cSrcweir 	aCancel(this,ResId( BTN_CANCEL))
1436*cdf0e10cSrcweir {
1437*cdf0e10cSrcweir 	FreeResource();
1438*cdf0e10cSrcweir 
1439*cdf0e10cSrcweir 	aKindOfListBox.SelectEntryPos(0);
1440*cdf0e10cSrcweir 	aKindOfListBox.SetSelectHdl(
1441*cdf0e10cSrcweir 		LINK( this, ScPropertyDlg, ModifiedHdl ));
1442*cdf0e10cSrcweir 	nCount=0;
1443*cdf0e10cSrcweir 	nClickCount=0;
1444*cdf0e10cSrcweir 
1445*cdf0e10cSrcweir 	String aString("Don't know ");
1446*cdf0e10cSrcweir 
1447*cdf0e10cSrcweir 	aBaProDatCtr.SetModifyHdl (LINK( this, ScPropertyDlg, RowModifiedHdl ));
1448*cdf0e10cSrcweir 	aBaProDatCtr.SetClickedHdl(LINK( this, ScPropertyDlg, ClickHdl		 ));
1449*cdf0e10cSrcweir 	aBaProDatCtr.SetCommitHdl (LINK( this, ScPropertyDlg, SelectHdl 	 ));
1450*cdf0e10cSrcweir 	aBaProDatCtr.SetSelectHdl (LINK( this, ScPropertyDlg, CommitHdl 	 ));
1451*cdf0e10cSrcweir 
1452*cdf0e10cSrcweir 	aPropListBox.SetController(&aBaProDatCtr);
1453*cdf0e10cSrcweir 
1454*cdf0e10cSrcweir 	sal_uInt16 nPageId=aPropListBox.AppendPage("YabbaDabbaDo");
1455*cdf0e10cSrcweir 	aPropListBox.SetPage(nPageId);
1456*cdf0e10cSrcweir 	aProperty.eKind=KOC_EDIT;
1457*cdf0e10cSrcweir 	aProperty.aName=aString;
1458*cdf0e10cSrcweir 	aProperty.aName+=String((sal_uInt16)++nCount);
1459*cdf0e10cSrcweir 	aProperty.aValue=sizeof ComboBox;
1460*cdf0e10cSrcweir 	aProperty.bHasVisibleXButton=sal_False;
1461*cdf0e10cSrcweir 	aProperty.bIsHyperLink=sal_False;
1462*cdf0e10cSrcweir 	aProperty.bIsLocked=sal_False;
1463*cdf0e10cSrcweir 	aProperty.pDataPtr=NULL;
1464*cdf0e10cSrcweir 	aProperty.pControl=NULL;
1465*cdf0e10cSrcweir 	aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count());
1466*cdf0e10cSrcweir 	aProperty.theValues.Insert(new String("2"),aProperty.theValues.Count());
1467*cdf0e10cSrcweir 	aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count());
1468*cdf0e10cSrcweir 	aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count());
1469*cdf0e10cSrcweir 	aPropListBox.InsertEntry(aProperty);
1470*cdf0e10cSrcweir 	aProperty.bHasVisibleXButton=sal_True;
1471*cdf0e10cSrcweir 	aProperty.aName=aString;
1472*cdf0e10cSrcweir 	aProperty.aName+=String((sal_uInt16)++nCount);
1473*cdf0e10cSrcweir 	aProperty.aValue="42";
1474*cdf0e10cSrcweir 	aProperty.eKind=KOC_LISTBOX;
1475*cdf0e10cSrcweir 	aPropListBox.InsertEntry(aProperty);
1476*cdf0e10cSrcweir 	aProperty.aName=aString;
1477*cdf0e10cSrcweir 	aProperty.aName+=String((sal_uInt16)++nCount);
1478*cdf0e10cSrcweir 	aProperty.eKind=KOC_COMBOBOX;
1479*cdf0e10cSrcweir 	aProperty.bHasVisibleXButton=sal_False;
1480*cdf0e10cSrcweir 	aPropListBox.InsertEntry(aProperty);
1481*cdf0e10cSrcweir }
1482*cdf0e10cSrcweir 
1483*cdf0e10cSrcweir ScPropertyDlg::~ScPropertyDlg()
1484*cdf0e10cSrcweir {
1485*cdf0e10cSrcweir 	delete aProperty.theValues[0];
1486*cdf0e10cSrcweir 	delete aProperty.theValues[1];
1487*cdf0e10cSrcweir 	delete aProperty.theValues[2];
1488*cdf0e10cSrcweir 	delete aProperty.theValues[3];
1489*cdf0e10cSrcweir }
1490*cdf0e10cSrcweir 
1491*cdf0e10cSrcweir IMPL_LINK( ScPropertyDlg, ModifiedHdl, ListBox*, pLB )
1492*cdf0e10cSrcweir {
1493*cdf0e10cSrcweir 	if(pLB!=NULL)
1494*cdf0e10cSrcweir 	{
1495*cdf0e10cSrcweir 		String aString("Don't know ");
1496*cdf0e10cSrcweir 		aProperty.aName=aString;
1497*cdf0e10cSrcweir 		aProperty.aName+=String((sal_uInt16)++nCount);
1498*cdf0e10cSrcweir 		if(nCount>20)
1499*cdf0e10cSrcweir 		{
1500*cdf0e10cSrcweir 			String aStr("Yabba ");
1501*cdf0e10cSrcweir 			aStr+=aPropListBox.GetCurPage();
1502*cdf0e10cSrcweir 			sal_uInt16 nPageId=aPropListBox.AppendPage(aStr);
1503*cdf0e10cSrcweir 			aPropListBox.SetPage(nPageId);
1504*cdf0e10cSrcweir 			nCount=0;
1505*cdf0e10cSrcweir 		}
1506*cdf0e10cSrcweir 
1507*cdf0e10cSrcweir 		aProperty.eKind=(eKindOfControl)(aKindOfListBox.GetSelectEntryPos()+1);
1508*cdf0e10cSrcweir 		aProperty.bHasVisibleXButton=sal_False;
1509*cdf0e10cSrcweir 		if((nCount % 5)==0) aProperty.bHasVisibleXButton=sal_True;
1510*cdf0e10cSrcweir 		aPropListBox.InsertEntry(aProperty);
1511*cdf0e10cSrcweir 	}
1512*cdf0e10cSrcweir 	return 0;
1513*cdf0e10cSrcweir }
1514*cdf0e10cSrcweir 
1515*cdf0e10cSrcweir IMPL_LINK( ScPropertyDlg, RowModifiedHdl, SvBasicPropertyDataControl* ,pProCtr)
1516*cdf0e10cSrcweir {
1517*cdf0e10cSrcweir 	if(pProCtr!=NULL)
1518*cdf0e10cSrcweir 	{
1519*cdf0e10cSrcweir 		aModAnswer.SetText(aBaProDatCtr.GetProperty());
1520*cdf0e10cSrcweir 		aModAnswer.Invalidate();
1521*cdf0e10cSrcweir 		aBaProDatCtr.SetIsCorrect(sal_True);
1522*cdf0e10cSrcweir 	}
1523*cdf0e10cSrcweir 	return 0;
1524*cdf0e10cSrcweir }
1525*cdf0e10cSrcweir 
1526*cdf0e10cSrcweir IMPL_LINK( ScPropertyDlg, CommitHdl, SvBasicPropertyDataControl*,pProCtr)
1527*cdf0e10cSrcweir {
1528*cdf0e10cSrcweir 	if(pProCtr!=NULL)
1529*cdf0e10cSrcweir 	{
1530*cdf0e10cSrcweir 		aCommitAnswer.SetText(aBaProDatCtr.GetProperty());
1531*cdf0e10cSrcweir 		aCommitAnswer.Invalidate();
1532*cdf0e10cSrcweir 		aBaProDatCtr.SetIsCorrect(sal_True);
1533*cdf0e10cSrcweir 	}
1534*cdf0e10cSrcweir 	return 0;
1535*cdf0e10cSrcweir }
1536*cdf0e10cSrcweir 
1537*cdf0e10cSrcweir IMPL_LINK( ScPropertyDlg, ClickHdl, SvBasicPropertyDataControl*,pProCtr)
1538*cdf0e10cSrcweir {
1539*cdf0e10cSrcweir 	if(pProCtr!=NULL)
1540*cdf0e10cSrcweir 	{
1541*cdf0e10cSrcweir 		aClickAnswer.SetText(aBaProDatCtr.GetName());
1542*cdf0e10cSrcweir 		aClickAnswer.Invalidate();
1543*cdf0e10cSrcweir 		aBaProDatCtr.SetIsCorrect(sal_True);
1544*cdf0e10cSrcweir 	}
1545*cdf0e10cSrcweir 	return 0;
1546*cdf0e10cSrcweir }
1547*cdf0e10cSrcweir 
1548*cdf0e10cSrcweir IMPL_LINK( ScPropertyDlg, SelectHdl, SvBasicPropertyDataControl*,pProCtr)
1549*cdf0e10cSrcweir {
1550*cdf0e10cSrcweir 	if(pProCtr!=NULL)
1551*cdf0e10cSrcweir 	{
1552*cdf0e10cSrcweir 		aSelectAnswer.SetText(aBaProDatCtr.GetName());
1553*cdf0e10cSrcweir 		aSelectAnswer.Invalidate();
1554*cdf0e10cSrcweir 		aBaProDatCtr.SetIsCorrect(sal_True);
1555*cdf0e10cSrcweir 	}
1556*cdf0e10cSrcweir 	return 0;
1557*cdf0e10cSrcweir }
1558*cdf0e10cSrcweir */
1559*cdf0e10cSrcweir 
1560*cdf0e10cSrcweir 
1561