merge the formfield patch from ooo-build
[ooovba.git] / sfx2 / source / dialog / printopt.cxx
blobfbfc43bc9012baf437efdaa41872d509dc1ddb55
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: printopt.cxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sfx2.hxx"
34 #ifndef GCC
35 #endif
36 #include <vcl/msgbox.hxx>
37 #include <svtools/printwarningoptions.hxx>
38 #include <svtools/printoptions.hxx>
39 #include <svtools/flagitem.hxx>
42 #include "printopt.hrc"
43 #include "dialog.hrc"
44 #include "sfxresid.hxx"
45 #include <sfx2/viewsh.hxx>
46 #include <sfx2/printopt.hxx>
48 // -----------
49 // - statics -
50 // -----------
52 static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
53 static BOOL bOutputForPrinter = TRUE;
55 #define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ]))
57 // --------------------------------
58 // - SfxCommonPrintOptionsTabPage -
59 // --------------------------------
61 SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
62 SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ),
64 aReduceGB( this, SfxResId( GB_REDUCE ) ),
65 aOutputTypeFT( this, SfxResId( FT_OUTPUTTYPE ) ),
66 aPrinterOutputRB( this, SfxResId( RB_PRINTEROUTPUT ) ),
67 aPrintFileOutputRB( this, SfxResId( RB_PRINTFILEOUTPUT ) ),
68 aOutputGB( this, SfxResId( GB_OUTPUT ) ),
69 aReduceTransparencyCB( this, SfxResId( CB_REDUCETRANSPARENCY ) ),
70 aReduceTransparencyAutoRB( this, SfxResId( RB_REDUCETRANSPARENCY_AUTO ) ),
71 aReduceTransparencyNoneRB( this, SfxResId( RB_REDUCETRANSPARENCY_NONE ) ),
72 aReduceGradientsCB( this, SfxResId( CB_REDUCEGRADIENTS ) ),
73 aReduceGradientsStripesRB( this, SfxResId( RB_REDUCEGRADIENTS_STRIPES ) ),
74 aReduceGradientsColorRB( this, SfxResId( RB_REDUCEGRADIENTS_COLOR ) ),
75 aReduceGradientsStepCountNF( this, SfxResId( NF_REDUCEGRADIENTS_STEPCOUNT ) ),
76 aReduceBitmapsCB( this, SfxResId( CB_REDUCEBITMAPS ) ),
77 aReduceBitmapsOptimalRB( this, SfxResId( RB_REDUCEBITMAPS_OPTIMAL ) ),
78 aReduceBitmapsNormalRB( this, SfxResId( RB_REDUCEBITMAPS_NORMAL ) ),
79 aReduceBitmapsResolutionRB( this, SfxResId( RB_REDUCEBITMAPS_RESOLUTION ) ),
80 aReduceBitmapsResolutionLB( this, SfxResId( LB_REDUCEBITMAPS_RESOLUTION ) ),
81 aReduceBitmapsTransparencyCB( this, SfxResId( CB_REDUCEBITMAPS_TRANSPARENCY ) ),
82 aConvertToGreyscalesCB( this, SfxResId( CB_CONVERTTOGREYSCALES ) ),
83 aWarnGB( this, SfxResId( GB_PRINT_WARN ) ),
84 aPaperSizeCB( this, SfxResId( CB_PAPERSIZE ) ),
85 aPaperOrientationCB( this, SfxResId( CB_PAPERORIENTATION ) ),
86 aTransparencyCB( this, SfxResId( CB_TRANSPARENCY ) )
88 FreeResource();
90 aOutputGB.SetStyle( aOutputGB.GetStyle() | WB_NOLABEL );
92 if( bOutputForPrinter )
94 aPrinterOutputRB.Check( TRUE );
95 aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrinterOutputRB.GetText() ) );
97 else
99 aPrintFileOutputRB.Check( TRUE );
100 aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrintFileOutputRB.GetText() ) );
103 aPrinterOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
104 aPrintFileOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
106 aReduceTransparencyCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
107 aReduceGradientsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
108 aReduceBitmapsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
110 aReduceGradientsStripesRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) );
111 aReduceBitmapsResolutionRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) );
113 // --> PB 2008-06-09 #i89164#
114 // calculate dynamically the width of radiobutton and listbox
115 const long nOffset = 10;
116 Size aOldSize = aReduceBitmapsResolutionRB.GetSizePixel();
117 Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize( WINDOWSIZE_PREFERRED );
118 aNewSize.Width() += nOffset;
119 aNewSize.Height() = aOldSize.Height();
120 long nDelta = aOldSize.Width() - aNewSize.Width();
121 aReduceBitmapsResolutionRB.SetSizePixel( aNewSize );
122 Point aPos = aReduceBitmapsResolutionLB.GetPosPixel();
123 aPos.X() -= nDelta;
124 aOldSize = aReduceBitmapsResolutionLB.GetSizePixel();
125 aNewSize = aReduceBitmapsResolutionLB.GetOptimalSize( WINDOWSIZE_PREFERRED );
126 aNewSize.Width() += nOffset;
127 aNewSize.Height() = aOldSize.Height();
128 aReduceBitmapsResolutionLB.SetPosSizePixel( aPos, aNewSize );
129 // <--
132 // -----------------------------------------------------------------------------
134 SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage()
138 // -----------------------------------------------------------------------------
140 SfxTabPage* SfxCommonPrintOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
142 return( new SfxCommonPrintOptionsTabPage( pParent, rAttrSet ) );
145 // -----------------------------------------------------------------------------
147 Window* SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const Window* pWindow ) const
149 if ( pWindow == (Window *)&aReduceGradientsStepCountNF )
150 return (Window *)&aReduceGradientsStripesRB;
151 else if ( pWindow == (Window *)&aReduceBitmapsResolutionLB )
152 return (Window *)&aReduceBitmapsResolutionRB;
153 else
154 return SfxTabPage::GetParentLabeledBy( pWindow );
157 Window* SfxCommonPrintOptionsTabPage::GetParentLabelFor( const Window* pWindow ) const
159 if ( pWindow == (Window *)&aReduceGradientsStripesRB )
160 return (Window *)&aReduceGradientsStepCountNF;
161 else if ( pWindow == (Window *)&aReduceBitmapsResolutionRB )
162 return (Window *)&aReduceBitmapsResolutionLB;
163 else
164 return SfxTabPage::GetParentLabelFor( pWindow );
167 // -----------------------------------------------------------------------------
169 BOOL SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ )
171 SvtPrintWarningOptions aWarnOptions;
172 SvtPrinterOptions aPrinterOptions;
173 SvtPrintFileOptions aPrintFileOptions;
174 BOOL bModified = FALSE;
177 if( aPaperSizeCB.IsChecked() != aPaperSizeCB.GetSavedValue())
178 aWarnOptions.SetPaperSize(aPaperSizeCB.IsChecked());
179 if( aPaperOrientationCB.IsChecked() != aPaperOrientationCB.GetSavedValue() )
180 aWarnOptions.SetPaperOrientation(aPaperOrientationCB.IsChecked());
182 if( aTransparencyCB.IsChecked() != aTransparencyCB.GetSavedValue() )
183 aWarnOptions.SetTransparency( aTransparencyCB.IsChecked() );
185 ImplSaveControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
187 aPrinterOptions.SetPrinterOptions( maPrinterOptions );
188 aPrintFileOptions.SetPrinterOptions( maPrintFileOptions );
190 return bModified;
193 // -----------------------------------------------------------------------------
195 void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet& /*rSet*/ )
197 SvtPrintWarningOptions aWarnOptions;
198 SvtPrinterOptions aPrinterOptions;
199 SvtPrintFileOptions aPrintFileOptions;
201 aPaperSizeCB.Check( aWarnOptions.IsPaperSize() );
202 aPaperOrientationCB.Check( aWarnOptions.IsPaperOrientation() );
204 aTransparencyCB.Check( aWarnOptions.IsTransparency() );
206 aPaperSizeCB.SaveValue();
207 aPaperOrientationCB.SaveValue();
208 aTransparencyCB.SaveValue();
210 aPrinterOptions.GetPrinterOptions( maPrinterOptions );
211 aPrintFileOptions.GetPrinterOptions( maPrintFileOptions );
213 ImplUpdateControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
215 // --> OD 2008-06-25 #i63982#
216 ImplSetAccessibleNames();
217 // <--
220 // -----------------------------------------------------------------------------
222 int SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet )
224 if( pItemSet )
225 FillItemSet( *pItemSet );
227 return LEAVE_PAGE;
230 // -----------------------------------------------------------------------------
232 void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCurrentOptions )
234 aReduceTransparencyCB.Check( pCurrentOptions->IsReduceTransparency() );
236 if( pCurrentOptions->GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO )
237 aReduceTransparencyAutoRB.Check( TRUE );
238 else
239 aReduceTransparencyNoneRB.Check( TRUE );
241 aReduceGradientsCB.Check( pCurrentOptions->IsReduceGradients() );
243 if( pCurrentOptions->GetReducedGradientMode() == PRINTER_GRADIENT_STRIPES )
244 aReduceGradientsStripesRB.Check( TRUE );
245 else
246 aReduceGradientsColorRB.Check( TRUE );
248 aReduceGradientsStepCountNF.SetValue( pCurrentOptions->GetReducedGradientStepCount() );
250 aReduceBitmapsCB.Check( pCurrentOptions->IsReduceBitmaps() );
252 if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_OPTIMAL )
253 aReduceBitmapsOptimalRB.Check( TRUE );
254 else if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_NORMAL )
255 aReduceBitmapsNormalRB.Check( TRUE );
256 else
257 aReduceBitmapsResolutionRB.Check( TRUE );
259 const USHORT nDPI = pCurrentOptions->GetReducedBitmapResolution();
261 if( nDPI < aDPIArray[ 0 ] )
262 aReduceBitmapsResolutionLB.SelectEntryPos( 0 );
263 else
265 for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- )
267 if( nDPI >= aDPIArray[ i ] )
269 aReduceBitmapsResolutionLB.SelectEntryPos( (USHORT) i );
270 i = -1;
275 aReduceBitmapsResolutionLB.SetText( aReduceBitmapsResolutionLB.GetEntry( aReduceBitmapsResolutionLB.GetSelectEntryPos() ) );
277 aReduceBitmapsTransparencyCB.Check( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
278 aConvertToGreyscalesCB.Check( pCurrentOptions->IsConvertToGreyscales() );
280 ClickReduceTransparencyCBHdl( &aReduceTransparencyCB );
281 ClickReduceGradientsCBHdl( &aReduceGradientsCB );
282 ClickReduceBitmapsCBHdl( &aReduceBitmapsCB );
285 // -----------------------------------------------------------------------------
287 void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames()
289 static const String cSeparator = String::CreateFromAscii( " - " );
291 String sReduceText = aReduceGB.GetDisplayText();
292 sReduceText += cSeparator;
294 String sAccessibleName = sReduceText;
295 sAccessibleName += aPrinterOutputRB.GetDisplayText();
296 aPrinterOutputRB.SetAccessibleName( sAccessibleName );
298 sAccessibleName = sReduceText;
299 sAccessibleName += aPrintFileOutputRB.GetDisplayText();
300 aPrintFileOutputRB.SetAccessibleName( sAccessibleName );
302 String sOutputText = sReduceText;
303 sOutputText += aOutputGB.GetDisplayText();
304 sOutputText += cSeparator;
306 sAccessibleName = sOutputText;
307 sAccessibleName += aReduceTransparencyCB.GetDisplayText();
308 aReduceTransparencyCB.SetAccessibleName( sAccessibleName );
310 String sTransparencyText = aReduceTransparencyCB.GetAccessibleName();
311 sTransparencyText += cSeparator;
313 sAccessibleName = sTransparencyText;
314 sAccessibleName += aReduceTransparencyAutoRB.GetDisplayText();
315 aReduceTransparencyAutoRB.SetAccessibleName( sAccessibleName );
317 sAccessibleName = sTransparencyText;
318 sAccessibleName += aReduceTransparencyNoneRB.GetDisplayText();
319 aReduceTransparencyNoneRB.SetAccessibleName( sAccessibleName );
321 sAccessibleName = sOutputText;
322 sAccessibleName += aReduceGradientsCB.GetDisplayText();
323 aReduceGradientsCB.SetAccessibleName( sAccessibleName );
325 String sGradientText = aReduceGradientsCB.GetAccessibleName();
326 sGradientText += cSeparator;
328 sAccessibleName = sGradientText;
329 sAccessibleName += aReduceGradientsStripesRB.GetDisplayText();
330 aReduceGradientsStripesRB.SetAccessibleName( sAccessibleName );
332 sAccessibleName = aReduceGradientsStripesRB.GetAccessibleName();
333 aReduceGradientsStepCountNF.SetAccessibleName( sAccessibleName );
335 sAccessibleName = sGradientText;
336 sAccessibleName += aReduceGradientsColorRB.GetDisplayText();
337 aReduceGradientsColorRB.SetAccessibleName( sAccessibleName );
339 sAccessibleName = sOutputText;
340 sAccessibleName += aReduceBitmapsCB.GetDisplayText();
341 aReduceBitmapsCB.SetAccessibleName( sAccessibleName );
343 String sBitmapText = aReduceBitmapsCB.GetAccessibleName();
344 sBitmapText += cSeparator;
346 sAccessibleName = sBitmapText;
347 sAccessibleName += aReduceBitmapsOptimalRB.GetDisplayText();
348 aReduceBitmapsOptimalRB.SetAccessibleName( sAccessibleName );
350 sAccessibleName = sBitmapText;
351 sAccessibleName += aReduceBitmapsNormalRB.GetDisplayText();
352 aReduceBitmapsNormalRB.SetAccessibleName( sAccessibleName );
354 sAccessibleName = sBitmapText;
355 sAccessibleName += aReduceBitmapsResolutionRB.GetDisplayText();
356 aReduceBitmapsResolutionRB.SetAccessibleName( sAccessibleName );
358 sAccessibleName = aReduceBitmapsResolutionRB.GetAccessibleName();
359 aReduceBitmapsResolutionLB.SetAccessibleName( sAccessibleName );
361 sAccessibleName = sBitmapText;
362 sAccessibleName += aReduceBitmapsTransparencyCB.GetDisplayText();
363 aReduceBitmapsTransparencyCB.SetAccessibleName( sAccessibleName );
365 sAccessibleName = sOutputText;
366 sAccessibleName += aConvertToGreyscalesCB.GetDisplayText();
367 aConvertToGreyscalesCB.SetAccessibleName( sAccessibleName );
369 String sWarnText = aWarnGB.GetDisplayText();
370 sWarnText += cSeparator;
372 sAccessibleName = sWarnText;
373 sAccessibleName += aPaperSizeCB.GetDisplayText();
374 aPaperSizeCB.SetAccessibleName( sAccessibleName );
376 sAccessibleName = sWarnText;
377 sAccessibleName += aPaperOrientationCB.GetDisplayText();
378 aPaperOrientationCB.SetAccessibleName( sAccessibleName );
380 sAccessibleName = sWarnText;
381 sAccessibleName += aTransparencyCB.GetDisplayText();
382 aTransparencyCB.SetAccessibleName( sAccessibleName );
385 // -----------------------------------------------------------------------------
387 void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOptions )
389 pCurrentOptions->SetReduceTransparency( aReduceTransparencyCB.IsChecked() );
390 pCurrentOptions->SetReducedTransparencyMode( aReduceTransparencyAutoRB.IsChecked() ? PRINTER_TRANSPARENCY_AUTO : PRINTER_TRANSPARENCY_NONE );
391 pCurrentOptions->SetReduceGradients( aReduceGradientsCB.IsChecked() );
392 pCurrentOptions->SetReducedGradientMode( aReduceGradientsStripesRB.IsChecked() ? PRINTER_GRADIENT_STRIPES : PRINTER_GRADIENT_COLOR );
393 pCurrentOptions->SetReducedGradientStepCount( (USHORT) aReduceGradientsStepCountNF.GetValue() );
394 pCurrentOptions->SetReduceBitmaps( aReduceBitmapsCB.IsChecked() );
395 pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL :
396 ( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) );
397 pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) aReduceBitmapsResolutionLB.GetSelectEntryPos(),
398 (USHORT)( sizeof( aDPIArray ) / sizeof( aDPIArray[ 0 ] ) - 1 ) ) ] );
399 pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
400 pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
403 // -----------------------------------------------------------------------------
405 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox )
407 (void)pBox; //unused
408 const BOOL bReduceTransparency = aReduceTransparencyCB.IsChecked();
410 aReduceTransparencyAutoRB.Enable( bReduceTransparency );
411 aReduceTransparencyNoneRB.Enable( bReduceTransparency );
413 aTransparencyCB.Enable( !bReduceTransparency );
415 return 0;
418 // -----------------------------------------------------------------------------
420 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, CheckBox*, pBox )
422 (void)pBox; //unused
423 const BOOL bEnable = aReduceGradientsCB.IsChecked();
425 aReduceGradientsStripesRB.Enable( bEnable );
426 aReduceGradientsColorRB.Enable( bEnable );
427 aReduceGradientsStepCountNF.Enable( bEnable );
429 ToggleReduceGradientsStripesRBHdl( &aReduceGradientsStripesRB );
431 return 0;
434 // -----------------------------------------------------------------------------
436 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, CheckBox*, pBox )
438 (void)pBox; //unused
439 const BOOL bEnable = aReduceBitmapsCB.IsChecked();
441 aReduceBitmapsOptimalRB.Enable( bEnable );
442 aReduceBitmapsNormalRB.Enable( bEnable );
443 aReduceBitmapsResolutionRB.Enable( bEnable );
444 aReduceBitmapsTransparencyCB.Enable( bEnable );
445 aReduceBitmapsResolutionLB.Enable( bEnable );
447 ToggleReduceBitmapsResolutionRBHdl( &aReduceBitmapsResolutionRB );
449 return 0;
452 // -----------------------------------------------------------------------------
454 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl, RadioButton*, pButton )
456 (void)pButton; //unused
457 const BOOL bEnable = aReduceGradientsCB.IsChecked() && aReduceGradientsStripesRB.IsChecked();
459 aReduceGradientsStepCountNF.Enable( bEnable );
461 return 0;
464 // -----------------------------------------------------------------------------
466 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl, RadioButton*, pButton )
468 (void)pButton; //unused
469 const BOOL bEnable = aReduceBitmapsCB.IsChecked() && aReduceBitmapsResolutionRB.IsChecked();
471 aReduceBitmapsResolutionLB.Enable( bEnable );
473 return 0;
476 // -----------------------------------------------------------------------------
478 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, pButton )
480 if( pButton->IsChecked() )
482 aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
483 ImplUpdateControls( &maPrinterOptions );
484 bOutputForPrinter = TRUE;
485 // --> OD 2008-06-25 #i63982#
486 ImplSetAccessibleNames();
487 // <--
489 else
490 ImplSaveControls( &maPrinterOptions );
492 return 0;
495 // -----------------------------------------------------------------------------
497 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton*, pButton )
499 if( pButton->IsChecked() )
501 aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
502 ImplUpdateControls( &maPrintFileOptions );
503 bOutputForPrinter = FALSE;
504 // --> OD 2008-06-25 #i63982#
505 ImplSetAccessibleNames();
506 // <--
508 else
509 ImplSaveControls( &maPrintFileOptions );
511 return 0;
514 // -------------------------------
515 // - TransparencyPrintWarningBox -
516 // -------------------------------
518 TransparencyPrintWarningBox::TransparencyPrintWarningBox( Window* pParent ) :
519 ModalDialog( pParent, SfxResId( RID_WARN_PRINTTRANSPARENCY ) ),
520 aWarnFI ( this, SfxResId( FI_PRINTTRANSWARN ) ),
521 aWarnFT ( this, SfxResId( FT_PRINTTRANSWARN ) ),
522 aYesBtn ( this, SfxResId( BTN_PRINTTRANS_YES ) ),
523 aNoBtn ( this, SfxResId( BTN_PRINTTRANS_NO ) ),
524 aCancelBtn ( this, SfxResId( BTN_PRINTTRANS_CANCEL ) ),
525 aNoWarnCB ( this, SfxResId( CBX_NOPRINTTRANSWARN ) )
527 FreeResource();
529 aWarnFT.SetStyle( aWarnFT.GetStyle() | WB_INFO );
530 aWarnFI.SetImage( WarningBox::GetStandardImage() );
532 aNoBtn.SetClickHdl( LINK( this, TransparencyPrintWarningBox, ClickNoBtn ) );
535 // -----------------------------------------------------------------------------
537 TransparencyPrintWarningBox::~TransparencyPrintWarningBox()
541 // -----------------------------------------------------------------------------
543 IMPL_LINK( TransparencyPrintWarningBox, ClickNoBtn, PushButton*, pButton )
545 (void)pButton; //unused
546 EndDialog( RET_NO );
547 return 0;