xref: /trunk/main/sfx2/source/dialog/printopt.cxx (revision d119d52d)
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_sfx2.hxx"
26 
27 #ifndef GCC
28 #endif
29 #include <vcl/msgbox.hxx>
30 #include <unotools/printwarningoptions.hxx>
31 #include <svtools/printoptions.hxx>
32 #include <svl/flagitem.hxx>
33 
34 
35 #include "printopt.hrc"
36 #include "dialog.hrc"
37 #include "sfx2/sfxresid.hxx"
38 #include <sfx2/viewsh.hxx>
39 #include <sfx2/printopt.hxx>
40 
41 // -----------
42 // - statics -
43 // -----------
44 
45 static sal_uInt16   aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
46 static sal_Bool     bOutputForPrinter = sal_True;
47 
48 #define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ]))
49 
50 // --------------------------------
51 // - SfxCommonPrintOptionsTabPage -
52 // --------------------------------
53 
SfxCommonPrintOptionsTabPage(Window * pParent,const SfxItemSet & rSet)54 SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
55 	SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ),
56 
57     aReduceGB( this, SfxResId( GB_REDUCE ) ),
58     aOutputTypeFT( this, SfxResId( FT_OUTPUTTYPE ) ),
59     aPrinterOutputRB( this, SfxResId( RB_PRINTEROUTPUT ) ),
60     aPrintFileOutputRB( this, SfxResId( RB_PRINTFILEOUTPUT ) ),
61     aOutputGB( this, SfxResId( GB_OUTPUT ) ),
62     aReduceTransparencyCB( this, SfxResId( CB_REDUCETRANSPARENCY ) ),
63     aReduceTransparencyAutoRB( this, SfxResId( RB_REDUCETRANSPARENCY_AUTO ) ),
64     aReduceTransparencyNoneRB( this, SfxResId( RB_REDUCETRANSPARENCY_NONE ) ),
65     aReduceGradientsCB( this, SfxResId( CB_REDUCEGRADIENTS ) ),
66     aReduceGradientsStripesRB( this, SfxResId( RB_REDUCEGRADIENTS_STRIPES ) ),
67     aReduceGradientsColorRB( this, SfxResId( RB_REDUCEGRADIENTS_COLOR ) ),
68     aReduceGradientsStepCountNF( this, SfxResId( NF_REDUCEGRADIENTS_STEPCOUNT ) ),
69     aReduceBitmapsCB( this, SfxResId( CB_REDUCEBITMAPS ) ),
70     aReduceBitmapsOptimalRB( this, SfxResId( RB_REDUCEBITMAPS_OPTIMAL ) ),
71     aReduceBitmapsNormalRB( this, SfxResId( RB_REDUCEBITMAPS_NORMAL ) ),
72     aReduceBitmapsResolutionRB( this, SfxResId( RB_REDUCEBITMAPS_RESOLUTION ) ),
73     aReduceBitmapsResolutionLB( this, SfxResId( LB_REDUCEBITMAPS_RESOLUTION ) ),
74     aReduceBitmapsTransparencyCB( this, SfxResId( CB_REDUCEBITMAPS_TRANSPARENCY ) ),
75     aConvertToGreyscalesCB( this, SfxResId( CB_CONVERTTOGREYSCALES ) ),
76     aWarnGB( this, SfxResId( GB_PRINT_WARN ) ),
77     aPaperSizeCB( this, SfxResId( CB_PAPERSIZE ) ),
78     aPaperOrientationCB( this, SfxResId( CB_PAPERORIENTATION ) ),
79     aTransparencyCB( this, SfxResId( CB_TRANSPARENCY ) )
80 {
81 	FreeResource();
82 
83     aOutputGB.SetStyle( aOutputGB.GetStyle() | WB_NOLABEL );
84 
85     if( bOutputForPrinter )
86     {
87         aPrinterOutputRB.Check( sal_True );
88         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrinterOutputRB.GetText() ) );
89     }
90     else
91     {
92         aPrintFileOutputRB.Check( sal_True );
93         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrintFileOutputRB.GetText() ) );
94     }
95 
96     aPrinterOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
97     aPrintFileOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
98 
99     aReduceTransparencyCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
100     aReduceGradientsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
101     aReduceBitmapsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
102 
103     aReduceGradientsStripesRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) );
104     aReduceBitmapsResolutionRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) );
105 
106     // --> PB 2008-06-09 #i89164#
107     // calculate dynamically the width of radiobutton and listbox
108     const long nOffset = 10;
109     Size aOldSize = aReduceBitmapsResolutionRB.GetSizePixel();
110     Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize( WINDOWSIZE_PREFERRED );
111     aNewSize.Width() += nOffset;
112     aNewSize.Height() = aOldSize.Height();
113     long nDelta = aOldSize.Width() - aNewSize.Width();
114     aReduceBitmapsResolutionRB.SetSizePixel( aNewSize );
115     Point aPos = aReduceBitmapsResolutionLB.GetPosPixel();
116     aPos.X() -= nDelta;
117     aOldSize = aReduceBitmapsResolutionLB.GetSizePixel();
118     aNewSize = aReduceBitmapsResolutionLB.GetOptimalSize( WINDOWSIZE_PREFERRED );
119     aNewSize.Width() += nOffset;
120     aNewSize.Height() = aOldSize.Height();
121     aReduceBitmapsResolutionLB.SetPosSizePixel( aPos, aNewSize );
122     // <--
123 }
124 
125 // -----------------------------------------------------------------------------
126 
~SfxCommonPrintOptionsTabPage()127 SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage()
128 {
129 }
130 
131 // -----------------------------------------------------------------------------
132 
Create(Window * pParent,const SfxItemSet & rAttrSet)133 SfxTabPage*	SfxCommonPrintOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
134 {
135 	return( new SfxCommonPrintOptionsTabPage( pParent, rAttrSet ) );
136 }
137 
138 // -----------------------------------------------------------------------------
139 
GetParentLabeledBy(const Window * pWindow) const140 Window*	SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const Window* pWindow ) const
141 {
142 	if ( pWindow == (Window *)&aReduceGradientsStepCountNF )
143 		return (Window *)&aReduceGradientsStripesRB;
144 	else if ( pWindow == (Window *)&aReduceBitmapsResolutionLB )
145 		return (Window *)&aReduceBitmapsResolutionRB;
146 	else
147 		return SfxTabPage::GetParentLabeledBy( pWindow );
148 }
149 
GetParentLabelFor(const Window * pWindow) const150 Window*	SfxCommonPrintOptionsTabPage::GetParentLabelFor( const Window* pWindow ) const
151 {
152 	if ( pWindow == (Window *)&aReduceGradientsStripesRB )
153 		return (Window *)&aReduceGradientsStepCountNF;
154 	else if ( pWindow == (Window *)&aReduceBitmapsResolutionRB )
155 		return (Window *)&aReduceBitmapsResolutionLB;
156 	else
157 		return SfxTabPage::GetParentLabelFor( pWindow );
158 }
159 
160 // -----------------------------------------------------------------------------
161 
FillItemSet(SfxItemSet &)162 sal_Bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ )
163 {
164     SvtPrintWarningOptions  aWarnOptions;
165     SvtPrinterOptions       aPrinterOptions;
166     SvtPrintFileOptions     aPrintFileOptions;
167 	sal_Bool                    bModified = sal_False;
168 
169 
170     if( aPaperSizeCB.IsChecked() != aPaperSizeCB.GetSavedValue())
171         aWarnOptions.SetPaperSize(aPaperSizeCB.IsChecked());
172     if( aPaperOrientationCB.IsChecked() != aPaperOrientationCB.GetSavedValue() )
173         aWarnOptions.SetPaperOrientation(aPaperOrientationCB.IsChecked());
174 
175     if( aTransparencyCB.IsChecked() != aTransparencyCB.GetSavedValue() )
176         aWarnOptions.SetTransparency( aTransparencyCB.IsChecked() );
177 
178     ImplSaveControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
179 
180     aPrinterOptions.SetPrinterOptions( maPrinterOptions );
181     aPrintFileOptions.SetPrinterOptions( maPrintFileOptions );
182 
183     return bModified;
184 }
185 
186 // -----------------------------------------------------------------------------
187 
Reset(const SfxItemSet &)188 void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet& /*rSet*/ )
189 {
190     SvtPrintWarningOptions  aWarnOptions;
191     SvtPrinterOptions       aPrinterOptions;
192     SvtPrintFileOptions     aPrintFileOptions;
193 
194     aPaperSizeCB.Check( aWarnOptions.IsPaperSize() );
195     aPaperOrientationCB.Check( aWarnOptions.IsPaperOrientation() );
196 
197     aTransparencyCB.Check( aWarnOptions.IsTransparency() );
198 
199     aPaperSizeCB.SaveValue();
200 	aPaperOrientationCB.SaveValue();
201 	aTransparencyCB.SaveValue();
202 
203     aPrinterOptions.GetPrinterOptions( maPrinterOptions );
204     aPrintFileOptions.GetPrinterOptions( maPrintFileOptions );
205 
206     ImplUpdateControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
207 
208     // --> OD 2008-06-25 #i63982#
209     ImplSetAccessibleNames();
210     // <--
211 }
212 
213 // -----------------------------------------------------------------------------
214 
DeactivatePage(SfxItemSet * pItemSet)215 int SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet )
216 {
217     if( pItemSet )
218 		FillItemSet( *pItemSet );
219 
220 	return LEAVE_PAGE;
221 }
222 
223 // -----------------------------------------------------------------------------
224 
ImplUpdateControls(const PrinterOptions * pCurrentOptions)225 void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCurrentOptions )
226 {
227     aReduceTransparencyCB.Check( pCurrentOptions->IsReduceTransparency() );
228 
229     if( pCurrentOptions->GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO )
230         aReduceTransparencyAutoRB.Check( sal_True );
231     else
232         aReduceTransparencyNoneRB.Check( sal_True );
233 
234     aReduceGradientsCB.Check( pCurrentOptions->IsReduceGradients() );
235 
236     if( pCurrentOptions->GetReducedGradientMode() == PRINTER_GRADIENT_STRIPES )
237         aReduceGradientsStripesRB.Check( sal_True );
238     else
239         aReduceGradientsColorRB.Check( sal_True );
240 
241     aReduceGradientsStepCountNF.SetValue( pCurrentOptions->GetReducedGradientStepCount() );
242 
243     aReduceBitmapsCB.Check( pCurrentOptions->IsReduceBitmaps() );
244 
245     if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_OPTIMAL )
246         aReduceBitmapsOptimalRB.Check( sal_True );
247     else if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_NORMAL )
248         aReduceBitmapsNormalRB.Check( sal_True );
249     else
250         aReduceBitmapsResolutionRB.Check( sal_True );
251 
252     const sal_uInt16 nDPI = pCurrentOptions->GetReducedBitmapResolution();
253 
254     if( nDPI < aDPIArray[ 0 ] )
255         aReduceBitmapsResolutionLB.SelectEntryPos( 0 );
256     else
257     {
258         for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- )
259         {
260             if( nDPI >= aDPIArray[ i ] )
261             {
262                 aReduceBitmapsResolutionLB.SelectEntryPos( (sal_uInt16) i );
263                 i = -1;
264             }
265         }
266     }
267 
268     aReduceBitmapsResolutionLB.SetText( aReduceBitmapsResolutionLB.GetEntry( aReduceBitmapsResolutionLB.GetSelectEntryPos() ) );
269 
270     aReduceBitmapsTransparencyCB.Check( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
271     aConvertToGreyscalesCB.Check( pCurrentOptions->IsConvertToGreyscales() );
272 
273     ClickReduceTransparencyCBHdl( &aReduceTransparencyCB );
274     ClickReduceGradientsCBHdl( &aReduceGradientsCB );
275     ClickReduceBitmapsCBHdl( &aReduceBitmapsCB );
276 }
277 
278 // -----------------------------------------------------------------------------
279 
ImplSetAccessibleNames()280 void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames()
281 {
282     static const String cSeparator = String::CreateFromAscii( " - " );
283 
284     String sReduceText = aReduceGB.GetDisplayText();
285     sReduceText += cSeparator;
286 
287     String sAccessibleName = sReduceText;
288     sAccessibleName += aPrinterOutputRB.GetDisplayText();
289     aPrinterOutputRB.SetAccessibleName( sAccessibleName );
290 
291     sAccessibleName = sReduceText;
292     sAccessibleName += aPrintFileOutputRB.GetDisplayText();
293     aPrintFileOutputRB.SetAccessibleName( sAccessibleName );
294 
295     String sOutputText = sReduceText;
296     sOutputText += aOutputGB.GetDisplayText();
297     sOutputText += cSeparator;
298 
299     sAccessibleName = sOutputText;
300     sAccessibleName += aReduceTransparencyCB.GetDisplayText();
301     aReduceTransparencyCB.SetAccessibleName( sAccessibleName );
302 
303     String sTransparencyText = aReduceTransparencyCB.GetAccessibleName();
304     sTransparencyText += cSeparator;
305 
306     sAccessibleName = sTransparencyText;
307     sAccessibleName += aReduceTransparencyAutoRB.GetDisplayText();
308     aReduceTransparencyAutoRB.SetAccessibleName( sAccessibleName );
309 
310     sAccessibleName = sTransparencyText;
311     sAccessibleName += aReduceTransparencyNoneRB.GetDisplayText();
312     aReduceTransparencyNoneRB.SetAccessibleName( sAccessibleName );
313 
314     sAccessibleName = sOutputText;
315     sAccessibleName += aReduceGradientsCB.GetDisplayText();
316     aReduceGradientsCB.SetAccessibleName( sAccessibleName );
317 
318     String sGradientText = aReduceGradientsCB.GetAccessibleName();
319     sGradientText += cSeparator;
320 
321     sAccessibleName = sGradientText;
322     sAccessibleName += aReduceGradientsStripesRB.GetDisplayText();
323     aReduceGradientsStripesRB.SetAccessibleName( sAccessibleName );
324 
325     sAccessibleName = aReduceGradientsStripesRB.GetAccessibleName();
326     aReduceGradientsStepCountNF.SetAccessibleName( sAccessibleName );
327 
328     sAccessibleName = sGradientText;
329     sAccessibleName += aReduceGradientsColorRB.GetDisplayText();
330     aReduceGradientsColorRB.SetAccessibleName( sAccessibleName );
331 
332     sAccessibleName = sOutputText;
333     sAccessibleName += aReduceBitmapsCB.GetDisplayText();
334     aReduceBitmapsCB.SetAccessibleName( sAccessibleName );
335 
336     String sBitmapText = aReduceBitmapsCB.GetAccessibleName();
337     sBitmapText += cSeparator;
338 
339     sAccessibleName = sBitmapText;
340     sAccessibleName += aReduceBitmapsOptimalRB.GetDisplayText();
341     aReduceBitmapsOptimalRB.SetAccessibleName( sAccessibleName );
342 
343     sAccessibleName = sBitmapText;
344     sAccessibleName += aReduceBitmapsNormalRB.GetDisplayText();
345     aReduceBitmapsNormalRB.SetAccessibleName( sAccessibleName );
346 
347     sAccessibleName = sBitmapText;
348     sAccessibleName += aReduceBitmapsResolutionRB.GetDisplayText();
349     aReduceBitmapsResolutionRB.SetAccessibleName( sAccessibleName );
350 
351     sAccessibleName = aReduceBitmapsResolutionRB.GetAccessibleName();
352     aReduceBitmapsResolutionLB.SetAccessibleName( sAccessibleName );
353 
354     sAccessibleName = sBitmapText;
355     sAccessibleName += aReduceBitmapsTransparencyCB.GetDisplayText();
356     aReduceBitmapsTransparencyCB.SetAccessibleName( sAccessibleName );
357 
358     sAccessibleName = sOutputText;
359     sAccessibleName += aConvertToGreyscalesCB.GetDisplayText();
360     aConvertToGreyscalesCB.SetAccessibleName( sAccessibleName );
361 
362     String sWarnText = aWarnGB.GetDisplayText();
363     sWarnText += cSeparator;
364 
365     sAccessibleName = sWarnText;
366     sAccessibleName += aPaperSizeCB.GetDisplayText();
367     aPaperSizeCB.SetAccessibleName( sAccessibleName );
368 
369     sAccessibleName = sWarnText;
370     sAccessibleName += aPaperOrientationCB.GetDisplayText();
371     aPaperOrientationCB.SetAccessibleName( sAccessibleName );
372 
373     sAccessibleName = sWarnText;
374     sAccessibleName += aTransparencyCB.GetDisplayText();
375     aTransparencyCB.SetAccessibleName( sAccessibleName );
376 }
377 
378 // -----------------------------------------------------------------------------
379 
ImplSaveControls(PrinterOptions * pCurrentOptions)380 void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOptions )
381 {
382     pCurrentOptions->SetReduceTransparency( aReduceTransparencyCB.IsChecked() );
383     pCurrentOptions->SetReducedTransparencyMode( aReduceTransparencyAutoRB.IsChecked() ? PRINTER_TRANSPARENCY_AUTO : PRINTER_TRANSPARENCY_NONE );
384     pCurrentOptions->SetReduceGradients( aReduceGradientsCB.IsChecked() );
385     pCurrentOptions->SetReducedGradientMode( aReduceGradientsStripesRB.IsChecked() ? PRINTER_GRADIENT_STRIPES : PRINTER_GRADIENT_COLOR  );
386     pCurrentOptions->SetReducedGradientStepCount( (sal_uInt16) aReduceGradientsStepCountNF.GetValue() );
387     pCurrentOptions->SetReduceBitmaps( aReduceBitmapsCB.IsChecked() );
388     pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL :
389                                            ( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) );
390     pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) aReduceBitmapsResolutionLB.GetSelectEntryPos(),
391                                                             (sal_uInt16)( sizeof( aDPIArray ) / sizeof( aDPIArray[ 0 ] ) - 1 ) ) ] );
392     pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
393     pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
394 }
395 
396 // -----------------------------------------------------------------------------
397 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ClickReduceTransparencyCBHdl,CheckBox *,pBox)398 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox )
399 {
400     (void)pBox; //unused
401     const sal_Bool bReduceTransparency = aReduceTransparencyCB.IsChecked();
402 
403     aReduceTransparencyAutoRB.Enable( bReduceTransparency );
404     aReduceTransparencyNoneRB.Enable( bReduceTransparency );
405 
406     aTransparencyCB.Enable( !bReduceTransparency );
407 
408     return 0;
409 }
410 
411 // -----------------------------------------------------------------------------
412 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ClickReduceGradientsCBHdl,CheckBox *,pBox)413 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, CheckBox*, pBox )
414 {
415     (void)pBox; //unused
416     const sal_Bool bEnable = aReduceGradientsCB.IsChecked();
417 
418     aReduceGradientsStripesRB.Enable( bEnable );
419     aReduceGradientsColorRB.Enable( bEnable );
420     aReduceGradientsStepCountNF.Enable( bEnable );
421 
422     ToggleReduceGradientsStripesRBHdl( &aReduceGradientsStripesRB );
423 
424     return 0;
425 }
426 
427 // -----------------------------------------------------------------------------
428 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ClickReduceBitmapsCBHdl,CheckBox *,pBox)429 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, CheckBox*, pBox )
430 {
431     (void)pBox; //unused
432     const sal_Bool bEnable = aReduceBitmapsCB.IsChecked();
433 
434     aReduceBitmapsOptimalRB.Enable( bEnable );
435     aReduceBitmapsNormalRB.Enable( bEnable );
436     aReduceBitmapsResolutionRB.Enable( bEnable );
437     aReduceBitmapsTransparencyCB.Enable( bEnable );
438     aReduceBitmapsResolutionLB.Enable( bEnable );
439 
440     ToggleReduceBitmapsResolutionRBHdl( &aReduceBitmapsResolutionRB );
441 
442     return 0;
443 }
444 
445 // -----------------------------------------------------------------------------
446 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ToggleReduceGradientsStripesRBHdl,RadioButton *,pButton)447 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl, RadioButton*, pButton )
448 {
449     (void)pButton; //unused
450     const sal_Bool bEnable = aReduceGradientsCB.IsChecked() && aReduceGradientsStripesRB.IsChecked();
451 
452     aReduceGradientsStepCountNF.Enable( bEnable );
453 
454     return 0;
455 }
456 
457 // -----------------------------------------------------------------------------
458 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ToggleReduceBitmapsResolutionRBHdl,RadioButton *,pButton)459 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl, RadioButton*, pButton )
460 {
461     (void)pButton; //unused
462     const sal_Bool bEnable = aReduceBitmapsCB.IsChecked() && aReduceBitmapsResolutionRB.IsChecked();
463 
464     aReduceBitmapsResolutionLB.Enable( bEnable );
465 
466     return 0;
467 }
468 
469 // -----------------------------------------------------------------------------
470 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ToggleOutputPrinterRBHdl,RadioButton *,pButton)471 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, pButton )
472 {
473     if( pButton->IsChecked() )
474     {
475         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
476         ImplUpdateControls( &maPrinterOptions );
477         bOutputForPrinter = sal_True;
478         // --> OD 2008-06-25 #i63982#
479         ImplSetAccessibleNames();
480         // <--
481     }
482     else
483         ImplSaveControls( &maPrinterOptions );
484 
485     return 0;
486 }
487 
488 // -----------------------------------------------------------------------------
489 
IMPL_LINK(SfxCommonPrintOptionsTabPage,ToggleOutputPrintFileRBHdl,RadioButton *,pButton)490 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton*, pButton )
491 {
492     if( pButton->IsChecked() )
493     {
494         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
495         ImplUpdateControls( &maPrintFileOptions );
496         bOutputForPrinter = sal_False;
497         // --> OD 2008-06-25 #i63982#
498         ImplSetAccessibleNames();
499         // <--
500     }
501     else
502         ImplSaveControls( &maPrintFileOptions );
503 
504     return 0;
505 }
506 
507 // -------------------------------
508 // - TransparencyPrintWarningBox -
509 // -------------------------------
510 
TransparencyPrintWarningBox(Window * pParent)511 TransparencyPrintWarningBox::TransparencyPrintWarningBox( Window* pParent ) :
512 	ModalDialog( pParent, SfxResId( RID_WARN_PRINTTRANSPARENCY ) ),
513 	aWarnFI		( this, SfxResId( FI_PRINTTRANSWARN ) ),
514 	aWarnFT		( this, SfxResId( FT_PRINTTRANSWARN ) ),
515 	aYesBtn		( this, SfxResId( BTN_PRINTTRANS_YES ) ),
516 	aNoBtn		( this, SfxResId( BTN_PRINTTRANS_NO ) ),
517 	aCancelBtn	( this, SfxResId( BTN_PRINTTRANS_CANCEL ) ),
518 	aNoWarnCB	( this, SfxResId( CBX_NOPRINTTRANSWARN ) )
519 {
520 	FreeResource();
521 
522 	aWarnFT.SetStyle( aWarnFT.GetStyle() | WB_INFO );
523 	aWarnFI.SetImage( WarningBox::GetStandardImage() );
524 
525     aNoBtn.SetClickHdl( LINK( this, TransparencyPrintWarningBox, ClickNoBtn ) );
526 }
527 
528 // -----------------------------------------------------------------------------
529 
~TransparencyPrintWarningBox()530 TransparencyPrintWarningBox::~TransparencyPrintWarningBox()
531 {
532 }
533 
534 // -----------------------------------------------------------------------------
535 
IMPL_LINK(TransparencyPrintWarningBox,ClickNoBtn,PushButton *,pButton)536 IMPL_LINK( TransparencyPrintWarningBox, ClickNoBtn, PushButton*, pButton )
537 {
538     (void)pButton; //unused
539     EndDialog( RET_NO );
540     return 0;
541 }
542