printerpullpages: #i106506# disable Pages radio button where unused

This commit is contained in:
Philipp Lohmann [pl] 2009-11-18 18:22:58 +01:00
parent c0879d0fd9
commit 7a172afb40
2 changed files with 19 additions and 1 deletions

View file

@ -101,6 +101,7 @@ namespace vcl
FixedLine maNupLine;
RadioButton maPagesBtn;
RadioButton maBrochureBtn;
FixedText maPagesBoxTitleTxt;
ListBox maNupPagesBox;
// controls for "Custom" page mode
@ -126,6 +127,7 @@ namespace vcl
vcl::RowOrColumn maLayout;
boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
void setupLayout();

View file

@ -285,6 +285,7 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
, maNupLine( this, VclResId( SV_PRINT_PRT_NUP_LAYOUT_FL ) )
, maPagesBtn( this, VclResId( SV_PRINT_PRT_NUP_PAGES_BTN ) )
, maBrochureBtn( this, VclResId( SV_PRINT_PRT_NUP_BROCHURE_BTN ) )
, maPagesBoxTitleTxt( this, 0 )
, maNupPagesBox( this, VclResId( SV_PRINT_PRT_NUP_PAGES_BOX ) )
, maNupNumPagesTxt( this, VclResId( SV_PRINT_PRT_NUP_NUM_PAGES_TXT ) )
, maNupColEdt( this, VclResId( SV_PRINT_PRT_NUP_COLS_EDT ) )
@ -330,6 +331,7 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
maNupLine.SMHID2("NUpPage", "Layout");
maBrochureBtn.SMHID2("NUpPage", "Brochure" );
maPagesBtn.SMHID2( "NUpPage", "PagesPerSheet" );
maPagesBoxTitleTxt.SMHID2( "NUpPage", "PagesPerSheetLabel" );
maNupPagesBox.SMHID2( "NUpPage", "PagesPerSheetBox" );
maNupNumPagesTxt.SMHID2( "NUpPage", "Columns" );
maNupColEdt.SMHID2( "NUpPage", "ColumnsBox" );
@ -415,7 +417,8 @@ void PrintDialog::NUpTabPage::setupLayout()
boost::shared_ptr< vcl::LabelColumn > xMainCol( new vcl::LabelColumn( xIndent.get() ) );
xIndent->setChild( xMainCol );
xMainCol->addRow( &maPagesBtn, &maNupPagesBox );
size_t nPagesIndex = xMainCol->addRow( &maPagesBtn, &maNupPagesBox );
mxPagesBtnLabel = boost::dynamic_pointer_cast<vcl::LabeledElement>( xMainCol->getChild( nPagesIndex ) );
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
xMainCol->addRow( &maNupNumPagesTxt, xRow, nIndent );
@ -1510,6 +1513,19 @@ void PrintDialog::setupOptionalUI()
}
}
// #i106506# if no brochure button, then the singular Pages radio button
// makes no sense, so replace it by a FixedText label
if( ! maNUpPage.maBrochureBtn.IsVisible() )
{
if( maNUpPage.mxPagesBtnLabel.get() )
{
maNUpPage.maPagesBoxTitleTxt.SetText( maNUpPage.maPagesBtn.GetText() );
maNUpPage.maPagesBoxTitleTxt.Show( TRUE );
maNUpPage.mxPagesBtnLabel->setLabel( &maNUpPage.maPagesBoxTitleTxt );
maNUpPage.maPagesBtn.Show( FALSE );
}
}
// update enable states
checkOptionalControlDependencies();