diff options
author | Philipp Lohmann <pl@openoffice.org> | 2009-07-27 18:42:13 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2009-07-27 18:42:13 +0000 |
commit | 93e111d0778d7555df7b5a01042183687595f872 (patch) | |
tree | 03a3e6aad8c4dcedbe2846ffe9e21648307b7151 /vcl | |
parent | efe311f79e12853753d50ffaf73630dfc88c1c09 (diff) |
#i92518# adapting new UX spec
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/arrange.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/vcl/print.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/vcl/prndlg.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/vcl/svids.hrc | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 7 | ||||
-rw-r--r-- | vcl/source/src/print.src | 11 | ||||
-rw-r--r-- | vcl/source/window/arrange.cxx | 44 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 46 |
8 files changed, 106 insertions, 17 deletions
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx index 54727d24755b..b4e32350d685 100644 --- a/vcl/inc/vcl/arrange.hxx +++ b/vcl/inc/vcl/arrange.hxx @@ -60,11 +60,13 @@ namespace vcl boost::shared_ptr<WindowArranger> m_pChild; sal_Int32 m_nExpandPriority; Size m_aMinSize; + bool m_bHidden; Element() : m_pElement( NULL ) , m_pChild() , m_nExpandPriority( 0 ) + , m_bHidden( false ) {} Element( Window* i_pWin, @@ -74,6 +76,7 @@ namespace vcl : m_pElement( i_pWin ) , m_pChild( i_pChild ) , m_nExpandPriority( i_nExpandPriority ) + , m_bHidden( false ) {} void deleteChild() { m_pChild.reset(); } @@ -147,6 +150,8 @@ namespace vcl return pEle != NULL; } + void show( bool i_bShow = true, bool i_bImmediateUpdate = true ); + void setManagedArea( const Rectangle& i_rArea ) { m_aManagedArea = i_rArea; diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 0241168bba0a..a6563d2b75ed 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -419,8 +419,8 @@ public: MultiPageSetup() : nRows( 1 ), nColumns( 1 ), nRepeat( 1 ), aPaperSize( 21000, 29700 ) - , nLeftMargin( 0 ), nTopMargin( 0 ) - , nRightMargin( 0 ), nBottomMargin( 0 ) + , nLeftMargin( 500 ), nTopMargin( 500 ) + , nRightMargin( 500 ), nBottomMargin( 500 ) , nHorizontalSpacing( 500 ), nVerticalSpacing( 500 ) , bDrawBorder( true ) { diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx index 6a8974ccb966..3f2fa7d3eb3b 100644 --- a/vcl/inc/vcl/prndlg.hxx +++ b/vcl/inc/vcl/prndlg.hxx @@ -96,6 +96,7 @@ namespace vcl CheckBox maBorderCB; vcl::RowOrColumn maLayout; + boost::shared_ptr< vcl::WindowArranger >mxAdvancedControls; void setupLayout(); @@ -114,6 +115,8 @@ namespace vcl public: FixedLine maPrinterFL; ListBox maPrinters; + PushButton maDetailsBtn; + FixedText maDetailsTxt; FixedText maStatusLabel; FixedText maStatusTxt; FixedText maLocationLabel; @@ -139,6 +142,7 @@ namespace vcl vcl::RowOrColumn maLayout; boost::shared_ptr<vcl::RowOrColumn> mxPrintRange; + boost::shared_ptr<vcl::WindowArranger> mxDetails; JobTabPage( Window*, const ResId& ); virtual ~JobTabPage(); diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc index ed7f16cfb17c..9e24cffe48a1 100644 --- a/vcl/inc/vcl/svids.hrc +++ b/vcl/inc/vcl/svids.hrc @@ -135,6 +135,8 @@ #define SV_PRINT_STATUS_TXT 20 #define SV_PRINT_LOCATION_TXT 21 #define SV_PRINT_COMMENT_TXT 22 +#define SV_PRINT_DETAILS_BTN 23 +#define SV_PRINT_DETAILS_TXT 24 #define SV_PRINT_TAB_OPT 3 #define SV_PRINT_OPT_PRINT_FL 1 diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 2e2342fc6fc8..852e7983ac06 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1991,8 +1991,11 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const } // cf. ImplDrawPushButton ... - aSize.Width() += 8; - aSize.Height() += 8; + if( (GetStyle() & WB_SMALLSTYLE) == 0 ) + { + aSize.Width() += 8; + aSize.Height() += 8; + } return CalcWindowSize( aSize ); } diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index 600a690ef23d..63d5bc6047c5 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -266,6 +266,17 @@ ModalDialog SV_DLG_PRINT Size = MAP_APPFONT( 100, 80 ); Border = TRUE; }; + PushButton SV_PRINT_DETAILS_BTN + { + Pos = MAP_APPFONT( 5, 5 ); + Size = MAP_APPFONT( 5, 5 ); + }; + FixedText SV_PRINT_DETAILS_TXT + { + Pos = MAP_APPFONT( 5, 5 ); + Size = MAP_APPFONT( 10, 10 ); + Text [en-US] = "Printer details"; + }; FixedText SV_PRINT_STATUS_TXT { Pos = MAP_APPFONT( 5, 5 ); diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx index 4f03706b4264..e392a1cc7d5e 100644 --- a/vcl/source/window/arrange.cxx +++ b/vcl/source/window/arrange.cxx @@ -53,6 +53,31 @@ void WindowArranger::setParent( WindowArranger* i_pParent ) setParentWindow( m_pParentWindow ); } +void WindowArranger::show( bool i_bShow, bool i_bImmediateUpdate ) +{ + size_t nEle = countElements(); + for( size_t i = 0; i < nEle; i++ ) + { + Element* pEle = getElement( i ); + if( pEle ) // sanity check + { + pEle->m_bHidden = ! i_bShow; + if( pEle->m_pElement ) + pEle->m_pElement->Show( i_bShow ); + if( pEle->m_pChild.get() ) + pEle->m_pChild->show( i_bShow, false ); + } + } + if( i_bImmediateUpdate ) + { + // find the topmost parent + WindowArranger* pResize = this; + while( pResize->m_pParentArranger ) + pResize = pResize->m_pParentArranger; + pResize->resize(); + } +} + sal_Int32 WindowArranger::Element::getExpandPriority() const { sal_Int32 nPrio = m_nExpandPriority; @@ -72,14 +97,17 @@ sal_Int32 WindowArranger::Element::getExpandPriority() const Size WindowArranger::Element::getOptimalSize( WindowSizeType i_eType ) const { Size aResult; - if( m_pElement ) - aResult = m_pElement->GetOptimalSize( i_eType ); - else if( m_pChild ) - aResult = m_pChild->getOptimalSize( i_eType ); - if( aResult.Width() < m_aMinSize.Width() ) - aResult.Width() = m_aMinSize.Width(); - if( aResult.Height() < m_aMinSize.Height() ) - aResult.Height() = m_aMinSize.Height(); + if( ! m_bHidden ) + { + if( m_pElement && m_pElement->IsVisible() ) + aResult = m_pElement->GetOptimalSize( i_eType ); + else if( m_pChild ) + aResult = m_pChild->getOptimalSize( i_eType ); + if( aResult.Width() < m_aMinSize.Width() ) + aResult.Width() = m_aMinSize.Width(); + if( aResult.Height() < m_aMinSize.Height() ) + aResult.Height() = m_aMinSize.Height(); + } return aResult; } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index dd618766451c..79cb63cbfa3d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -228,6 +228,9 @@ void PrintDialog::NUpTabPage::setupLayout() boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) ); maLayout.addChild( xIndent ); + // remember advanced controls to show/hide + mxAdvancedControls = xIndent; + boost::shared_ptr< vcl::RowOrColumn > xCol( new vcl::RowOrColumn( xIndent.get() ) ); xIndent->setChild( xCol ); @@ -259,6 +262,9 @@ void PrintDialog::NUpTabPage::setupLayout() xRow->addWindow( &maNupOrderBox ); maLayout.addWindow( &maBorderCB ); + + // initially advanced controls are not show, rows=columns=1 + mxAdvancedControls->show( false, false ); } void PrintDialog::NUpTabPage::Resize() @@ -287,6 +293,8 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId ) : TabPage( i_pParent, rResId ) , maPrinterFL( this, VclResId( SV_PRINT_PRINTERS_FL ) ) , maPrinters( this, VclResId( SV_PRINT_PRINTERS ) ) + , maDetailsBtn( this, VclResId( SV_PRINT_DETAILS_BTN ) ) + , maDetailsTxt( this, VclResId( SV_PRINT_DETAILS_TXT ) ) , maStatusLabel( this, VclResId( SV_PRINT_STATUS_TXT ) ) , maStatusTxt( this, 0 ) , maLocationLabel( this, VclResId( SV_PRINT_LOCATION_TXT ) ) @@ -351,9 +359,25 @@ void PrintDialog::JobTabPage::setupLayout() // add print LB maLayout.addWindow( &maPrinters ); + // create a row for details button/text and properties button + boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) ); + maLayout.addChild( xDetRow ); + xDetRow->addWindow( &maDetailsBtn ); + xDetRow->addWindow( &maDetailsTxt ); + xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) ); + xDetRow->addWindow( &maSetupButton ); + + // create an indent for details + boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) ); + maLayout.addChild( xIndent ); + // remember details controls + mxDetails = xIndent; + // create a column for the details + boost::shared_ptr< vcl::RowOrColumn > xDetCol( new vcl::RowOrColumn( xIndent.get() ) ); + xIndent->setChild( xDetCol ); // create a row for stati and properties button - boost::shared_ptr< vcl::RowOrColumn > xStateRow( new vcl::RowOrColumn( &maLayout, false ) ); - maLayout.addChild( xStateRow ); + boost::shared_ptr< vcl::RowOrColumn > xStateRow( new vcl::RowOrColumn( xDetCol.get(), false ) ); + xDetCol->addChild( xStateRow ); boost::shared_ptr< vcl::RowOrColumn > xLabelCol( new vcl::RowOrColumn( xStateRow.get(), true, aBorder.Height() ) ); xStateRow->addChild( xLabelCol ); xLabelCol->addWindow( &maStatusLabel ); @@ -366,8 +390,6 @@ void PrintDialog::JobTabPage::setupLayout() xStatusCol->addWindow( &maLocationTxt ); xStatusCol->addWindow( &maCommentTxt ); - xStateRow->addWindow( &maSetupButton ); - // add print range and copies columns maLayout.addWindow( &maCopies ); boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) ); @@ -390,6 +412,11 @@ void PrintDialog::JobTabPage::setupLayout() xCopyCollateCol->addChild( xCollateRow ); xCollateRow->addWindow( &maCollateBox ); xCollateRow->addWindow( &maCollateImage ); + + maDetailsBtn.SetSymbol( SYMBOL_SPIN_DOWN ); + maDetailsBtn.SetSmallSymbol(); + maDetailsBtn.SetStyle( maDetailsBtn.GetStyle() | (WB_SMALLSTYLE | WB_BEVELBUTTON) ); + mxDetails->show( false, false ); } void PrintDialog::JobTabPage::readFromSettings() @@ -605,6 +632,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont maBackwardBtn.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); maJobPage.maCollateBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maJobPage.maSetupButton.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + maJobPage.maDetailsBtn.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); @@ -1283,6 +1311,7 @@ void PrintDialog::checkControlDependencies() aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width(); maJobPage.maPrinters.SetSizePixel( aPrinterSize ); maJobPage.maSetupButton.Show(); + maLayout.resize(); } } else @@ -1296,6 +1325,7 @@ void PrintDialog::checkControlDependencies() aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X(); maJobPage.maPrinters.SetSizePixel( aPrinterSize ); maJobPage.maSetupButton.Hide(); + maLayout.resize(); } } } @@ -1455,7 +1485,6 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) if( pBox == &maJobPage.maPrinters ) { String aNewPrinter( pBox->GetSelectEntry() ); - maJobPage.maPrinters.SelectEntry( aNewPrinter ); // set new printer maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aNewPrinter ) ) ); // update text fields @@ -1505,6 +1534,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) maNUpPage.maNupRowsEdt.SetValue( nRows ); maNUpPage.maNupColEdt.SetValue( nCols ); updateNup(); + maNUpPage.mxAdvancedControls->show( bCustom ); } return 0; @@ -1530,6 +1560,12 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); maLayout.resize(); } + else if( pButton == &maJobPage.maDetailsBtn ) + { + bool bShow = ! maJobPage.maStatusTxt.IsVisible(); + maJobPage.maDetailsBtn.SetSymbol( bShow ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN ); + maJobPage.mxDetails->show( bShow ); + } else if( pButton == &maJobPage.maCollateBox ) { maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ), |