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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 
27 // include ---------------------------------------------------------------
28 
29 #include <string> // HACK: prevent conflict between STLPORT and Workshop headers
30 
31 #include <vos/mutex.hxx>
32 
33 #include <svtools/toolbarmenu.hxx>
34 #include <vcl/toolbox.hxx>
35 #include <sfx2/app.hxx>
36 #include <sfx2/dispatch.hxx>
37 #include <sfx2/objsh.hxx>
38 #include <svl/eitem.hxx>
39 #include <vcl/settings.hxx>
40 #include <svl/intitem.hxx>
41 #include <editeng/colritem.hxx>
42 #include <tools/urlobj.hxx>
43 
44 #include <svx/dialogs.hrc>
45 #include <svx/svdtrans.hxx>
46 #include <svx/sdasitm.hxx>
47 #include <svx/dialmgr.hxx>
48 #include "svx/extrusioncolorcontrol.hxx"
49 
50 //#include "chrtitem.hxx"
51 #include "helpid.hrc"
52 #include "extrusioncontrols.hxx"
53 #include "extrusioncontrols.hrc"
54 #include "colorwindow.hxx"
55 #include "extrusiondepthdialog.hxx"
56 
57 ////////////
58 
59 using ::rtl::OUString;
60 //using ::svtools::ToolbarMenu;
61 
62 using namespace ::com::sun::star;
63 using namespace ::com::sun::star::uno;
64 using namespace ::com::sun::star::lang;
65 using namespace ::com::sun::star::beans;
66 using namespace ::com::sun::star::util;
67 using namespace ::com::sun::star::graphic;
68 
69 namespace svx
70 {
71 
72 /*************************************************************************
73 |*
74 |* ExtrusionDirectionWindow
75 |*
76 \************************************************************************/
77 
78 static sal_Int32 gSkewList[] = { 135, 90, 45, 180, 0, -360, -135, -90, -45 };
79 
ExtrusionDirectionWindow(svt::ToolboxController & rController,const::com::sun::star::uno::Reference<::com::sun::star::frame::XFrame> & rFrame,Window * pParentWindow)80 ExtrusionDirectionWindow::ExtrusionDirectionWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
81 : ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_DIRECTION ))
82 , mrController( rController )
83 , maImgPerspective( SVX_RES( IMG_PERSPECTIVE ) )
84 , maImgPerspectiveH( SVX_RES( IMG_PERSPECTIVE_H ) )
85 , maImgParallel( SVX_RES( IMG_PARALLEL ) )
86 , maImgParallelH( SVX_RES( IMG_PARALLEL_H ) )
87 , msExtrusionDirection( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirection" ) )
88 , msExtrusionProjection( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionProjection" ) )
89 {
90 	SetHelpId( HID_MENU_EXTRUSION_DIRECTION );
91 
92 	sal_uInt16 i;
93 	for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
94 	{
95 		maImgDirection[i] = Image( SVX_RES( IMG_DIRECTION + i ) );
96 		maImgDirectionH[i] = Image( SVX_RES( IMG_DIRECTION_H + i ) );
97 	}
98 
99 	SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
100 	mpDirectionSet = createEmptyValueSetControl();
101 	mpDirectionSet->SetHelpId( HID_VALUESET_EXTRUSION_DIRECTION );
102 
103 	mpDirectionSet->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) );
104 	mpDirectionSet->SetColCount( 3 );
105 	mpDirectionSet->EnableFullItemMode( sal_False );
106 
107 	bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
108 
109 	for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
110 	{
111 		String aText( SVX_RES( STR_DIRECTION + i ) );
112 		mpDirectionSet->InsertItem( i+1, bHighContrast ? maImgDirectionH[ i ] : maImgDirection[ i ], aText );
113 	}
114 
115 	mpDirectionSet->SetOutputSizePixel( Size( 72, 72 ) );
116 
117 	appendEntry( 2, mpDirectionSet );
118 	appendSeparator();
119 	appendEntry( 0, String( SVX_RES( STR_PERSPECTIVE ) ), bHighContrast ? maImgPerspectiveH : maImgPerspective );
120 	appendEntry( 1, String( SVX_RES( STR_PARALLEL ) ), bHighContrast ? maImgParallelH : maImgParallel );
121 
122 	SetOutputSizePixel( getMenuSize() );
123 
124 	FreeResource();
125 
126     AddStatusListener( msExtrusionDirection );
127     AddStatusListener( msExtrusionProjection );
128 }
129 
DataChanged(const DataChangedEvent & rDCEvt)130 void ExtrusionDirectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
131 {
132 	ToolbarMenu::DataChanged( rDCEvt );
133 
134 	if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
135 	{
136 		bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
137 
138 		for( sal_uInt16 i = DIRECTION_NW; i <= DIRECTION_SE; i++ )
139 		{
140 			mpDirectionSet->SetItemImage( i+1, bHighContrast ? maImgDirectionH[ i ] : maImgDirection[ i ] );
141 		}
142 
143 		setEntryImage( 0, bHighContrast ? maImgPerspectiveH : maImgPerspective );
144 		setEntryImage( 1, bHighContrast ? maImgParallelH : maImgParallel );
145 	}
146 }
147 
148 // -----------------------------------------------------------------------
149 
implSetDirection(sal_Int32 nSkew,bool bEnabled)150 void ExtrusionDirectionWindow::implSetDirection( sal_Int32 nSkew, bool bEnabled )
151 {
152 	if( mpDirectionSet )
153 	{
154 		sal_uInt16 nItemId;
155 		for( nItemId = DIRECTION_NW; nItemId <= DIRECTION_SE; nItemId++ )
156 		{
157 			if( gSkewList[nItemId] == nSkew )
158 				break;
159 		}
160 
161 		if( nItemId <= DIRECTION_SE )
162 		{
163 			mpDirectionSet->SelectItem( nItemId+1 );
164 		}
165 		else
166 		{
167 			mpDirectionSet->SetNoSelection();
168 		}
169 	}
170 	enableEntry( 2, bEnabled );
171 }
172 
173 // -----------------------------------------------------------------------
174 
implSetProjection(sal_Int32 nProjection,bool bEnabled)175 void ExtrusionDirectionWindow::implSetProjection( sal_Int32 nProjection, bool bEnabled )
176 {
177 	checkEntry( 0, (nProjection == 0) && bEnabled );
178 	checkEntry( 1, (nProjection == 1 ) && bEnabled );
179 	enableEntry( 0, bEnabled );
180 	enableEntry( 1, bEnabled );
181 }
182 
183 // -----------------------------------------------------------------------
184 
statusChanged(const::com::sun::star::frame::FeatureStateEvent & Event)185 void SAL_CALL ExtrusionDirectionWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
186 {
187 	if( Event.FeatureURL.Main.equals( msExtrusionDirection ) )
188 	{
189 		if( !Event.IsEnabled )
190 		{
191 			implSetDirection( -1, false );
192 		}
193 		else
194 		{
195 			sal_Int32 nValue = 0;
196 			if( Event.State >>= nValue )
197 				implSetDirection( nValue, true );
198 		}
199 	}
200 	else if( Event.FeatureURL.Main.equals( msExtrusionProjection ) )
201 	{
202 		if( !Event.IsEnabled )
203 		{
204 			implSetProjection( -1, false );
205 		}
206 		else
207 		{
208 			sal_Int32 nValue = 0;
209 			if( Event.State >>= nValue )
210 				implSetProjection( nValue, true );
211 		}
212 	}
213 }
214 
215 // -----------------------------------------------------------------------
216 
IMPL_LINK(ExtrusionDirectionWindow,SelectHdl,void *,pControl)217 IMPL_LINK( ExtrusionDirectionWindow, SelectHdl, void *, pControl )
218 {
219 	if ( IsInPopupMode() )
220 		EndPopupMode();
221 
222 	if( pControl == mpDirectionSet )
223 	{
224         Sequence< PropertyValue > aArgs( 1 );
225         aArgs[0].Name = msExtrusionDirection.copy(5);
226         aArgs[0].Value <<= (sal_Int32)gSkewList[mpDirectionSet->GetSelectItemId()-1];
227 
228 		mrController.dispatchCommand( msExtrusionDirection, aArgs );
229 	}
230 	else
231 	{
232 		int nProjection = getSelectedEntryId();
233 		if( (nProjection >= 0) && (nProjection < 2 ) )
234 		{
235             Sequence< PropertyValue > aArgs( 1 );
236             aArgs[0].Name = msExtrusionProjection.copy(5);
237             aArgs[0].Value <<= (sal_Int32)nProjection;
238 
239 			mrController.dispatchCommand( msExtrusionProjection, aArgs );
240             implSetProjection( nProjection, true );
241 		}
242 	}
243 
244 	return 0;
245 }
246 
247 // =======================================================================
248 // ExtrusionDirectionControl
249 // =======================================================================
250 
ExtrusionDirectionControl(const Reference<lang::XMultiServiceFactory> & rServiceManager)251 ExtrusionDirectionControl::ExtrusionDirectionControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
252 : svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirectionFloater" ) ) )
253 {
254 }
255 
256 // -----------------------------------------------------------------------
257 
createPopupWindow(::Window * pParent)258 ::Window* ExtrusionDirectionControl::createPopupWindow( ::Window* pParent )
259 {
260     return new ExtrusionDirectionWindow( *this, m_xFrame, pParent );
261 }
262 
263 // -----------------------------------------------------------------------
264 // XServiceInfo
265 // -----------------------------------------------------------------------
266 
ExtrusionDirectionControl_getImplementationName()267 OUString SAL_CALL ExtrusionDirectionControl_getImplementationName()
268 {
269 	return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionDirectionController" ));
270 }
271 
272 // --------------------------------------------------------------------
273 
ExtrusionDirectionControl_getSupportedServiceNames()274 Sequence< OUString > SAL_CALL ExtrusionDirectionControl_getSupportedServiceNames() throw( RuntimeException )
275 {
276     Sequence< OUString > aSNS( 1 );
277     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
278     return aSNS;
279 }
280 
281 // --------------------------------------------------------------------
282 
ExtrusionDirectionControl_createInstance(const Reference<XMultiServiceFactory> & rSMgr)283 Reference< XInterface > SAL_CALL SAL_CALL ExtrusionDirectionControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
284 {
285 	return *new ExtrusionDirectionControl( rSMgr );
286 }
287 
288 // --------------------------------------------------------------------
289 
getImplementationName()290 OUString SAL_CALL ExtrusionDirectionControl::getImplementationName(  ) throw (RuntimeException)
291 {
292 	return ExtrusionDirectionControl_getImplementationName();
293 }
294 
295 // --------------------------------------------------------------------
296 
getSupportedServiceNames()297 Sequence< OUString > SAL_CALL ExtrusionDirectionControl::getSupportedServiceNames(  ) throw (RuntimeException)
298 {
299 	return ExtrusionDirectionControl_getSupportedServiceNames();
300 }
301 
302 // ####################################################################
303 
ExtrusionDepthDialog(Window * pParent,double fDepth,FieldUnit eDefaultUnit)304 ExtrusionDepthDialog::ExtrusionDepthDialog( Window* pParent, double fDepth, FieldUnit eDefaultUnit )
305 :	ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_EXTRUSION_DEPTH ) ),
306 	maFLDepth( this, SVX_RES( FL_DEPTH ) ),
307 	maMtrDepth( this, SVX_RES( MTR_DEPTH ) ),
308 	maOKButton( this, SVX_RES( BTN_OK ) ),
309 	maCancelButton( this, SVX_RES( BTN_CANCEL ) ),
310 	maHelpButton( this, SVX_RES( BTN_HELP ) )
311 {
312 	bool bMetric = IsMetric( eDefaultUnit );
313 	maMtrDepth.SetUnit( bMetric ? FUNIT_CM : FUNIT_INCH );
314 	maMtrDepth.SetValue( (int) fDepth * 100, FUNIT_100TH_MM );
315 
316 	FreeResource();
317 }
318 
~ExtrusionDepthDialog()319 ExtrusionDepthDialog::~ExtrusionDepthDialog()
320 {
321 }
322 
getDepth() const323 double ExtrusionDepthDialog::getDepth() const
324 {
325 //	bool bMetric = IsMetric( meDefaultUnit );
326 	return (double)( maMtrDepth.GetValue( FUNIT_100TH_MM ) ) / 100.0;
327 }
328 
329 // ####################################################################
330 
331 double aDepthListInch[] = { 0, 1270,2540,5080,10160 };
332 double aDepthListMM[] = { 0, 1000, 2500, 5000, 10000 };
333 
ExtrusionDepthWindow(svt::ToolboxController & rController,const::com::sun::star::uno::Reference<::com::sun::star::frame::XFrame> & rFrame,Window * pParentWindow)334 ExtrusionDepthWindow::ExtrusionDepthWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
335 : ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_DEPTH ))
336 , mrController( rController )
337 , maImgDepth0( SVX_RES( IMG_DEPTH_0 ) )
338 , maImgDepth1( SVX_RES( IMG_DEPTH_1 ) )
339 , maImgDepth2( SVX_RES( IMG_DEPTH_2 ) )
340 , maImgDepth3( SVX_RES( IMG_DEPTH_3 ) )
341 , maImgDepth4( SVX_RES( IMG_DEPTH_4 ) )
342 , maImgDepthInfinity( SVX_RES( IMG_DEPTH_INFINITY ) )
343 , maImgDepth0h( SVX_RES( IMG_DEPTH_0_H ) )
344 , maImgDepth1h( SVX_RES( IMG_DEPTH_1_H ) )
345 , maImgDepth2h( SVX_RES( IMG_DEPTH_2_H ) )
346 , maImgDepth3h( SVX_RES( IMG_DEPTH_3_H ) )
347 , maImgDepth4h( SVX_RES( IMG_DEPTH_4_H ) )
348 , maImgDepthInfinityh( SVX_RES( IMG_DEPTH_INFINITY_H ) )
349 , mfDepth( -1.0 )
350 , msExtrusionDepth( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepth" ) )
351 , msMetricUnit( RTL_CONSTASCII_USTRINGPARAM( ".uno:MetricUnit" ) )
352 {
353 	SetHelpId( HID_MENU_EXTRUSION_DEPTH );
354 
355 	SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) );
356 
357 	bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
358 
359 	String aEmpty;
360 	appendEntry( 0, aEmpty, bHighContrast ? maImgDepth0h : maImgDepth0 );
361 	appendEntry( 1, aEmpty, bHighContrast ? maImgDepth1h : maImgDepth1 );
362 	appendEntry( 2, aEmpty, bHighContrast ? maImgDepth2h : maImgDepth2 );
363 	appendEntry( 3, aEmpty, bHighContrast ? maImgDepth3h : maImgDepth3 );
364 	appendEntry( 4, aEmpty, bHighContrast ? maImgDepth4h : maImgDepth4 );
365 	appendEntry( 5, String( SVX_RES( STR_INFINITY ) ), bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
366 	appendEntry( 6, String( SVX_RES( STR_CUSTOM ) ) );
367 
368 	SetOutputSizePixel( getMenuSize() );
369 
370 	FreeResource();
371 
372     AddStatusListener( msExtrusionDepth );
373     AddStatusListener( msMetricUnit );
374 }
375 
376 // -----------------------------------------------------------------------
377 
implSetDepth(double fDepth)378 void ExtrusionDepthWindow::implSetDepth( double fDepth )
379 {
380 	mfDepth = fDepth;
381 	int i;
382 	for( i = 0; i < 7; i++ )
383 	{
384 		if( i == 5 )
385 		{
386 			checkEntry( i, fDepth >= 338666 );
387 		}
388 		else if( i != 6 )
389 		{
390 			checkEntry( i, (fDepth == (IsMetric( meUnit ) ? aDepthListMM[i] : aDepthListInch[i]) ) );
391 		}
392 	}
393 }
394 
395 // -----------------------------------------------------------------------
396 
implFillStrings(FieldUnit eUnit)397 void ExtrusionDepthWindow::implFillStrings( FieldUnit eUnit )
398 {
399 	meUnit = eUnit;
400 	sal_uInt16 nResource = IsMetric( eUnit ) ? RID_SVXSTR_DEPTH_0 : RID_SVXSTR_DEPTH_0_INCH;
401 
402 	for( int i = 0; i < 5; i++ )
403 	{
404 		String aStr( SVX_RES( nResource + i ) );
405 		setEntryText( i, aStr );
406 	};
407 }
408 
409 // -----------------------------------------------------------------------
410 
statusChanged(const::com::sun::star::frame::FeatureStateEvent & Event)411 void SAL_CALL ExtrusionDepthWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
412 {
413 	if( Event.FeatureURL.Main.equals( msExtrusionDepth ) )
414 	{
415 		if( !Event.IsEnabled )
416 		{
417 			implSetDepth( 0 );
418 		}
419 		else
420 		{
421 			double fValue = 0.0;
422 			if( Event.State >>= fValue )
423 				implSetDepth( fValue );
424 		}
425 	}
426 	else if( Event.FeatureURL.Main.equals( msMetricUnit ) )
427 	{
428 		if( Event.IsEnabled )
429 		{
430 			sal_Int32 nValue = 0;
431 			if( Event.State >>= nValue )
432 			{
433 				implFillStrings( static_cast<FieldUnit>(nValue) );
434 				if( mfDepth >= 0.0 )
435 					implSetDepth( mfDepth );
436 			}
437 		}
438 	}
439 }
440 
441 // -----------------------------------------------------------------------
442 
DataChanged(const DataChangedEvent & rDCEvt)443 void ExtrusionDepthWindow::DataChanged( const DataChangedEvent& rDCEvt )
444 {
445 	ToolbarMenu::DataChanged( rDCEvt );
446 
447 	if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
448 	{
449 		bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
450 
451 		setEntryImage( 0, bHighContrast ? maImgDepth0h : maImgDepth0 );
452 		setEntryImage( 1, bHighContrast ? maImgDepth1h : maImgDepth1 );
453 		setEntryImage( 2, bHighContrast ? maImgDepth2h : maImgDepth2 );
454 		setEntryImage( 3, bHighContrast ? maImgDepth3h : maImgDepth3 );
455 		setEntryImage( 4, bHighContrast ? maImgDepth4h : maImgDepth4 );
456 		setEntryImage( 5, bHighContrast ? maImgDepthInfinityh : maImgDepthInfinity );
457 	}
458 }
459 
460 
461 // -----------------------------------------------------------------------
462 
IMPL_LINK(ExtrusionDepthWindow,SelectHdl,void *,EMPTYARG)463 IMPL_LINK( ExtrusionDepthWindow, SelectHdl, void *, EMPTYARG )
464 {
465 	int nSelected = getSelectedEntryId();
466 	if( nSelected != -1 )
467 	{
468 		if( nSelected == 6 )
469 		{
470 			if ( IsInPopupMode() )
471 				EndPopupMode();
472 
473             const rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepthDialog" ));
474 
475             Any a;
476             Sequence< PropertyValue > aArgs( 2 );
477             aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Depth" ));
478             aArgs[0].Value <<= mfDepth;
479             aArgs[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ));
480             aArgs[1].Value <<= static_cast<sal_Int32>( meUnit );
481 
482             mrController.dispatchCommand( aCommand, aArgs );
483 		}
484 		else
485 		{
486 			double fDepth;
487 
488 			if( nSelected == 5 )
489 			{
490 				fDepth = 338666.6;
491 			}
492 			else
493 			{
494 				fDepth = IsMetric( meUnit ) ? aDepthListMM[nSelected] : aDepthListInch[nSelected];
495 			}
496 
497             Sequence< PropertyValue > aArgs( 1 );
498             aArgs[0].Name = msExtrusionDepth.copy(5);
499             aArgs[0].Value <<= fDepth;
500 
501             mrController.dispatchCommand( msExtrusionDepth,  aArgs );
502 			implSetDepth( fDepth );
503 
504 			if ( IsInPopupMode() )
505 				EndPopupMode();
506 		}
507 	}
508 	return 0;
509 }
510 
511 // =======================================================================
512 // ExtrusionDirectionControl
513 // =======================================================================
514 
ExtrusionDepthController(const Reference<lang::XMultiServiceFactory> & rServiceManager)515 ExtrusionDepthController::ExtrusionDepthController( const Reference< lang::XMultiServiceFactory >& rServiceManager )
516 : svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDepthFloater" ) ) )
517 {
518 }
519 
520 // -----------------------------------------------------------------------
521 
createPopupWindow(::Window * pParent)522 ::Window* ExtrusionDepthController::createPopupWindow( ::Window* pParent )
523 {
524     return new ExtrusionDepthWindow( *this, m_xFrame, pParent );
525 }
526 
527 
528 // -----------------------------------------------------------------------
529 // XServiceInfo
530 // -----------------------------------------------------------------------
531 
ExtrusionDepthController_getImplementationName()532 OUString SAL_CALL ExtrusionDepthController_getImplementationName()
533 {
534 	return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionDepthController" ));
535 }
536 
537 // --------------------------------------------------------------------
538 
ExtrusionDepthController_getSupportedServiceNames()539 Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( RuntimeException )
540 {
541     Sequence< OUString > aSNS( 1 );
542     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
543     return aSNS;
544 }
545 
546 // --------------------------------------------------------------------
547 
ExtrusionDepthController_createInstance(const Reference<XMultiServiceFactory> & rSMgr)548 Reference< XInterface > SAL_CALL SAL_CALL ExtrusionDepthController_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
549 {
550 	return *new ExtrusionDepthController( rSMgr );
551 }
552 
553 // --------------------------------------------------------------------
554 
getImplementationName()555 OUString SAL_CALL ExtrusionDepthController::getImplementationName(  ) throw (RuntimeException)
556 {
557 	return ExtrusionDepthController_getImplementationName();
558 }
559 
560 // --------------------------------------------------------------------
561 
getSupportedServiceNames()562 Sequence< OUString > SAL_CALL ExtrusionDepthController::getSupportedServiceNames(  ) throw (RuntimeException)
563 {
564 	return ExtrusionDepthController_getSupportedServiceNames();
565 }
566 
567 
568 // ####################################################################
569 
570 // -------------------------------------------------------------------------
571 
ExtrusionLightingWindow(svt::ToolboxController & rController,const::com::sun::star::uno::Reference<::com::sun::star::frame::XFrame> & rFrame,Window * pParentWindow)572 ExtrusionLightingWindow::ExtrusionLightingWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
573 : ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_LIGHTING ))
574 , mrController( rController )
575 , maImgBright( SVX_RES( IMG_LIGHTING_BRIGHT ) )
576 , maImgNormal( SVX_RES( IMG_LIGHTING_NORMAL ) )
577 , maImgDim( SVX_RES( IMG_LIGHTING_DIM ) )
578 , maImgBrighth( SVX_RES( IMG_LIGHTING_BRIGHT_H ) )
579 , maImgNormalh( SVX_RES( IMG_LIGHTING_NORMAL_H ) )
580 , maImgDimh( SVX_RES( IMG_LIGHTING_DIM_H ) )
581 , mnLevel( 0 )
582 , mbLevelEnabled( false )
583 , mnDirection( FROM_FRONT )
584 , mbDirectionEnabled( false )
585 , msExtrusionLightingDirection( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingDirection" ))
586 , msExtrusionLightingIntensity( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionLightingIntensity" ))
587 {
588 	sal_uInt16 i;
589 	for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ )
590 	{
591 		if( i != FROM_FRONT )
592 		{
593 			maImgLightingOff[i] = Image( SVX_RES( IMG_LIGHT_OFF + i ) );
594 			maImgLightingOn[i] = Image( SVX_RES( IMG_LIGHT_ON + i ) );
595 			maImgLightingOffh[i] = Image( SVX_RES( IMG_LIGHT_OFF_H + i ) );
596 			maImgLightingOnh[i] = Image( SVX_RES( IMG_LIGHT_ON_H + i ) );
597 		}
598 		maImgLightingPreview[i] = Image( SVX_RES( IMG_LIGHT_PREVIEW + i ) );
599 		maImgLightingPreviewh[i] = Image( SVX_RES( IMG_LIGHT_PREVIEW_H + i ) );
600 	}
601 
602 	SetHelpId( HID_MENU_EXTRUSION_LIGHTING );
603 	SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
604 
605 	mpLightingSet = createEmptyValueSetControl();
606 	mpLightingSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING );
607 
608 	mpLightingSet->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) );
609 	mpLightingSet->SetColCount( 3 );
610 	mpLightingSet->EnableFullItemMode( sal_False );
611 
612 	bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
613 
614 	for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ )
615 	{
616 		if( i != FROM_FRONT )
617 		{
618 			mpLightingSet->InsertItem( i+1, bHighContrast ? maImgLightingOffh[i] : maImgLightingOff[i] );
619 		}
620 		else
621 		{
622 			mpLightingSet->InsertItem( 5, bHighContrast ? maImgLightingPreviewh[FROM_FRONT] : maImgLightingPreview[FROM_FRONT] );
623 		}
624 	}
625 	mpLightingSet->SetOutputSizePixel( Size( 72, 72 ) );
626 
627 	appendEntry( 3, mpLightingSet );
628 	appendSeparator();
629 	appendEntry( 0, String( SVX_RES( STR_BRIGHT ) ), bHighContrast ? maImgBrighth : maImgBright );
630 	appendEntry( 1, String( SVX_RES( STR_NORMAL ) ), bHighContrast ? maImgNormalh : maImgNormal );
631 	appendEntry( 2, String( SVX_RES( STR_DIM ) ), bHighContrast ? maImgDimh : maImgDim );
632 
633 	SetOutputSizePixel( getMenuSize() );
634 
635 	FreeResource();
636 
637     AddStatusListener( msExtrusionLightingDirection );
638     AddStatusListener( msExtrusionLightingIntensity );
639 }
640 
641 // -----------------------------------------------------------------------
642 
implSetIntensity(int nLevel,bool bEnabled)643 void ExtrusionLightingWindow::implSetIntensity( int nLevel, bool bEnabled )
644 {
645 	mnLevel = nLevel;
646 	mbLevelEnabled = bEnabled;
647 	int i = 0;
648 	for( i = 0; i < 3; i++ )
649 	{
650 		checkEntry( i, (i == nLevel) && bEnabled );
651 		enableEntry( i, bEnabled );
652 	}
653 }
654 
655 // -----------------------------------------------------------------------
656 
implSetDirection(int nDirection,bool bEnabled)657 void ExtrusionLightingWindow::implSetDirection( int nDirection, bool bEnabled )
658 {
659 	mnDirection = nDirection;
660 	mbDirectionEnabled = bEnabled;
661 
662 	bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
663 
664 	if( !bEnabled )
665 		nDirection = FROM_FRONT;
666 
667 	sal_uInt16 nItemId;
668 	for( nItemId = FROM_TOP_LEFT; nItemId <= FROM_BOTTOM_RIGHT; nItemId++ )
669 	{
670 		if( nItemId == FROM_FRONT )
671 		{
672 			mpLightingSet->SetItemImage( nItemId + 1, bHighContrast ? maImgLightingPreviewh[ nDirection ] : maImgLightingPreview[ nDirection ] );
673 		}
674 		else
675 		{
676 			if( bHighContrast )
677 			{
678 				mpLightingSet->SetItemImage( nItemId + 1, (sal_uInt16)nDirection == nItemId ? maImgLightingOnh[nItemId] : maImgLightingOffh[nItemId] );
679 			}
680 			else
681 			{
682 				mpLightingSet->SetItemImage( nItemId + 1, (sal_uInt16)nDirection == nItemId ? maImgLightingOn[nItemId] : maImgLightingOff[nItemId] );
683 			}
684 		}
685 	}
686 
687 	enableEntry( 3, bEnabled );
688 }
689 
690 // -----------------------------------------------------------------------
691 
statusChanged(const::com::sun::star::frame::FeatureStateEvent & Event)692 void SAL_CALL ExtrusionLightingWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
693 {
694 	if( Event.FeatureURL.Main.equals( msExtrusionLightingIntensity ) )
695 	{
696 		if( !Event.IsEnabled )
697 		{
698 			implSetIntensity( 0, false );
699 		}
700 		else
701 		{
702 			sal_Int32 nValue = 0;
703 			if( Event.State >>= nValue )
704 				implSetIntensity( nValue, true );
705 		}
706 	}
707 	else if( Event.FeatureURL.Main.equals( msExtrusionLightingDirection ) )
708 	{
709 		if( !Event.IsEnabled )
710 		{
711 			implSetDirection( 0, false );
712 		}
713 		else
714 		{
715 			sal_Int32 nValue = 0;
716 			if( Event.State >>= nValue )
717 				implSetDirection( nValue, true );
718 		}
719 	}
720 }
721 
722 // -----------------------------------------------------------------------
723 
DataChanged(const DataChangedEvent & rDCEvt)724 void ExtrusionLightingWindow::DataChanged( const DataChangedEvent& rDCEvt )
725 {
726 	ToolbarMenu::DataChanged( rDCEvt );
727 
728 	if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
729 	{
730 		bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
731 
732 		implSetDirection( mnDirection, mbDirectionEnabled );
733 		setEntryImage( 0, bHighContrast ? maImgBrighth : maImgBright );
734 		setEntryImage( 1, bHighContrast ? maImgNormalh : maImgNormal );
735 		setEntryImage( 2, bHighContrast ? maImgDimh : maImgDim );
736 	}
737 }
738 
739 // -----------------------------------------------------------------------
740 
IMPL_LINK(ExtrusionLightingWindow,SelectHdl,void *,pControl)741 IMPL_LINK( ExtrusionLightingWindow, SelectHdl, void *, pControl )
742 {
743 	if ( IsInPopupMode() )
744 		EndPopupMode();
745 
746 	if( pControl == this )
747 	{
748 		int nLevel = getSelectedEntryId();
749 		if( nLevel >= 0 )
750 		{
751 			if( nLevel != 3 )
752 			{
753                 Sequence< PropertyValue > aArgs( 1 );
754                 aArgs[0].Name = msExtrusionLightingIntensity.copy(5);
755                 aArgs[0].Value <<= (sal_Int32)nLevel;
756 
757 				mrController.dispatchCommand( msExtrusionLightingIntensity, aArgs );
758 
759 				implSetIntensity( nLevel, true );
760 			}
761 		}
762 	}
763 	else
764 	{
765 		sal_Int32 nDirection = mpLightingSet->GetSelectItemId();
766 
767 		if( (nDirection > 0) && (nDirection < 10) )
768 		{
769 			nDirection--;
770 
771             Sequence< PropertyValue > aArgs( 1 );
772             aArgs[0].Name = msExtrusionLightingDirection.copy(5);
773             aArgs[0].Value <<= (sal_Int32)nDirection;
774 
775 			mrController.dispatchCommand( msExtrusionLightingDirection, aArgs );
776 
777 			implSetDirection( nDirection, true );
778 		}
779 
780 	}
781 
782 	return 0;
783 }
784 
785 // ========================================================================
786 
ExtrusionLightingControl(const Reference<lang::XMultiServiceFactory> & rServiceManager)787 ExtrusionLightingControl::ExtrusionLightingControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
788 : svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionDirectionFloater" ) ) )
789 {
790 }
791 
792 // -----------------------------------------------------------------------
793 
createPopupWindow(::Window * pParent)794 ::Window* ExtrusionLightingControl::createPopupWindow( ::Window* pParent )
795 {
796     return new ExtrusionLightingWindow( *this, m_xFrame, pParent );
797 }
798 
799 // -----------------------------------------------------------------------
800 // XServiceInfo
801 // -----------------------------------------------------------------------
802 
ExtrusionLightingControl_getImplementationName()803 OUString SAL_CALL ExtrusionLightingControl_getImplementationName()
804 {
805 	return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionLightingController" ));
806 }
807 
808 // --------------------------------------------------------------------
809 
ExtrusionLightingControl_getSupportedServiceNames()810 Sequence< OUString > SAL_CALL ExtrusionLightingControl_getSupportedServiceNames() throw( RuntimeException )
811 {
812     Sequence< OUString > aSNS( 1 );
813     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
814     return aSNS;
815 }
816 
817 // --------------------------------------------------------------------
818 
ExtrusionLightingControl_createInstance(const Reference<XMultiServiceFactory> & rSMgr)819 Reference< XInterface > SAL_CALL SAL_CALL ExtrusionLightingControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
820 {
821 	return *new ExtrusionLightingControl( rSMgr );
822 }
823 
824 // --------------------------------------------------------------------
825 
getImplementationName()826 OUString SAL_CALL ExtrusionLightingControl::getImplementationName(  ) throw (RuntimeException)
827 {
828 	return ExtrusionLightingControl_getImplementationName();
829 }
830 
831 // --------------------------------------------------------------------
832 
getSupportedServiceNames()833 Sequence< OUString > SAL_CALL ExtrusionLightingControl::getSupportedServiceNames(  ) throw (RuntimeException)
834 {
835 	return ExtrusionLightingControl_getSupportedServiceNames();
836 }
837 
838 // ####################################################################
839 
ExtrusionSurfaceWindow(svt::ToolboxController & rController,const::com::sun::star::uno::Reference<::com::sun::star::frame::XFrame> & rFrame,Window * pParentWindow)840 ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
841 : ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_EXTRUSION_SURFACE ))
842 , mrController( rController )
843 , maImgSurface1( SVX_RES( IMG_WIRE_FRAME ) )
844 , maImgSurface2( SVX_RES( IMG_MATTE ) )
845 , maImgSurface3( SVX_RES( IMG_PLASTIC ) )
846 , maImgSurface4( SVX_RES( IMG_METAL ) )
847 , maImgSurface1h( SVX_RES( IMG_WIRE_FRAME_H ) )
848 , maImgSurface2h( SVX_RES( IMG_MATTE_H ) )
849 , maImgSurface3h( SVX_RES( IMG_PLASTIC_H ) )
850 , maImgSurface4h( SVX_RES( IMG_METAL_H ) )
851 , msExtrusionSurface( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionSurface" ))
852 {
853 	bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
854 
855 	SetHelpId( HID_MENU_EXTRUSION_SURFACE );
856 	SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) );
857 
858 	appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 );
859 	appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 );
860 	appendEntry( 2, String( SVX_RES( STR_PLASTIC ) ), bHighContrast ? maImgSurface3h : maImgSurface3 );
861 	appendEntry( 3, String( SVX_RES( STR_METAL ) ), bHighContrast ? maImgSurface4h : maImgSurface4 );
862 
863 	SetOutputSizePixel( getMenuSize() );
864 
865 	FreeResource();
866 
867     AddStatusListener( msExtrusionSurface );
868 }
869 
870 // -----------------------------------------------------------------------
871 
implSetSurface(int nSurface,bool bEnabled)872 void ExtrusionSurfaceWindow::implSetSurface( int nSurface, bool bEnabled )
873 {
874 //	if( mpMenu )
875 	{
876 		int i;
877 		for( i = 0; i < 4; i++ )
878 		{
879 			checkEntry( i, (i == nSurface) && bEnabled );
880 			enableEntry( i, bEnabled );
881 		}
882 	}
883 }
884 
885 // -----------------------------------------------------------------------
886 
statusChanged(const::com::sun::star::frame::FeatureStateEvent & Event)887 void SAL_CALL ExtrusionSurfaceWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
888 {
889 	if( Event.FeatureURL.Main.equals( msExtrusionSurface ) )
890 	{
891 		if( !Event.IsEnabled )
892 		{
893 			implSetSurface( 0, false );
894 		}
895 		else
896 		{
897 			sal_Int32 nValue = 0;
898 			if( Event.State >>= nValue )
899 				implSetSurface( nValue, true );
900 		}
901 	}
902 }
903 
904 // -----------------------------------------------------------------------
905 
IMPL_LINK(ExtrusionSurfaceWindow,SelectHdl,void *,EMPTYARG)906 IMPL_LINK( ExtrusionSurfaceWindow, SelectHdl, void *, EMPTYARG )
907 {
908 	if ( IsInPopupMode() )
909 		EndPopupMode();
910 
911 	sal_Int32 nSurface = getSelectedEntryId();
912 	if( nSurface >= 0 )
913 	{
914         Sequence< PropertyValue > aArgs( 1 );
915         aArgs[0].Name = msExtrusionSurface.copy(5);
916         aArgs[0].Value <<= (sal_Int32)nSurface;
917 
918 		mrController.dispatchCommand( msExtrusionSurface, aArgs );
919 
920 		implSetSurface( nSurface, true );
921 	}
922 
923 	return 0;
924 }
925 
926 // ========================================================================
927 
ExtrusionSurfaceControl(const Reference<lang::XMultiServiceFactory> & rServiceManager)928 ExtrusionSurfaceControl::ExtrusionSurfaceControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
929 : svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ExtrusionSurfaceFloater" ) ) )
930 {
931 }
932 
933 // -----------------------------------------------------------------------
934 
createPopupWindow(::Window * pParent)935 ::Window* ExtrusionSurfaceControl::createPopupWindow( ::Window* pParent )
936 {
937     return new ExtrusionSurfaceWindow( *this, m_xFrame, pParent );
938 }
939 
940 // -----------------------------------------------------------------------
941 // XServiceInfo
942 // -----------------------------------------------------------------------
943 
ExtrusionSurfaceControl_getImplementationName()944 OUString SAL_CALL ExtrusionSurfaceControl_getImplementationName()
945 {
946 	return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.ExtrusionSurfaceController" ));
947 }
948 
949 // --------------------------------------------------------------------
950 
ExtrusionSurfaceControl_getSupportedServiceNames()951 Sequence< OUString > SAL_CALL ExtrusionSurfaceControl_getSupportedServiceNames() throw( RuntimeException )
952 {
953     Sequence< OUString > aSNS( 1 );
954     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
955     return aSNS;
956 }
957 
958 // --------------------------------------------------------------------
959 
ExtrusionSurfaceControl_createInstance(const Reference<XMultiServiceFactory> & rSMgr)960 Reference< XInterface > SAL_CALL SAL_CALL ExtrusionSurfaceControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
961 {
962 	return *new ExtrusionSurfaceControl( rSMgr );
963 }
964 
965 // --------------------------------------------------------------------
966 
getImplementationName()967 OUString SAL_CALL ExtrusionSurfaceControl::getImplementationName(  ) throw (RuntimeException)
968 {
969 	return ExtrusionSurfaceControl_getImplementationName();
970 }
971 
972 // --------------------------------------------------------------------
973 
getSupportedServiceNames()974 Sequence< OUString > SAL_CALL ExtrusionSurfaceControl::getSupportedServiceNames(  ) throw (RuntimeException)
975 {
976 	return ExtrusionSurfaceControl_getSupportedServiceNames();
977 }
978 
979 //========================================================================
980 
981 SFX_IMPL_TOOLBOX_CONTROL( ExtrusionColorControl, SvxColorItem );
982 
ExtrusionColorControl(sal_uInt16 nSlotId,sal_uInt16 nId,ToolBox & rTbx)983 ExtrusionColorControl::ExtrusionColorControl(
984 	sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
985 : SfxToolBoxControl	( nSlotId, nId, rTbx )
986 {
987 	rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
988     mpBtnUpdater = new ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox(), TBX_UPDATER_MODE_CHAR_COLOR_NEW );
989 }
990 
991 // -----------------------------------------------------------------------
992 
~ExtrusionColorControl()993 ExtrusionColorControl::~ExtrusionColorControl()
994 {
995 	delete mpBtnUpdater;
996 }
997 
998 // -----------------------------------------------------------------------
999 
GetPopupWindowType() const1000 SfxPopupWindowType ExtrusionColorControl::GetPopupWindowType() const
1001 {
1002 	return SFX_POPUPWINDOW_ONCLICK;
1003 }
1004 
1005 // -----------------------------------------------------------------------
1006 
CreatePopupWindow()1007 SfxPopupWindow*	ExtrusionColorControl::CreatePopupWindow()
1008 {
1009     SvxColorWindow_Impl* pColorWin = new SvxColorWindow_Impl(
1010 		rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Extrusion3DColor" )),
1011 		SID_EXTRUSION_3D_COLOR,
1012 		m_xFrame,
1013 		SVX_RESSTR( RID_SVXSTR_EXTRUSION_COLOR ),
1014         &GetToolBox() );
1015     pColorWin->StartPopupMode( &GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF );
1016 	pColorWin->StartSelection();
1017     SetPopupWindow( pColorWin );
1018 	return pColorWin;
1019 }
1020 
1021 // -----------------------------------------------------------------------
1022 
StateChanged(sal_uInt16 nSID,SfxItemState eState,const SfxPoolItem * pState)1023 void ExtrusionColorControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
1024 {
1025 	sal_uInt16 nId = GetId();
1026 	ToolBox& rTbx = GetToolBox();
1027 
1028 	if( nSID == SID_EXTRUSION_3D_COLOR )
1029 	{
1030 		const SvxColorItem*	pItem = 0;
1031 
1032 		if( SFX_ITEM_DONTCARE != eState )
1033 			pItem = PTR_CAST( SvxColorItem, pState );
1034 
1035 		if ( pItem )
1036 			mpBtnUpdater->Update( pItem->GetValue());
1037 	}
1038 
1039 	rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
1040 	rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
1041 }
1042 
1043 }
1044