diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-10 16:59:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:44 +0100 |
commit | 87b5cdd5ed13f5d05fe90b11b01e3832e5725b72 (patch) | |
tree | 3ce67b9dd7f1c9378a09b0d55bafb8d416f7d894 | |
parent | 644cb58ac6ea53abab37c61e49d047eab0a1735c (diff) |
convert writer, draw, impress, calc and starmath printer dialogs
to new-style widget layout mostly described in .ui format
Change-Id: I8ead53a246a8ac3e2d446d158f06d7e2e436ce60
35 files changed, 3677 insertions, 1441 deletions
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx index 8aafe05d423a..9fe4ae711ef5 100644 --- a/basctl/source/basicide/basicrenderable.cxx +++ b/basctl/source/basicide/basicrenderable.cxx @@ -44,37 +44,33 @@ Renderable::Renderable (BaseWindow* pWin) m_aUIProperties.realloc( 3 ); - // create Subgroup for print range + // show Subgroup for print range vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); aPrintRangeOpt.mbInternalOnly = true; - m_aUIProperties[0].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), - rtl::OUString(), - aPrintRangeOpt - ); + m_aUIProperties[0].Value = setSubgroupControlOpt("printrange", + rtl::OUString(aStrings.GetString(0)), rtl::OUString(), aPrintRangeOpt); // create a choice for the range to print rtl::OUString aPrintContentName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ); Sequence< rtl::OUString > aChoices( 2 ); Sequence< rtl::OUString > aHelpIds( 2 ); + Sequence< rtl::OUString > aWidgetIds( 2 ); aChoices[0] = aStrings.GetString( 1 ); aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) ); aChoices[1] = aStrings.GetString( 2 ); aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) ); - m_aUIProperties[1].Value = getChoiceControlOpt( rtl::OUString(), - aHelpIds, - aPrintContentName, - aChoices, - 0 ); + aWidgetIds[0] = rtl::OUString("printallpages"); + aWidgetIds[1] = rtl::OUString("printpages"); + m_aUIProperties[1].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(), + aHelpIds, aPrintContentName, + aChoices, 0); // create a an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt(aPrintContentName, 1, true); - m_aUIProperties[2].Value = getEditControlOpt( rtl::OUString(), - rtl::OUString(), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), - rtl::OUString(), - aPageRangeOpt - ); + m_aUIProperties[2].Value = setEditControlOpt("pagerange", rtl::OUString(), + rtl::OUString(), "PageRange", + rtl::OUString(), aPageRangeOpt); } Renderable::~Renderable() diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index a7f7c15c8aee..649a6fca0b4f 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -31,6 +31,7 @@ $(eval $(call gb_Module_add_targets,sc,\ Library_scfilt \ Library_scui \ Package_uiconfig \ + UI_scalc \ )) ifneq ($(DISABLE_SCRIPTING),TRUE) diff --git a/sc/UI_scalc.mk b/sc/UI_scalc.mk new file mode 100644 index 000000000000..c2b21a951855 --- /dev/null +++ b/sc/UI_scalc.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UI_UI,modules/scalc)) + +$(eval $(call gb_UI_add_uifiles,modules/scalc,\ + sw/uiconfig/scalc/ui/printeroptions \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 51e50ed51386..9d5964236895 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -231,62 +231,69 @@ ScPrintUIOptions::ScPrintUIOptions() if( aStrings.Count() < 10 ) // bad resource ? return; - m_aUIProperties.realloc( 8 ); + sal_Int32 nNumProps= 9, nIdx = 0; + + m_aUIProperties.realloc(nNumProps); + + // load the writer PrinterOptions into the custom tab + m_aUIProperties[nIdx].Name = rtl::OUString("OptionsUIFile"); + m_aUIProperties[nIdx++].Value <<= rtl::OUString("modules/scalc/ui/printeroptions.ui"); // create Section for spreadsheet (results in an extra tab page in dialog) SvtModuleOptions aOpt; String aAppGroupname( aStrings.GetString( 9 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) ); - m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + m_aUIProperties[nIdx++].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, rtl::OUString()); - // create subgroup for pages - m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() ); + // show subgroup for pages + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pages", rtl::OUString(aStrings.GetString(0)), rtl::OUString()); // create a bool option for empty pages - m_aUIProperties[2].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 1 ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsIncludeEmptyPages" ) ), - ! bSuppress - ); - // create Subgroup for print content + m_aUIProperties[nIdx++].Value = setBoolControlOpt("includeemptypages", rtl::OUString( aStrings.GetString( 1 ) ), + ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox", + "IsIncludeEmptyPages", + ! bSuppress); + // show Subgroup for print content vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); - m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 2 ) ), + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("printrange", rtl::OUString(aStrings.GetString(2)), rtl::OUString(), - aPrintRangeOpt - ); + aPrintRangeOpt); // create a choice for the content to create - uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 ); + uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 ), aWidgetIds( 3 ); aChoices[0] = aStrings.GetString( 3 ); aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) ); + aWidgetIds[0] = "printallsheets"; aChoices[1] = aStrings.GetString( 4 ); aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) ); + aWidgetIds[1] = "printselectedsheets"; aChoices[2] = aStrings.GetString( 5 ); aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) ); - m_aUIProperties[4].Value = getChoiceControlOpt( rtl::OUString(), - aHelpIds, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ), - aChoices, - nContent ); + aWidgetIds[2] = "printselectedcells"; + m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(), + aHelpIds, "PrintContent", + aChoices, nContent ); - // create Subgroup for print range + // show Subgroup for print range aPrintRangeOpt.mbInternalOnly = sal_True; - m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ), + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("fromwhich", rtl::OUString(aStrings.GetString(6)), rtl::OUString(), - aPrintRangeOpt - ); + aPrintRangeOpt); // create a choice for the range to print rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); aChoices.realloc( 2 ); aHelpIds.realloc( 2 ); + aWidgetIds.realloc( 2 ); aChoices[0] = aStrings.GetString( 7 ); aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0" ) ); + aWidgetIds[0] = "printallpages"; aChoices[1] = aStrings.GetString( 8 ); aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1" ) ); - m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(), + aWidgetIds[1] = "printpages"; + m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(), aHelpIds, aPrintRangeName, aChoices, @@ -294,12 +301,11 @@ ScPrintUIOptions::ScPrintUIOptions() // create a an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True ); - m_aUIProperties[7].Value = getEditControlOpt( rtl::OUString(), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), - rtl::OUString(), - aPageRangeOpt - ); + m_aUIProperties[nIdx++].Value = setEditControlOpt("pagerange", rtl::OUString(), + ".HelpID:vcl:PrintDialog:PageRange:Edit", + "PageRange", rtl::OUString(), aPageRangeOpt); + + assert(nIdx == nNumProps); } void ScPrintUIOptions::SetDefaults() diff --git a/sc/uiconfig/scalc/ui/printeroptions.ui b/sc/uiconfig/scalc/ui/printeroptions.ui new file mode 100644 index 000000000000..e65686f5d670 --- /dev/null +++ b/sc/uiconfig/scalc/ui/printeroptions.ui @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkBox" id="box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="pages"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkCheckButton" id="includeemptypages"> + <property name="label" translatable="yes">Include output of empty pages</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Pages</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> +</interface> diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk index c15646d809fa..163e6ed4c3e7 100644 --- a/sd/Module_sd.mk +++ b/sd/Module_sd.mk @@ -38,6 +38,8 @@ $(eval $(call gb_Module_add_targets,sd,\ Package_uiconfig \ Package_web \ Package_xml \ + UI_sdraw \ + UI_simpress \ )) ifneq ($(OS),DRAGONFLY) diff --git a/sd/UI_sdraw.mk b/sd/UI_sdraw.mk new file mode 100644 index 000000000000..c557e6683719 --- /dev/null +++ b/sd/UI_sdraw.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UI_UI,modules/sdraw)) + +$(eval $(call gb_UI_add_uifiles,modules/sdraw,\ + sd/uiconfig/sdraw/ui/printeroptions \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sd/UI_simpress.mk b/sd/UI_simpress.mk new file mode 100644 index 000000000000..3ddeac9192df --- /dev/null +++ b/sd/UI_simpress.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UI_UI,modules/simpress)) + +$(eval $(call gb_UI_add_uifiles,modules/simpress,\ + sd/uiconfig/simpress/ui/printeroptions \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 12d3bd224293..045971c75d8d 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -403,47 +403,51 @@ namespace { void ProcessResource() { + // load the writer PrinterOptions into the custom tab + beans::PropertyValue aOptionsUIFile; + aOptionsUIFile.Name = rtl::OUString("OptionsUIFile"); + if( mbImpress ) + aOptionsUIFile.Value <<= rtl::OUString("modules/simpress/ui/printeroptions.ui"); + else + aOptionsUIFile.Value <<= rtl::OUString("modules/sdraw/ui/printeroptions.ui"); + maProperties.push_back(aOptionsUIFile); + SvtModuleOptions aOpt; String aAppGroupname( String( SdResId( _STR_IMPRESS_PRINT_UI_GROUP_NAME ) ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( mbImpress ? SvtModuleOptions::E_SIMPRESS : SvtModuleOptions::E_SDRAW ) ); - AddDialogControl( vcl::PrinterOptionsHelper::getGroupControlOpt( - aAppGroupname, - ".HelpID:vcl:PrintDialog:TabPage:AppPage" - ) ); + AddDialogControl(vcl::PrinterOptionsHelper::setGroupControlOpt("tabcontrol-page2", aAppGroupname, ".HelpID:vcl:PrintDialog:TabPage:AppPage")); - uno::Sequence< rtl::OUString > aHelpIds; + uno::Sequence< rtl::OUString > aHelpIds, aWidgetIds; if( mbImpress ) { vcl::PrinterOptionsHelper::UIControlOptions aPrintOpt; aPrintOpt.maGroupHint = "JobPage" ; - AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setSubgroupControlOpt("extraimpressprintoptions", String( SdResId(_STR_IMPRESS_PRINT_UI_PRINT_GROUP) ), "", - aPrintOpt ) - ); + aPrintOpt )); aHelpIds.realloc( 1 ); aHelpIds[0] = ".HelpID:vcl:PrintDialog:PageContentType:ListBox" ; - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceListControlOpt( + "impressdocument", String( SdResId( _STR_IMPRESS_PRINT_UI_CONTENT ) ), aHelpIds, "PageContentType" , CreateChoice(_STR_IMPRESS_PRINT_UI_CONTENT_CHOICES), - 0, - "List" - ) + 0) ); aHelpIds[0] = ".HelpID:vcl:PrintDialog:SlidesPerPage:ListBox" ; vcl::PrinterOptionsHelper::UIControlOptions aContentOpt( "PageContentType" , 1 ); - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceListControlOpt( + "slidesperpage", String( SdResId( _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE ) ), aHelpIds, "SlidesPerPage" , GetSlidesPerPageSequence(), 0, - "List", Sequence< sal_Bool >(), aContentOpt ) @@ -451,25 +455,25 @@ namespace { aHelpIds[0] = ".HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox" ; vcl::PrinterOptionsHelper::UIControlOptions aSlidesPerPageOpt( "SlidesPerPage" , -1, sal_True ); - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceListControlOpt( + "slidesperpageorder", String( SdResId( _STR_IMPRESS_PRINT_UI_ORDER ) ), aHelpIds, "SlidesPerPageOrder" , CreateChoice(_STR_IMPRESS_PRINT_UI_ORDER_CHOICES), 0, - "List" , Sequence< sal_Bool >(), aSlidesPerPageOpt ) ); } - AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setSubgroupControlOpt("contents", String( SdResId(_STR_IMPRESS_PRINT_UI_INCLUDE_CONTENT) ), "" ) ); if( mbImpress ) { - AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setBoolControlOpt("printname", String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_NAME) ), ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" , "IsPrintName" , @@ -479,7 +483,7 @@ namespace { } else { - AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setBoolControlOpt("printname", String( SdResId(_STR_DRAW_PRINT_UI_IS_PRINT_NAME) ), ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" , "IsPrintName" , @@ -488,7 +492,7 @@ namespace { ); } - AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setBoolControlOpt("printdatetime", String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_DATE) ), ".HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox" , "IsPrintDateTime" , @@ -498,7 +502,7 @@ namespace { if( mbImpress ) { - AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setBoolControlOpt("printhidden", String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN) ), ".HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox" , "IsPrintHidden" , @@ -507,23 +511,27 @@ namespace { ); } - AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setSubgroupControlOpt("color", String( SdResId(_STR_IMPRESS_PRINT_UI_QUALITY) ), "" ) ); aHelpIds.realloc( 3 ); aHelpIds[0] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:0" ; aHelpIds[1] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:1" ; aHelpIds[2] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:2" ; - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + aWidgetIds.realloc( 3 ); + aWidgetIds[0] = "originalcolors"; + aWidgetIds[1] = "grayscale"; + aWidgetIds[2] = "blackandwhite"; + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt( + aWidgetIds, "", aHelpIds, "Quality" , CreateChoice(_STR_IMPRESS_PRINT_UI_QUALITY_CHOICES), - 0 - ) + 0) ); - AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setSubgroupControlOpt("pagesizes", String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS) ), "" ) ); aHelpIds.realloc( 4 ); @@ -531,17 +539,22 @@ namespace { aHelpIds[1] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:1" ; aHelpIds[2] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:2" ; aHelpIds[3] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:3" ; + aWidgetIds.realloc( 4 ); + aWidgetIds[0] = "originalsize"; + aWidgetIds[1] = "fittoprintable"; + aWidgetIds[2] = "distributeonmultiple"; + aWidgetIds[3] = "tilesheet"; if( mbImpress ) { // FIXME: additional dependency on PrintProspect = false vcl::PrinterOptionsHelper::UIControlOptions aPageOptionsOpt( "PageContentType" , 0 ); - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt( + aWidgetIds, "", aHelpIds, "PageOptions" , CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES), 0, - "Radio" , Sequence< sal_Bool >(), aPageOptionsOpt ) @@ -550,13 +563,13 @@ namespace { else { vcl::PrinterOptionsHelper::UIControlOptions aPageOptionsOpt( "PrintProspect" , sal_False ); - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt( + aWidgetIds, "", aHelpIds, "PageOptions" , CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW), 0, - "Radio" , Sequence< sal_Bool >(), aPageOptionsOpt ) @@ -565,12 +578,12 @@ namespace { vcl::PrinterOptionsHelper::UIControlOptions aBrochureOpt; aBrochureOpt.maGroupHint = "LayoutPage" ; - AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setSubgroupControlOpt("pagesides", String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_SIDES) ), "", aBrochureOpt ) ); // brochure printing - AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setBoolControlOpt("brochure", String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE) ), ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" , "PrintProspect" , @@ -584,13 +597,13 @@ namespace { aIncludeOpt.maGroupHint = "LayoutPage" ; aHelpIds.realloc( 1 ); aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox" ; - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceListControlOpt( + "brochureinclude", String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE) ), aHelpIds, "PrintProspectInclude" , CreateChoice(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST), 0, - "List" , Sequence< sal_Bool >(), aIncludeOpt ) @@ -599,7 +612,7 @@ namespace { // paper tray (on options page) vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt; aPaperTrayOpt.maGroupHint = "OptionsPageOptGroup" ; - AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setBoolControlOpt("printpaperfromsetup", String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY) ), ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" , "PrintPaperFromSetup" , @@ -611,7 +624,7 @@ namespace { vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; aPrintRangeOpt.mbInternalOnly = sal_True; aPrintRangeOpt.maGroupHint = "PrintRange" ; - AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt( + AddDialogControl( vcl::PrinterOptionsHelper::setSubgroupControlOpt("printrange", String( SdResId( _STR_IMPRESS_PRINT_UI_PAGE_RANGE ) ), "", aPrintRangeOpt ) @@ -623,7 +636,11 @@ namespace { aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ; aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ; aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ; - AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( "", + aWidgetIds.realloc( 3 ); + aWidgetIds[0] = "printallpages"; + aWidgetIds[1] = "printpages"; + aWidgetIds[2] = "printselection"; + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(aWidgetIds, "", aHelpIds, aPrintRangeName, CreateChoice(mbImpress @@ -633,12 +650,9 @@ namespace { ); // create a an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True ); - AddDialogControl( vcl::PrinterOptionsHelper::getEditControlOpt( "", - ".HelpID:vcl:PrintDialog:PageRange:Edit" , - "PageRange" , - OUString::valueOf(mnCurPage + 1), - aPageRangeOpt ) - ); + AddDialogControl(vcl::PrinterOptionsHelper::setEditControlOpt("pagerange", "", + ".HelpID:vcl:PrintDialog:PageRange:Edit", "PageRange", + OUString::valueOf(mnCurPage + 1), aPageRangeOpt)); FreeResource(); } diff --git a/sd/uiconfig/sdraw/ui/printeroptions.ui b/sd/uiconfig/sdraw/ui/printeroptions.ui new file mode 100644 index 000000000000..3718af3407ec --- /dev/null +++ b/sd/uiconfig/sdraw/ui/printeroptions.ui @@ -0,0 +1,283 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkBox" id="box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="contents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkCheckButton" id="printname"> + <property name="label" translatable="yes">Page name</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="printdatetime"> + <property name="label" translatable="yes">Date and time</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Contents</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="color"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="originalcolors"> + <property name="label" translatable="yes">Original size</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">grayscale</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="grayscale"> + <property name="label" translatable="yes">Grayscale</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">blackandwhite</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="blackandwhite"> + <property name="label" translatable="yes">Black & white</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">originalcolors</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Color</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="pagesizes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="originalsize"> + <property name="label" translatable="yes">Original size</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">fittoprintable</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="fittoprintable"> + <property name="label" translatable="yes">Fit to printable page</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">distributeonmultiple</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="distributeonmultiple"> + <property name="label" translatable="yes">Distribute on multiple sheets of paper</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">tilesheet</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="tilesheet"> + <property name="label" translatable="yes">Tile sheet of paper with repeated pages</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">originalsize</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Size</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> +</interface> diff --git a/sd/uiconfig/simpress/ui/printeroptions.ui b/sd/uiconfig/simpress/ui/printeroptions.ui new file mode 100644 index 000000000000..99117c5a3e22 --- /dev/null +++ b/sd/uiconfig/simpress/ui/printeroptions.ui @@ -0,0 +1,300 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkBox" id="box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="contents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkCheckButton" id="printname"> + <property name="label" translatable="yes">Slide name</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="printdatetime"> + <property name="label" translatable="yes">Date and time</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="printhidden"> + <property name="label" translatable="yes">Hidden pages</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Contents</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="color"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="originalcolors"> + <property name="label" translatable="yes">Original size</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">grayscale</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="grayscale"> + <property name="label" translatable="yes">Grayscale</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">blackandwhite</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="blackandwhite"> + <property name="label" translatable="yes">Black & white</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">originalcolors</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Color</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="pagesizes"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="originalsize"> + <property name="label" translatable="yes">Original size</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">fittoprintable</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="fittoprintable"> + <property name="label" translatable="yes">Fit to printable page</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">distributeonmultiple</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="distributeonmultiple"> + <property name="label" translatable="yes">Distribute on multiple sheets of paper</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">tilesheet</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="tilesheet"> + <property name="label" translatable="yes">Tile sheet of paper with repeated slides</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">originalsize</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Size</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> +</interface> diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index ec88716e179d..7155eefb9ed4 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -596,6 +596,7 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow { String sModuleName = GetHelpModuleName_Impl(); String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); + fprintf(stderr, "A sHelpText %s for id %s\n", rtl::OUStringToOString(sHelpText, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString(aCommandURL, RTL_TEXTENCODING_UTF8).getStr()); rtl::OString aNewHelpId; @@ -607,6 +608,7 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow { aNewHelpId = pParent->GetHelpId(); sHelpText = pImp->GetHelpText( rtl::OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName ); + fprintf(stderr, "B sHelpText %s for id %s\n", rtl::OUStringToOString(sHelpText, RTL_TEXTENCODING_UTF8).getStr(), aNewHelpId.getStr()); if ( sHelpText.Len() > 0 ) pParent = NULL; else @@ -710,6 +712,8 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S // no URL, just a HelpID (maybe empty in case of keyword search) aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); + fprintf(stderr, "C aHelpURL %s\n", rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8).getStr()); + if ( impl_hasHelpInstalled() && pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { // no help found -> try with parent help id. @@ -717,15 +721,23 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S while ( pParent ) { rtl::OString aHelpId = pParent->GetHelpId(); + fprintf(stderr, "D helpid %s for %p\n", aHelpId.getStr(), pParent); aHelpURL = CreateHelpURL( rtl::OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName ); + fprintf(stderr, "D aHelpURL %s\n", rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8).getStr()); if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + { + fprintf(stderr, "found as %s\n", rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8).getStr()); break; + } else { pParent = pParent->GetParent(); if ( !pParent ) + { + fprintf(stderr, "no more parents\n"); // create help url of start page ( helpid == 0 -> start page) aHelpURL = CreateHelpURL( String(), aHelpModuleName ); + } } } } diff --git a/starmath/Module_starmath.mk b/starmath/Module_starmath.mk index bb8663419e10..31583a7d2fc2 100644 --- a/starmath/Module_starmath.mk +++ b/starmath/Module_starmath.mk @@ -28,6 +28,7 @@ $(eval $(call gb_Module_add_targets,starmath,\ Library_sm \ Library_smd \ Package_uiconfig \ + UI_smath \ )) #$(eval $(call gb_Module_add_check_targets,starmath,\ diff --git a/starmath/UI_smath.mk b/starmath/UI_smath.mk new file mode 100644 index 000000000000..6cbfb8dff20f --- /dev/null +++ b/starmath/UI_smath.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UI_UI,modules/smath)) + +$(eval $(call gb_UI_add_uifiles,modules/smath,\ + starmath/uiconfig/smath/ui/printeroptions \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 40fa0ebb8574..07e4535a8765 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -79,38 +79,44 @@ SmPrintUIOptions::SmPrintUIOptions() if (!pConfig) return; + sal_Int32 nNumProps = 10, nIdx=0; + // create sequence of print UI options // (Actually IsIgnoreSpacesRight is a parser option. Without it we need only 8 properties here.) - m_aUIProperties.realloc( 9 ); + m_aUIProperties.realloc( nNumProps ); + + // load the math PrinterOptions into the custom tab + m_aUIProperties[nIdx].Name = rtl::OUString("OptionsUIFile"); + m_aUIProperties[nIdx++].Value <<= rtl::OUString("modules/smath/ui/printeroptions.ui"); // create Section for formula (results in an extra tab page in dialog) SvtModuleOptions aOpt; String aAppGroupname( aLocalizedStrings.GetString( 0 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( SvtModuleOptions::E_SMATH ) ); - m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, ".HelpID:vcl:PrintDialog:TabPage:AppPage" ); + m_aUIProperties[nIdx++].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, ".HelpID:vcl:PrintDialog:TabPage:AppPage"); // create subgroup for print options - m_aUIProperties[1].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() ); + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("contents", aLocalizedStrings.GetString(1), rtl::OUString()); // create a bool option for title row (matches to SID_PRINTTITLE) - m_aUIProperties[2].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ), + m_aUIProperties[nIdx++].Value = setBoolControlOpt("title", aLocalizedStrings.GetString( 2 ), ".HelpID:vcl:PrintDialog:TitleRow:CheckBox", PRTUIOPT_TITLE_ROW, - pConfig->IsPrintTitle() ); + pConfig->IsPrintTitle()); // create a bool option for formula text (matches to SID_PRINTTEXT) - m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ), + m_aUIProperties[nIdx++].Value = setBoolControlOpt("formulatext", aLocalizedStrings.GetString( 3 ), ".HelpID:vcl:PrintDialog:FormulaText:CheckBox", PRTUIOPT_FORMULA_TEXT, - pConfig->IsPrintFormulaText() ); + pConfig->IsPrintFormulaText()); // create a bool option for border (matches to SID_PRINTFRAME) - m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ), + m_aUIProperties[nIdx++].Value = setBoolControlOpt("borders", aLocalizedStrings.GetString( 4 ), ".HelpID:vcl:PrintDialog:Border:CheckBox", PRTUIOPT_BORDER, - pConfig->IsPrintFrame() ); + pConfig->IsPrintFrame()); // create subgroup for print format - m_aUIProperties[5].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 5 ), rtl::OUString() ); + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("size", aLocalizedStrings.GetString(5), rtl::OUString()); // create a radio button group for print format (matches to SID_PRINTSIZE) Sequence< rtl::OUString > aChoices( 3 ); @@ -121,8 +127,12 @@ SmPrintUIOptions::SmPrintUIOptions() aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:0"; aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:1"; aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:2"; + Sequence< rtl::OUString > aWidgetIds( 3 ); + aWidgetIds[0] = "originalsize"; + aWidgetIds[1] = "fittopage"; + aWidgetIds[2] = "scaling"; OUString aPrintFormatProp( PRTUIOPT_PRINT_FORMAT ); - m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(), + m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(), aHelpIds, aPrintFormatProp, aChoices, static_cast< sal_Int32 >(pConfig->GetPrintSize()) @@ -130,19 +140,20 @@ SmPrintUIOptions::SmPrintUIOptions() // create a numeric box for scale dependent on PrintFormat = "Scaling" (matches to SID_PRINTZOOM) vcl::PrinterOptionsHelper::UIControlOptions aRangeOpt( aPrintFormatProp, 2, sal_True ); - m_aUIProperties[ 7 ].Value = getRangeControlOpt( rtl::OUString(), + m_aUIProperties[nIdx++].Value = setRangeControlOpt("scalingspin", rtl::OUString(), ".HelpID:vcl:PrintDialog:PrintScale:NumericField", PRTUIOPT_PRINT_SCALE, pConfig->GetPrintZoomFactor(), // initial value 10, // min value 1000, // max value - aRangeOpt ); + aRangeOpt); Sequence< PropertyValue > aHintNoLayoutPage( 1 ); aHintNoLayoutPage[0].Name = "HintNoLayoutPage"; aHintNoLayoutPage[0].Value = makeAny( sal_True ); - m_aUIProperties[8].Value <<= aHintNoLayoutPage; + m_aUIProperties[nIdx++].Value <<= aHintNoLayoutPage; + assert(nIdx == nNumProps); } diff --git a/starmath/uiconfig/smath/ui/printeroptions.ui b/starmath/uiconfig/smath/ui/printeroptions.ui new file mode 100644 index 000000000000..9d818269f463 --- /dev/null +++ b/starmath/uiconfig/smath/ui/printeroptions.ui @@ -0,0 +1,210 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkBox" id="box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="contents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkCheckButton" id="title"> + <property name="label" translatable="yes">Title</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="formulatext"> + <property name="label" translatable="yes">Formula text</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="borders"> + <property name="label" translatable="yes">Borders</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Contents</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="size"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="originalsize"> + <property name="label" translatable="yes">Original size</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">fittopage</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="fittopage"> + <property name="label" translatable="yes">Fit to page</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">scaling</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkRadioButton" id="scaling"> + <property name="label" translatable="yes">Scaling</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">originalsize</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="scalingspin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Soze</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk index e0f7edcb3373..e6bece6d7e71 100644 --- a/sw/UI_swriter.mk +++ b/sw/UI_swriter.mk @@ -12,6 +12,7 @@ $(eval $(call gb_UI_UI,modules/swriter)) $(eval $(call gb_UI_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/linenumbering \ + sw/uiconfig/swriter/ui/printeroptions \ sw/uiconfig/swriter/ui/titlepage \ sw/uiconfig/swriter/ui/wordcount \ )) diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 99888555d2dd..a8357ced629b 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -214,137 +214,136 @@ SwPrintUIOptions::SwPrintUIOptions( // create sequence of print UI options // (5 options are not available for Writer-Web) const int nCTLOpts = bCTL ? 1 : 0; - const int nNumProps = nCTLOpts + (bWeb ? 14 : 20); + const int nNumProps = nCTLOpts + (bWeb ? 15 : 21); m_aUIProperties.realloc( nNumProps ); int nIdx = 0; + // load the writer PrinterOptions into the custom tab + m_aUIProperties[nIdx].Name = rtl::OUString("OptionsUIFile"); + m_aUIProperties[nIdx++].Value <<= rtl::OUString("modules/swriter/ui/printeroptions.ui"); + // create "writer" section (new tab page in dialog) SvtModuleOptions aModOpt; String aAppGroupname( aLocalizedStrings.GetString( 0 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aModOpt.GetModuleName( SvtModuleOptions::E_SWRITER ) ); - m_aUIProperties[ nIdx++ ].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) ); + m_aUIProperties[ nIdx++ ].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, ".HelpID:vcl:PrintDialog:TabPage:AppPage"); // create sub section for Contents - m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ), rtl::OUString() ); + m_aUIProperties[ nIdx++ ].Value = setSubgroupControlOpt("contents", aLocalizedStrings.GetString(1), rtl::OUString()); // create a bool option for background bool bDefaultVal = rDefaultPrintData.IsPrintPageBackground(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPageBackground" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("pagebackground", aLocalizedStrings.GetString( 2 ), + ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox", + "PrintPageBackground", + bDefaultVal); // create a bool option for pictures/graphics AND OLE and drawing objects as well bDefaultVal = rDefaultPrintData.IsPrintGraphic() || rDefaultPrintData.IsPrintDraw(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPicturesAndObjects" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("pictures", aLocalizedStrings.GetString( 3 ), + ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox", + "PrintPicturesAndObjects", + bDefaultVal); if (!bWeb) { // create a bool option for hidden text bDefaultVal = rDefaultPrintData.IsPrintHiddenText(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("hiddentext", aLocalizedStrings.GetString( 4 ), + ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox", + "PrintHiddenText", + bDefaultVal); // create a bool option for place holder bDefaultVal = rDefaultPrintData.IsPrintTextPlaceholder(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 5 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTextPlaceholder" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("placeholders", aLocalizedStrings.GetString( 5 ), + ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox", + "PrintTextPlaceholder", + bDefaultVal); } // create a bool option for controls bDefaultVal = rDefaultPrintData.IsPrintControl(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintControls:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("formcontrols", aLocalizedStrings.GetString( 6 ), + ".HelpID:vcl:PrintDialog:PrintControls:CheckBox", + "PrintControls", + bDefaultVal); // create sub section for Color - m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 7 ), rtl::OUString() ); + m_aUIProperties[ nIdx++ ].Value = setSubgroupControlOpt("color", aLocalizedStrings.GetString(7), rtl::OUString()); // create a bool option for printing text with black font color bDefaultVal = rDefaultPrintData.IsPrintBlackFont(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlackFonts" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("textinblack", aLocalizedStrings.GetString( 8 ), + ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox", + "PrintBlackFonts", + bDefaultVal); if (!bWeb) { // create subgroup for misc options - m_aUIProperties[ nIdx++ ].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 9 ) ), rtl::OUString() ); + m_aUIProperties[ nIdx++ ].Value = setSubgroupControlOpt("pages", rtl::OUString(aLocalizedStrings.GetString(9)), rtl::OUString()); // create a bool option for printing automatically inserted blank pages bDefaultVal = rDefaultPrintData.IsPrintEmptyPages(); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ), - bDefaultVal ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("autoblankpages", aLocalizedStrings.GetString( 10 ), + ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox", + "PrintEmptyPages", + bDefaultVal); } // create a bool option for paper tray bDefaultVal = rDefaultPrintData.IsPaperFromSetup(); vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt; aPaperTrayOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsPageOptGroup" ) ); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 11 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPaperFromSetup" ) ), - bDefaultVal, - aPaperTrayOpt - ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("printpaperfromsetup", aLocalizedStrings.GetString( 11 ), + ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox", + "PrintPaperFromSetup", + bDefaultVal, + aPaperTrayOpt); // print range selection vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); aPrintRangeOpt.mbInternalOnly = sal_True; - m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 26 ) ), + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("printrange", rtl::OUString(aLocalizedStrings.GetString(26)), rtl::OUString(), - aPrintRangeOpt - ); + aPrintRangeOpt); // create a choice for the content to create rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ); uno::Sequence< rtl::OUString > aChoices( 3 ); uno::Sequence< sal_Bool > aChoicesDisabled( 3 ); uno::Sequence< rtl::OUString > aHelpIds( 3 ); + uno::Sequence< rtl::OUString > aWidgetIds( 3 ); aChoices[0] = aLocalizedStrings.GetString( 27 ); aChoicesDisabled[0] = sal_False; aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) ); + aWidgetIds[0] = "printallpages"; aChoices[1] = aLocalizedStrings.GetString( 28 ); aChoicesDisabled[1] = sal_False; aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) ); + aWidgetIds[1] = "printpages"; aChoices[2] = aLocalizedStrings.GetString( 29 ); aChoicesDisabled[2] = sal_Bool(! bHasSelection); aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) ); - m_aUIProperties[nIdx++].Value = getChoiceControlOpt( rtl::OUString(), - aHelpIds, - aPrintRangeName, - aChoices, - 0 /* always default to 'All pages' */, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ), - aChoicesDisabled - ); - // create a an Edit dependent on "Pages" selected + aWidgetIds[2] = "printselection"; + m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, rtl::OUString(), + aHelpIds, aPrintRangeName, + aChoices, 0 /* always default to 'All pages' */, + aChoicesDisabled); + // show an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True ); - m_aUIProperties[nIdx++].Value = getEditControlOpt( rtl::OUString(), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), - rtl::OUString::valueOf( sal_Int32( nCurrentPage ) ) /* set text box to current page number */, - aPageRangeOpt - ); + m_aUIProperties[nIdx++].Value = setEditControlOpt("pagerange", rtl::OUString(), + ".HelpID:vcl:PrintDialog:PageRange:Edit", + "PageRange", + rtl::OUString::valueOf( sal_Int32( nCurrentPage ) ) /* set text box to current page number */, + aPageRangeOpt); // print content selection vcl::PrinterOptionsHelper::UIControlOptions aContentsOpt; aContentsOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobPage" ) ); - m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 12 ) ), - rtl::OUString(), - aContentsOpt - ); + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("extrawriterprintoptions", rtl::OUString(aLocalizedStrings.GetString(12)), + rtl::OUString(), aContentsOpt); // create a list box for notes content const sal_Int16 nPrintPostIts = rDefaultPrintData.GetPrintPostIts(); aChoices.realloc( 4 ); @@ -357,15 +356,14 @@ SwPrintUIOptions::SwPrintUIOptions( aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox" ) ); vcl::PrinterOptionsHelper::UIControlOptions aAnnotOpt( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ), 0, sal_False ); aAnnotOpt.mbEnabled = bHasPostIts; - m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 17 ), + m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt("writercomments", + aLocalizedStrings.GetString( 17 ), aHelpIds, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintAnnotationMode" ) ), aChoices, nPrintPostIts, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ), uno::Sequence< sal_Bool >(), - aAnnotOpt - ); + aAnnotOpt); // create subsection for Page settings vcl::PrinterOptionsHelper::UIControlOptions aPageSetOpt; @@ -373,10 +371,8 @@ SwPrintUIOptions::SwPrintUIOptions( if (!bWeb) { - m_aUIProperties[nIdx++].Value = getSubgroupControlOpt( rtl::OUString( aLocalizedStrings.GetString( 18 ) ), - rtl::OUString(), - aPageSetOpt - ); + m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pagesides", rtl::OUString(aLocalizedStrings.GetString(18)), + rtl::OUString(), aPageSetOpt); uno::Sequence< rtl::OUString > aRLChoices( 3 ); aRLChoices[0] = aLocalizedStrings.GetString( 19 ); aRLChoices[1] = aLocalizedStrings.GetString( 20 ); @@ -394,24 +390,22 @@ SwPrintUIOptions::SwPrintUIOptions( nPagesChoice = 1; else if (!rDefaultPrintData.IsPrintLeftPage() && rDefaultPrintData.IsPrintRightPage()) nPagesChoice = 2; - m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 22 ), + m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt("brochureinclude", + aLocalizedStrings.GetString(22), aRLHelp, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftRightPages" ) ), + "PrintLeftRightPages", aRLChoices, - nPagesChoice, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ) - ); + nPagesChoice); } // create a bool option for brochure bDefaultVal = rDefaultPrintData.IsPrintProspect(); rtl::OUString aBrochurePropertyName( RTL_CONSTASCII_USTRINGPARAM( "PrintProspect" ) ); - m_aUIProperties[ nIdx++ ].Value = getBoolControlOpt( aLocalizedStrings.GetString( 23 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ) ), - aBrochurePropertyName, - bDefaultVal, - aPageSetOpt - ); + m_aUIProperties[ nIdx++ ].Value = setBoolControlOpt("brochure", aLocalizedStrings.GetString( 23 ), + ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox", + aBrochurePropertyName, + bDefaultVal, + aPageSetOpt); if (bCTL) { @@ -427,19 +421,17 @@ SwPrintUIOptions::SwPrintUIOptions( // 0 : left-to-right // 1 : right-to-left const sal_Int16 nBRTLChoice = rDefaultPrintData.IsPrintProspectRTL() ? 1 : 0; - m_aUIProperties[ nIdx++ ].Value = getChoiceControlOpt( rtl::OUString(), + m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt("scriptdirection", + rtl::OUString(), aBRTLHelpIds, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintProspectRTL" ) ), aBRTLChoices, nBRTLChoice, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ), uno::Sequence< sal_Bool >(), - aBrochureRTLOpt - ); + aBrochureRTLOpt); } - - OSL_ENSURE( nIdx == nNumProps, "number of added properties is not as expected" ); + assert(nIdx == nNumProps); } diff --git a/sw/uiconfig/swriter/ui/printeroptions.ui b/sw/uiconfig/swriter/ui/printeroptions.ui new file mode 100644 index 000000000000..802515566c51 --- /dev/null +++ b/sw/uiconfig/swriter/ui/printeroptions.ui @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkBox" id="box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="contents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkCheckButton" id="pagebackground"> + <property name="label" translatable="yes">Page background</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="pictures"> + <property name="label" translatable="yes">Pictures and other graphic objects</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="hiddentext"> + <property name="label" translatable="yes">Hidden text</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="placeholders"> + <property name="label" translatable="yes">Text placeholders</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="formcontrols"> + <property name="label" translatable="yes">Form controls</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Contents</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="color"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkCheckButton" id="textinblack"> + <property name="label" translatable="yes">Print text in black</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Color</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="pages"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkCheckButton" id="autoblankpages"> + <property name="label" translatable="yes">Print automatically inserted blank pages</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Pages</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> +</interface> diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index bcf039cd6910..e7c7ea42636a 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -36,6 +36,7 @@ $(eval $(call gb_Module_add_targets,vcl,\ Package_inc \ StaticLibrary_vclmain \ Executable_ui-previewer \ + UI_vcl \ )) ifeq ($(GUIBASE),unx) diff --git a/vcl/UI_vcl.mk b/vcl/UI_vcl.mk new file mode 100644 index 000000000000..b39bb788e6ec --- /dev/null +++ b/vcl/UI_vcl.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UI_UI,vcl)) + +$(eval $(call gb_UI_add_uifiles,vcl,\ + vcl/uiconfig/ui/printdialog \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index b754dad2969f..7de6ff9ba17f 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -52,6 +52,7 @@ namespace vcl { class PrintDialog : public ModalDialog { + public: class PrintPreviewWindow : public Window { GDIMetaFile maMtf; @@ -65,7 +66,7 @@ namespace vcl FixedLine maVertDim; public: - PrintPreviewWindow( Window* pParent, const ResId& ); + PrintPreviewWindow( Window* pParent ); virtual ~PrintPreviewWindow(); virtual void Paint( const Rectangle& rRect ); @@ -91,6 +92,8 @@ namespace vcl ShowNupOrderWindow( Window* pParent ); virtual ~ShowNupOrderWindow(); + virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual void Paint( const Rectangle& ); void setValues( int i_nOrderMode, int i_nColumns, int i_nRows ) @@ -102,43 +105,43 @@ namespace vcl } }; - class NUpTabPage : public TabPage + private: + + class NUpTabPage { public: - FixedLine maNupLine; - RadioButton maPagesBtn; - RadioButton maBrochureBtn; - FixedText maPagesBoxTitleTxt; - ListBox maNupPagesBox; + RadioButton* mpPagesBtn; + RadioButton* mpBrochureBtn; + FixedText* mpPagesBoxTitleTxt; + ListBox* mpNupPagesBox; // controls for "Custom" page mode - FixedText maNupNumPagesTxt; - NumericField maNupColEdt; - FixedText maNupTimesTxt; - NumericField maNupRowsEdt; - FixedText maPageMarginTxt1; - MetricField maPageMarginEdt; - FixedText maPageMarginTxt2; - FixedText maSheetMarginTxt1; - MetricField maSheetMarginEdt; - FixedText maSheetMarginTxt2; - FixedText maNupOrientationTxt; - ListBox maNupOrientationBox; + FixedText* mpNupNumPagesTxt; + NumericField* mpNupColEdt; + FixedText* mpNupTimesTxt; + NumericField* mpNupRowsEdt; + FixedText* mpPageMarginTxt1; + MetricField* mpPageMarginEdt; + FixedText* mpPageMarginTxt2; + FixedText* mpSheetMarginTxt1; + MetricField* mpSheetMarginEdt; + FixedText* mpSheetMarginTxt2; + FixedText* mpNupOrientationTxt; + ListBox* mpNupOrientationBox; // page order ("left to right, then down") - FixedText maNupOrderTxt; - ListBox maNupOrderBox; - ShowNupOrderWindow maNupOrderWin; + FixedText* mpNupOrderTxt; + ListBox* mpNupOrderBox; + ShowNupOrderWindow* mpNupOrderWin; // border around each page - CheckBox maBorderCB; + CheckBox* mpBorderCB; boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep; boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel; void setupLayout(); - NUpTabPage( Window*, const ResId& ); - virtual ~NUpTabPage(); + NUpTabPage( VclBuilder* ); void readFromSettings(); void storeToSettings(); @@ -146,97 +149,72 @@ namespace vcl void enableNupControls( bool bEnable ); void showAdvancedControls( bool ); - - // virtual void Resize(); }; - class JobTabPage : public TabPage + class JobTabPage { public: - FixedLine maPrinterFL; - ListBox maPrinters; - DisclosureButton maDetailsBtn; - FixedText maStatusLabel; - FixedText maStatusTxt; - FixedText maLocationLabel; - FixedText maLocationTxt; - FixedText maCommentLabel; - FixedText maCommentTxt; - - PushButton maSetupButton; - - FixedLine maCopies; - FixedLine maCopySpacer; - FixedText maCopyCount; - NumericField maCopyCountField; - CheckBox maCollateBox; - FixedImage maCollateImage; - CheckBox maReverseOrderBox; + ListBox* mpPrinters; + FixedText* mpStatusTxt; + FixedText* mpLocationTxt; + FixedText* mpCommentTxt; + + PushButton* mpSetupButton; + + FixedLine* mpCopySpacer; + NumericField* mpCopyCountField; + CheckBox* mpCollateBox; + FixedImage* mpCollateImage; + CheckBox* mpReverseOrderBox; Image maCollateImg; Image maNoCollateImg; long mnCollateUIMode; - boost::shared_ptr<vcl::RowOrColumn> mxPrintRange; - boost::shared_ptr<vcl::WindowArranger> mxDetails; - - JobTabPage( Window*, const ResId& ); - virtual ~JobTabPage(); + JobTabPage( VclBuilder* ); void readFromSettings(); void storeToSettings(); - - // virtual void Resize(); - - void setupLayout(); }; - class OutputOptPage : public TabPage + class OutputOptPage { public: - FixedLine maOptionsLine; - CheckBox maToFileBox; - CheckBox maCollateSingleJobsBox; + CheckBox* mpToFileBox; + CheckBox* mpCollateSingleJobsBox; boost::shared_ptr<vcl::RowOrColumn> mxOptGroup; - OutputOptPage( Window*, const ResId& ); - virtual ~OutputOptPage(); + OutputOptPage( VclBuilder* ); void readFromSettings(); void storeToSettings(); - - // virtual void Resize(); - - void setupLayout(); }; - TabControl maTabCtrl; + VclBuilder* mpCustomOptionsUIBuilder; + + boost::shared_ptr< PrinterController > maPController; + TabControl* mpTabCtrl; NUpTabPage maNUpPage; JobTabPage maJobPage; OutputOptPage maOptionsPage; + PrintPreviewWindow* mpPreviewWindow; + NumericField* mpPageEdit; - PrintPreviewWindow maPreviewWindow; - NumericField maPageEdit; - FixedText maNumPagesText; - PushButton maBackwardBtn; - PushButton maForwardBtn; - - FixedLine maButtonLine; + FixedText* mpNumPagesText; + PushButton* mpBackwardBtn; + PushButton* mpForwardBtn; - OKButton maOKButton; - CancelButton maCancelButton; - HelpButton maHelpButton; - - boost::shared_ptr< PrinterController > maPController; + OKButton* mpOKButton; + CancelButton* mpCancelButton; + HelpButton* mpHelpButton; rtl::OUString maPageStr; rtl::OUString maNoPageStr; sal_Int32 mnCurPage; sal_Int32 mnCachedPages; - std::list< Window* > maControls; std::map< Window*, rtl::OUString > maControlToPropertyMap; std::map< rtl::OUString, std::vector< Window* > > maPropertyToWindowMap; @@ -289,7 +267,6 @@ namespace vcl DECL_LINK( UIOption_SelectHdl, ListBox* ); DECL_LINK( UIOption_ModifyHdl, Edit* ); - void setupLayout(); public: PrintDialog( Window*, const boost::shared_ptr< PrinterController >& ); virtual ~PrintDialog(); diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index d61a98aa5a7f..db2648f465da 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -73,9 +73,6 @@ #define SV_PRINT_PAGE_BACKWARD 7 #define SV_PRINT_PAGE_EDIT 8 #define SV_PRINT_TABCTRL 9 -#define SV_PRINT_TOFILE_TXT 14 -#define SV_PRINT_DEFPRT_TXT 15 -#define SV_PRINT_PRINTPREVIEW_TXT 16 #define SV_PRINT_TAB_NUP 1 #define SV_PRINT_PRT_NUP_LAYOUT_FL 1 @@ -117,9 +114,6 @@ #define SV_PRINT_COLLATE 12 #define SV_PRINT_COLLATE_IMAGE 13 #define SV_PRINT_BUTTONLINE 14 -#define SV_PRINT_COLLATE_IMG 15 -#define SV_PRINT_NOCOLLATE_IMG 16 -#define SV_PRINT_NOPAGES 19 #define SV_PRINT_STATUS_TXT 20 #define SV_PRINT_LOCATION_TXT 21 #define SV_PRINT_COMMENT_TXT 22 @@ -216,6 +210,13 @@ #define SV_SHORTCUT_MENUBAR 10607 #define SV_SHORTCUT_SPLITTER 10608 +#define SV_PRINT_NOPAGES 10609 +#define SV_PRINT_TOFILE_TXT 10610 +#define SV_PRINT_DEFPRT_TXT 10611 +#define SV_PRINT_PRINTPREVIEW_TXT 10612 +#define SV_PRINT_COLLATE_IMG 10613 +#define SV_PRINT_NOCOLLATE_IMG 10614 + #define SV_EDIT_WARNING_BOX 10650 #define SV_FUNIT_STRINGS 10700 diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx index ae0bc7fb7e51..364e75211792 100644 --- a/vcl/inc/vcl/builder.hxx +++ b/vcl/inc/vcl/builder.hxx @@ -223,6 +223,7 @@ protected: public: VclBuilderContainer(); virtual ~VclBuilderContainer(); + static rtl::OUString getUIRootDir(); static VclBuilder* overrideResourceWithUIXML(Window *pWindow, const ResId& rResId); static bool replace_buildable(Window *pParent, const ResId& rResId, Window &rReplacement); template <typename T> T* get(T*& ret, rtl::OString sID) diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx index 3da9edd96832..278379dbe9f7 100644 --- a/vcl/inc/vcl/layout.hxx +++ b/vcl/inc/vcl/layout.hxx @@ -411,6 +411,7 @@ class VCL_DLLPUBLIC VclFrame : public VclBin { public: VclFrame(Window *pParent) : VclBin(pParent) {} + void set_label(const rtl::OUString &rLabel); protected: virtual Size calculateRequisition() const; virtual void setAllocation(const Size &rAllocation); diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 7959e9b8f33c..3590dbe9d01e 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -616,63 +616,74 @@ class VCL_DLLPUBLIC PrinterOptionsHelper // are passed over UNO interfaces. UNO does not know a byte string, hence the string is // transported via UTF16 strings. - // general control - static com::sun::star::uno::Any getUIControlOpt( const rtl::OUString& i_rTitle, + // Show general control + static com::sun::star::uno::Any setUIControlOpt( const com::sun::star::uno::Sequence< rtl::OUString >& i_rIDs, + const rtl::OUString& i_rTitle, const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId, const rtl::OUString& i_rType, const com::sun::star::beans::PropertyValue* i_pValue = NULL, const UIControlOptions& i_rControlOptions = UIControlOptions() ); - // create a group (e.g. a TabPage); following controls will be grouped in it until the next - // group begins - static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId ); - - // create a subgroup (e.g. a FixedLine); following controls will be grouped in it until the next - // subgroup or group begins - // setting bJobPage = true will make the subgroup appear on the first page of the print dialog - static com::sun::star::uno::Any getSubgroupControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, - const UIControlOptions& i_rControlOptions = UIControlOptions() - ); - - // create a bool option (usually a checkbox) - static com::sun::star::uno::Any getBoolControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, - const rtl::OUString& i_rProperty, - sal_Bool i_bValue, - const UIControlOptions& i_rControlOptions = UIControlOptions() - ); - - // create a set of choices (either a radio button group or a list box) - static com::sun::star::uno::Any getChoiceControlOpt( const rtl::OUString& i_rTitle, - const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId, - const rtl::OUString& i_rProperty, - const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices, - sal_Int32 i_nValue, - const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ), - const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(), - const UIControlOptions& i_rControlOptions = UIControlOptions() - ); - - // create an integer range (e.g. a spin field) - // note: max value < min value means do not apply min/max values - static com::sun::star::uno::Any getRangeControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, - const rtl::OUString& i_rProperty, - sal_Int32 i_nValue, - sal_Int32 i_nMinValue = -1, - sal_Int32 i_nMaxValue = -2, - const UIControlOptions& i_rControlOptions = UIControlOptions() - ); - - // create a string field + + // Show and set the title of a TagPage of id i_rID + static com::sun::star::uno::Any setGroupControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId); + + // Show and set the label of a VclFrame of id i_rID + static com::sun::star::uno::Any setSubgroupControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const UIControlOptions& i_rControlOptions = UIControlOptions()); + + // Show a bool option as a checkbox + static com::sun::star::uno::Any setBoolControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const rtl::OUString& i_rProperty, + sal_Bool i_bValue, + const UIControlOptions& i_rControlOptions = UIControlOptions()); + + // Show a set of choices in a list box + static com::sun::star::uno::Any setChoiceListControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId, + const rtl::OUString& i_rProperty, + const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices, + sal_Int32 i_nValue, + const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(), + const UIControlOptions& i_rControlOptions = UIControlOptions()); + + // show a set of choices as radio buttons + static com::sun::star::uno::Any setChoiceRadiosControlOpt(const com::sun::star::uno::Sequence< rtl::OUString >& i_rIDs, + const rtl::OUString& i_rTitle, + const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId, + const rtl::OUString& i_rProperty, + const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices, + sal_Int32 i_nValue, + const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(), + const UIControlOptions& i_rControlOptions = UIControlOptions()); + + + // show an integer range (e.g. a spin field) // note: max value < min value means do not apply min/max values - static com::sun::star::uno::Any getEditControlOpt( const rtl::OUString& i_rTitle, + static com::sun::star::uno::Any setRangeControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId, const rtl::OUString& i_rProperty, - const rtl::OUString& i_rValue, - const UIControlOptions& i_rControlOptions = UIControlOptions() - ); + sal_Int32 i_nValue, + sal_Int32 i_nMinValue = -1, + sal_Int32 i_nMaxValue = -2, + const UIControlOptions& i_rControlOptions = UIControlOptions()); + + // show a string field + // note: max value < min value means do not apply min/max values + static com::sun::star::uno::Any setEditControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const rtl::OUString& i_rProperty, + const rtl::OUString& i_rValue, + const UIControlOptions& i_rControlOptions = UIControlOptions()); }; } diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index c10f0361e126..1de45f3f9d84 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -142,6 +142,7 @@ public: sal_uInt16 GetPageId( sal_uInt16 nPos ) const; sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const; sal_uInt16 GetPageId( const Point& rPos ) const; + sal_uInt16 GetPageId( const TabPage& rPage ) const; void SetCurPageId( sal_uInt16 nPageId ); sal_uInt16 GetCurPageId() const; @@ -162,6 +163,7 @@ public: void SetHelpText( sal_uInt16 nPageId, const XubString& rText ); const XubString& GetHelpText( sal_uInt16 nPageId ) const; + void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rId ) const; rtl::OString GetHelpId( sal_uInt16 nPageId ) const; void SetPageImage( sal_uInt16 nPageId, const Image& rImage ); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 2f21d3fe2dcb..fef793d10699 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1078,7 +1078,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout ) // in this case we're only interested in the top border of the tabpage because the tabitems are used // standalone (eg impress) sal_Bool bNoTabPage = sal_False; - TabPage* pCurPage = (pCurItem) ? pCurItem->mpTabPage : NULL; + TabPage* pCurPage = pCurItem ? pCurItem->mpTabPage : NULL; if( !pCurPage || !pCurPage->IsVisible() ) { bNoTabPage = sal_True; @@ -1855,6 +1855,18 @@ sal_uInt16 TabControl::GetPageId( const Point& rPos ) const return 0; } +sal_uInt16 TabControl::GetPageId( const TabPage& rPage ) const +{ + for( std::vector< ImplTabItem >::const_iterator it = mpTabCtrlData->maItemList.begin(); + it != mpTabCtrlData->maItemList.end(); ++it ) + { + if ( it->mpTabPage == &rPage ) + return it->mnId; + } + + return 0; +} + // ----------------------------------------------------------------------- void TabControl::SetCurPageId( sal_uInt16 nPageId ) @@ -2035,6 +2047,14 @@ const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- +void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rId ) const +{ + ImplTabItem* pItem = ImplGetItem( nPageId ); + + if ( pItem ) + pItem->maHelpId = rId; +} + rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const { rtl::OString aRet; diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 0df6e9d4a8d8..ffdc45842822 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1718,22 +1718,22 @@ void PrinterOptionsHelper::appendPrintUIOptions( uno::Sequence< beans::PropertyV } } -Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle, - const Sequence< rtl::OUString >& i_rHelpIds, - const rtl::OUString& i_rType, - const PropertyValue* i_pVal, - const PrinterOptionsHelper::UIControlOptions& i_rControlOptions - ) +Any PrinterOptionsHelper::setUIControlOpt(const com::sun::star::uno::Sequence< rtl::OUString >& i_rIDs, + const rtl::OUString& i_rTitle, + const Sequence< rtl::OUString >& i_rHelpIds, + const rtl::OUString& i_rType, + const PropertyValue* i_pVal, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) { sal_Int32 nElements = - 1 // ControlType + 2 // ControlType + ID + (i_rTitle.isEmpty() ? 0 : 1) // Text - + (i_rHelpIds.getLength() ? 1 : 0) // HelpId - + (i_pVal ? 1 : 0) // Property - + i_rControlOptions.maAddProps.getLength() // additional props + + (i_rHelpIds.getLength() ? 1 : 0) // HelpId + + (i_pVal ? 1 : 0) // Property + + i_rControlOptions.maAddProps.getLength() // additional props + (i_rControlOptions.maGroupHint.isEmpty() ? 0 : 1) // grouping - + (i_rControlOptions.mbInternalOnly ? 1 : 0) // internal hint - + (i_rControlOptions.mbEnabled ? 0 : 1) // enabled + + (i_rControlOptions.mbInternalOnly ? 1 : 0) // internal hint + + (i_rControlOptions.mbEnabled ? 0 : 1) // enabled ; if( !i_rControlOptions.maDependsOnName.isEmpty() ) { @@ -1758,6 +1758,8 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle, } aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) ); aCtrl[nUsed++].Value = makeAny( i_rType ); + aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ); + aCtrl[nUsed++].Value = makeAny( i_rIDs ); if( i_pVal ) { aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Property" ) ); @@ -1803,7 +1805,9 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle, return makeAny( aCtrl ); } -Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId ) +Any PrinterOptionsHelper::setGroupControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId) { Sequence< rtl::OUString > aHelpId; if( !i_rHelpId.isEmpty() ) @@ -1811,13 +1815,15 @@ Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, con aHelpId.realloc( 1 ); *aHelpId.getArray() = i_rHelpId; } - return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) ); + Sequence< rtl::OUString > aIds(1); + aIds[0] = i_rID; + return setUIControlOpt(aIds, i_rTitle, aHelpId, "Group"); } -Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, - const PrinterOptionsHelper::UIControlOptions& i_rControlOptions - ) +Any PrinterOptionsHelper::setSubgroupControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) { Sequence< rtl::OUString > aHelpId; if( !i_rHelpId.isEmpty() ) @@ -1825,16 +1831,17 @@ Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle, aHelpId.realloc( 1 ); *aHelpId.getArray() = i_rHelpId; } - return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ), - NULL, i_rControlOptions ); + Sequence< rtl::OUString > aIds(1); + aIds[0] = i_rID; + return setUIControlOpt(aIds, i_rTitle, aHelpId, "Subgroup", NULL, i_rControlOptions); } -Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, - const rtl::OUString& i_rProperty, - sal_Bool i_bValue, - const PrinterOptionsHelper::UIControlOptions& i_rControlOptions - ) +Any PrinterOptionsHelper::setBoolControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const rtl::OUString& i_rProperty, + sal_Bool i_bValue, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) { Sequence< rtl::OUString > aHelpId; if( !i_rHelpId.isEmpty() ) @@ -1845,18 +1852,19 @@ Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle, PropertyValue aVal; aVal.Name = i_rProperty; aVal.Value = makeAny( i_bValue ); - return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions ); + Sequence< rtl::OUString > aIds(1); + aIds[0] = i_rID; + return setUIControlOpt(aIds, i_rTitle, aHelpId, "Bool", &aVal, i_rControlOptions); } -Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle, - const Sequence< rtl::OUString >& i_rHelpId, - const rtl::OUString& i_rProperty, - const Sequence< rtl::OUString >& i_rChoices, - sal_Int32 i_nValue, - const rtl::OUString& i_rType, - const Sequence< sal_Bool >& i_rDisabledChoices, - const PrinterOptionsHelper::UIControlOptions& i_rControlOptions - ) +Any PrinterOptionsHelper::setChoiceRadiosControlOpt(const com::sun::star::uno::Sequence< rtl::OUString >& i_rIDs, + const rtl::OUString& i_rTitle, + const Sequence< rtl::OUString >& i_rHelpId, + const rtl::OUString& i_rProperty, + const Sequence< rtl::OUString >& i_rChoices, + sal_Int32 i_nValue, + const Sequence< sal_Bool >& i_rDisabledChoices, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) { UIControlOptions aOpt( i_rControlOptions ); sal_Int32 nUsed = aOpt.maAddProps.getLength(); @@ -1872,17 +1880,45 @@ Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle, PropertyValue aVal; aVal.Name = i_rProperty; aVal.Value = makeAny( i_nValue ); - return getUIControlOpt( i_rTitle, i_rHelpId, i_rType, &aVal, aOpt ); + return setUIControlOpt(i_rIDs, i_rTitle, i_rHelpId, "Radio", &aVal, aOpt); } -Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, +Any PrinterOptionsHelper::setChoiceListControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const Sequence< rtl::OUString >& i_rHelpId, const rtl::OUString& i_rProperty, + const Sequence< rtl::OUString >& i_rChoices, sal_Int32 i_nValue, - sal_Int32 i_nMinValue, - sal_Int32 i_nMaxValue, - const PrinterOptionsHelper::UIControlOptions& i_rControlOptions - ) + const Sequence< sal_Bool >& i_rDisabledChoices, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) +{ + UIControlOptions aOpt( i_rControlOptions ); + sal_Int32 nUsed = aOpt.maAddProps.getLength(); + aOpt.maAddProps.realloc( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) ); + aOpt.maAddProps[nUsed].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) ); + aOpt.maAddProps[nUsed].Value = makeAny( i_rChoices ); + if( i_rDisabledChoices.getLength() ) + { + aOpt.maAddProps[nUsed+1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChoicesDisabled" ) ); + aOpt.maAddProps[nUsed+1].Value = makeAny( i_rDisabledChoices ); + } + + PropertyValue aVal; + aVal.Name = i_rProperty; + aVal.Value = makeAny( i_nValue ); + Sequence< rtl::OUString > aIds(1); + aIds[0] = i_rID; + return setUIControlOpt(aIds, i_rTitle, i_rHelpId, "List", &aVal, aOpt); +} + +Any PrinterOptionsHelper::setRangeControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const rtl::OUString& i_rProperty, + sal_Int32 i_nValue, + sal_Int32 i_nMinValue, + sal_Int32 i_nMaxValue, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) { UIControlOptions aOpt( i_rControlOptions ); if( i_nMaxValue >= i_nMinValue ) @@ -1904,20 +1940,17 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle, PropertyValue aVal; aVal.Name = i_rProperty; aVal.Value = makeAny( i_nValue ); - return getUIControlOpt( i_rTitle, - aHelpId, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ), - &aVal, - aOpt - ); + Sequence< rtl::OUString > aIds(1); + aIds[0] = i_rID; + return setUIControlOpt(aIds, i_rTitle, aHelpId, "Range", &aVal, aOpt); } -Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rHelpId, - const rtl::OUString& i_rProperty, - const rtl::OUString& i_rValue, - const PrinterOptionsHelper::UIControlOptions& i_rControlOptions - ) +Any PrinterOptionsHelper::setEditControlOpt(const rtl::OUString& i_rID, + const rtl::OUString& i_rTitle, + const rtl::OUString& i_rHelpId, + const rtl::OUString& i_rProperty, + const rtl::OUString& i_rValue, + const PrinterOptionsHelper::UIControlOptions& i_rControlOptions) { Sequence< rtl::OUString > aHelpId; if( !i_rHelpId.isEmpty() ) @@ -1928,12 +1961,9 @@ Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle, PropertyValue aVal; aVal.Name = i_rProperty; aVal.Value = makeAny( i_rValue ); - return getUIControlOpt( i_rTitle, - aHelpId, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ), - &aVal, - i_rControlOptions - ); + Sequence< rtl::OUString > aIds(1); + aIds[0] = i_rID; + return setUIControlOpt(aIds, i_rTitle, aHelpId, "Edit", &aVal, i_rControlOptions); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index a767c1725ac4..19092ba2ef1a 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -107,27 +107,6 @@ ModalDialog SV_DLG_PRINT Pos = MAP_APPFONT( 0, 185 ); Size = MAP_APPFONT( 350, 8 ); }; - String SV_PRINT_NOPAGES - { - Text [en-US] = "No pages"; - }; - - String SV_PRINT_TOFILE_TXT - { - Text [en-US] = "Print to File..."; - }; - - String SV_PRINT_DEFPRT_TXT - { - Text [en-US] = "Default printer"; - }; - - - String SV_PRINT_PRINTPREVIEW_TXT - { - Text [en-US] = "Print preview"; - }; - TabPage SV_PRINT_TAB_NUP { HelpID = ".HelpID:vcl:PrintDialog:NUpPage"; @@ -393,16 +372,6 @@ ModalDialog SV_DLG_PRINT Text [en-US] = "Collate"; }; - Image SV_PRINT_COLLATE_IMG - { - ImageBitmap = Bitmap { File = "collate.png" ; }; - }; - - Image SV_PRINT_NOCOLLATE_IMG - { - ImageBitmap = Bitmap { File = "ncollate.png" ; }; - }; - CheckBox SV_PRINT_OPT_REVERSE { HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse"; @@ -534,3 +503,32 @@ StringArray RID_STR_PAPERNAMES }; }; +String SV_PRINT_NOPAGES +{ + Text [en-US] = "No pages"; +}; + +String SV_PRINT_TOFILE_TXT +{ + Text [en-US] = "Print to File..."; +}; + +String SV_PRINT_DEFPRT_TXT +{ + Text [en-US] = "Default printer"; +}; + +String SV_PRINT_PRINTPREVIEW_TXT +{ + Text [en-US] = "Print preview"; +}; + +Image SV_PRINT_COLLATE_IMG +{ + ImageBitmap = Bitmap { File = "collate.png" ; }; +}; + +Image SV_PRINT_NOCOLLATE_IMG +{ + ImageBitmap = Bitmap { File = "ncollate.png" ; }; +}; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 43b700c12f80..761ff822912c 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -476,7 +476,7 @@ Dialog::Dialog( WindowType nType ) : #define RELPATH_SHARE_LAYER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice.cfg")) #define SERVICENAME_PATHSETTINGS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")) -rtl::OUString getUIRootDir() +rtl::OUString VclBuilderContainer::getUIRootDir() { namespace css = ::com::sun::star; diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index a474074b7d3d..6e8161631f6c 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -854,6 +854,16 @@ void VclFrame::setAllocation(const Size &rAllocation) setLayoutAllocation(*pChild, aChildPos, aAllocation); } +void VclFrame::set_label(const rtl::OUString &rLabel) +{ + //The label widget is the last (of two) children + Window *pChild = get_child(); + WindowImpl* pWindowImpl = ImplGetWindowImpl(); + Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild : NULL; + assert(pLabel); + pLabel->SetText(rLabel); +} + Size VclAlignment::calculateRequisition() const { Size aRet(m_nLeftPadding + m_nRightPadding, diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 9c05203934e4..245e9f992551 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -42,6 +42,7 @@ #include "vcl/configsettings.hxx" #include "vcl/help.hxx" #include "vcl/decoview.hxx" +#include "vcl/layout.hxx" #include "vcl/svapp.hxx" #include "vcl/unohelp.hxx" @@ -61,8 +62,18 @@ using namespace com::sun::star::lang; using namespace com::sun::star::container; using namespace com::sun::star::beans; -PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId ) - : Window( i_pParent, i_rId ) +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makePrintPreviewWindow(Window *pParent) +{ + return new PrintDialog::PrintPreviewWindow(pParent); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeShowNupOrderWindow(Window *pParent) +{ + return new PrintDialog::ShowNupOrderWindow(pParent); +} + +PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent ) + : Window( i_pParent, 0 ) , maOrigSize( 10, 10 ) , maPageVDev( *this ) , maToolTipString(VclResId( SV_PRINT_PRINTPREVIEW_TXT).toString()) @@ -301,6 +312,11 @@ void PrintDialog::ShowNupOrderWindow::ImplInitSettings() SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) ); } +Size PrintDialog::ShowNupOrderWindow::GetOptimalSize(WindowSizeType) const +{ + return Size(70, 70); +} + void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect ) { Window::Paint( i_rRect ); @@ -355,38 +371,75 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect ) aVw.DrawFrame( Rectangle( Point( 0, 0), aOutSize ), FRAME_DRAW_GROUP ); } -PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId ) - : TabPage( i_pParent, 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 ) ) - , maNupTimesTxt( this, VclResId( SV_PRINT_PRT_NUP_TIMES_TXT ) ) - , maNupRowsEdt( this, VclResId( SV_PRINT_PRT_NUP_ROWS_EDT ) ) - , maPageMarginTxt1( this, VclResId( SV_PRINT_PRT_NUP_MARGINS_PAGES_1_TXT ) ) - , maPageMarginEdt( this, VclResId( SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT ) ) - , maPageMarginTxt2( this, VclResId( SV_PRINT_PRT_NUP_MARGINS_PAGES_2_TXT ) ) - , maSheetMarginTxt1( this, VclResId( SV_PRINT_PRT_NUP_MARGINS_SHEET_1_TXT ) ) - , maSheetMarginEdt( this, VclResId( SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT ) ) - , maSheetMarginTxt2( this, VclResId( SV_PRINT_PRT_NUP_MARGINS_SHEET_2_TXT ) ) - , maNupOrientationTxt( this, VclResId( SV_PRINT_PRT_NUP_ORIENTATION_TXT ) ) - , maNupOrientationBox( this, VclResId( SV_PRINT_PRT_NUP_ORIENTATION_BOX ) ) - , maNupOrderTxt( this, VclResId( SV_PRINT_PRT_NUP_ORDER_TXT ) ) - , maNupOrderBox( this, VclResId( SV_PRINT_PRT_NUP_ORDER_BOX ) ) - , maNupOrderWin( this ) - , maBorderCB( this, VclResId( SV_PRINT_PRT_NUP_BORDER_CB ) ) +PrintDialog::NUpTabPage::NUpTabPage( VclBuilder *pUIBuilder ) +{ + pUIBuilder->get(mpPagesBtn, "pagespersheetbtn"); + pUIBuilder->get(mpBrochureBtn, "brochure"); + pUIBuilder->get(mpPagesBoxTitleTxt, "pagespersheettxt"); + pUIBuilder->get(mpNupPagesBox, "paperspersheetlb"); + pUIBuilder->get(mpNupNumPagesTxt, "pagestxt"); + pUIBuilder->get(mpNupColEdt, "pagecols"); + pUIBuilder->get(mpNupTimesTxt, "by"); + pUIBuilder->get(mpNupRowsEdt, "pagerows"); + pUIBuilder->get(mpPageMarginTxt1, "pagemargintxt1"); + pUIBuilder->get(mpPageMarginEdt, "pagemarginsb"); + pUIBuilder->get(mpPageMarginTxt2, "pagemargintxt2"); + pUIBuilder->get(mpSheetMarginTxt1, "sheetmargintxt1"); + pUIBuilder->get(mpSheetMarginEdt, "sheetmarginsb"); + pUIBuilder->get(mpSheetMarginTxt2, "sheetmargintxt2"); + pUIBuilder->get(mpNupOrientationTxt, "orientationtxt"); + pUIBuilder->get(mpNupOrientationBox, "orientationlb"); + pUIBuilder->get(mpNupOrderTxt, "ordertxt"); + pUIBuilder->get(mpNupOrderBox, "orderlb"); + pUIBuilder->get(mpNupOrderWin, "orderpreview"); + pUIBuilder->get(mpBorderCB, "bordercb"); +} + +void PrintDialog::NUpTabPage::enableNupControls( bool bEnable ) { - FreeResource(); + mpNupPagesBox->Enable( bEnable ); + mpNupNumPagesTxt->Enable( bEnable ); + mpNupColEdt->Enable( bEnable ); + mpNupTimesTxt->Enable( bEnable ); + mpNupRowsEdt->Enable( bEnable ); + mpPageMarginTxt1->Enable( bEnable ); + mpPageMarginEdt->Enable( bEnable ); + mpPageMarginTxt2->Enable( bEnable ); + mpSheetMarginTxt1->Enable( bEnable ); + mpSheetMarginEdt->Enable( bEnable ); + mpSheetMarginTxt2->Enable( bEnable ); + mpNupOrientationTxt->Enable( bEnable ); + mpNupOrientationBox->Enable( bEnable ); + mpNupOrderTxt->Enable( bEnable ); + mpNupOrderBox->Enable( bEnable ); + mpNupOrderWin->Enable( bEnable ); + mpBorderCB->Enable( bEnable ); +} - maNupOrderWin.Show(); - maPagesBtn.Check( sal_True ); - maBrochureBtn.Show( sal_False ); +void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow ) +{ + mpNupNumPagesTxt->Show( i_bShow ); + mpNupColEdt->Show( i_bShow ); + mpNupTimesTxt->Show( i_bShow ); + mpNupRowsEdt->Show( i_bShow ); + mpPageMarginTxt1->Show( i_bShow ); + mpPageMarginEdt->Show( i_bShow ); + mpPageMarginTxt2->Show( i_bShow ); + mpSheetMarginTxt1->Show( i_bShow ); + mpSheetMarginEdt->Show( i_bShow ); + mpSheetMarginTxt2->Show( i_bShow ); + mpNupOrientationTxt->Show( i_bShow ); + mpNupOrientationBox->Show( i_bShow ); +} + +void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS ) +{ + mpNupOrderWin->Show(); + mpPagesBtn->Check( sal_True ); + mpBrochureBtn->Show( sal_False ); // setup field units for metric fields - const LocaleDataWrapper& rLocWrap( maPageMarginEdt.GetLocaleDataWrapper() ); + const LocaleDataWrapper& rLocWrap( mpPageMarginEdt->GetLocaleDataWrapper() ); FieldUnit eUnit = FUNIT_MM; sal_uInt16 nDigits = 0; if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US ) @@ -395,124 +448,18 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId ) nDigits = 2; } // set units - maPageMarginEdt.SetUnit( eUnit ); - maSheetMarginEdt.SetUnit( eUnit ); + mpPageMarginEdt->SetUnit( eUnit ); + mpSheetMarginEdt->SetUnit( eUnit ); // set precision - maPageMarginEdt.SetDecimalDigits( nDigits ); - maSheetMarginEdt.SetDecimalDigits( nDigits ); - - setupLayout(); -} + mpPageMarginEdt->SetDecimalDigits( nDigits ); + mpSheetMarginEdt->SetDecimalDigits( nDigits ); -PrintDialog::NUpTabPage::~NUpTabPage() -{ -} - -void PrintDialog::NUpTabPage::enableNupControls( bool bEnable ) -{ - maNupPagesBox.Enable( sal_True ); - maNupNumPagesTxt.Enable( bEnable ); - maNupColEdt.Enable( bEnable ); - maNupTimesTxt.Enable( bEnable ); - maNupRowsEdt.Enable( bEnable ); - maPageMarginTxt1.Enable( bEnable ); - maPageMarginEdt.Enable( bEnable ); - maPageMarginTxt2.Enable( bEnable ); - maSheetMarginTxt1.Enable( bEnable ); - maSheetMarginEdt.Enable( bEnable ); - maSheetMarginTxt2.Enable( bEnable ); - maNupOrientationTxt.Enable( bEnable ); - maNupOrientationBox.Enable( bEnable ); - maNupOrderTxt.Enable( bEnable ); - maNupOrderBox.Enable( bEnable ); - maNupOrderWin.Enable( bEnable ); - maBorderCB.Enable( bEnable ); -} - -void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow ) -{ - maNupNumPagesTxt.Show( i_bShow ); - maNupColEdt.Show( i_bShow ); - maNupTimesTxt.Show( i_bShow ); - maNupRowsEdt.Show( i_bShow ); - maPageMarginTxt1.Show( i_bShow ); - maPageMarginEdt.Show( i_bShow ); - maPageMarginTxt2.Show( i_bShow ); - maSheetMarginTxt1.Show( i_bShow ); - maSheetMarginEdt.Show( i_bShow ); - maSheetMarginTxt2.Show( i_bShow ); - maNupOrientationTxt.Show( i_bShow ); - maNupOrientationBox.Show( i_bShow ); - getLayout()->resize(); -} - -void PrintDialog::NUpTabPage::setupLayout() -{ - boost::shared_ptr<vcl::RowOrColumn> xLayout = - boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) ); - /* According to OOo style guide, the horizontal indentation of child - elements to their parent element should always be 6 map units. */ - long nIndent = aBorder.Width(); - - xLayout->addWindow( &maNupLine ); - boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) ); - xLayout->addChild( xRow ); - boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) ); - xRow->addChild( xIndent ); - - boost::shared_ptr< vcl::RowOrColumn > xShowNupCol( new vcl::RowOrColumn( xRow.get() ) ); - xRow->addChild( xShowNupCol, -1 ); - xShowNupCol->setMinimumSize( xShowNupCol->addWindow( &maNupOrderWin ), Size( 70, 70 ) ); - boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xShowNupCol.get() ) ); - xShowNupCol->addChild( xSpacer ); - - boost::shared_ptr< vcl::LabelColumn > xMainCol( new vcl::LabelColumn( xIndent.get() ) ); - xIndent->setChild( xMainCol ); - - 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 ); - xRow->addWindow( &maNupColEdt ); - xRow->addWindow( &maNupTimesTxt ); - xRow->addWindow( &maNupRowsEdt ); - - boost::shared_ptr< vcl::LabeledElement > xLab( new vcl::LabeledElement( xMainCol.get(), 2 ) ); - xLab->setLabel( &maPageMarginEdt ); - xLab->setElement( &maPageMarginTxt2 ); - xMainCol->addRow( &maPageMarginTxt1, xLab, nIndent ); - - xLab.reset( new vcl::LabeledElement( xMainCol.get(), 2 ) ); - xLab->setLabel( &maSheetMarginEdt ); - xLab->setElement( &maSheetMarginTxt2 ); - xMainCol->addRow( &maSheetMarginTxt1, xLab, nIndent ); - - xMainCol->addRow( &maNupOrientationTxt, &maNupOrientationBox, nIndent ); - xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent ); - xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 ); - - xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) ); - xMainCol->addChild( xSpacer ); - - xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) ); - xMainCol->addRow( &maBrochureBtn, xRow ); - // remember brochure row for dependencies - mxBrochureDep = xRow; - - // initially advanced controls are not shown, rows=columns=1 - showAdvancedControls( false ); -} - -void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS ) -{ - maSheetMarginEdt.SetValue( maSheetMarginEdt.Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM ); - maPageMarginEdt.SetValue( maPageMarginEdt.Normalize( i_rMPS.nHorizontalSpacing ), FUNIT_100TH_MM ); - maBorderCB.Check( i_rMPS.bDrawBorder ); - maNupRowsEdt.SetValue( i_rMPS.nRows ); - maNupColEdt.SetValue( i_rMPS.nColumns ); + mpSheetMarginEdt->SetValue( mpSheetMarginEdt->Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM ); + mpPageMarginEdt->SetValue( mpPageMarginEdt->Normalize( i_rMPS.nHorizontalSpacing ), FUNIT_100TH_MM ); + mpBorderCB->Check( i_rMPS.bDrawBorder ); + mpNupRowsEdt->SetValue( i_rMPS.nRows ); + mpNupColEdt->SetValue( i_rMPS.nColumns ); } void PrintDialog::NUpTabPage::readFromSettings() @@ -523,102 +470,24 @@ void PrintDialog::NUpTabPage::storeToSettings() { } -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 ) ) - , maStatusLabel( this, VclResId( SV_PRINT_STATUS_TXT ) ) - , maStatusTxt( this, 0 ) - , maLocationLabel( this, VclResId( SV_PRINT_LOCATION_TXT ) ) - , maLocationTxt( this, 0 ) - , maCommentLabel( this, VclResId( SV_PRINT_COMMENT_TXT ) ) - , maCommentTxt( this, 0 ) - , maSetupButton( this, VclResId( SV_PRINT_PRT_SETUP ) ) - , maCopies( this, VclResId( SV_PRINT_COPIES ) ) - , maCopySpacer( this, WB_VERT ) - , maCopyCount( this, VclResId( SV_PRINT_COPYCOUNT ) ) - , maCopyCountField( this, VclResId( SV_PRINT_COPYCOUNT_FIELD ) ) - , maCollateBox( this, VclResId( SV_PRINT_COLLATE ) ) - , maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) ) - , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) ) - , maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) ) +PrintDialog::JobTabPage::JobTabPage( VclBuilder* pUIBuilder ) + : maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) ) , maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) ) , mnCollateUIMode( 0 ) { - FreeResource(); - - - maCopySpacer.Show(); - maStatusTxt.Show(); - maCommentTxt.Show(); - maLocationTxt.Show(); - - setupLayout(); -} - -PrintDialog::JobTabPage::~JobTabPage() -{ -} - -void PrintDialog::JobTabPage::setupLayout() -{ + pUIBuilder->get(mpPrinters, "printers"); + pUIBuilder->get(mpStatusTxt, "status"); + pUIBuilder->get(mpLocationTxt, "location"); + pUIBuilder->get(mpCommentTxt, "comment"); + pUIBuilder->get(mpSetupButton, "setup"); + pUIBuilder->get(mpCopySpacer, "copyspacer"); + pUIBuilder->get(mpCopyCountField, "copycount"); + pUIBuilder->get(mpCollateBox, "collate"); + pUIBuilder->get(mpCollateImage, "collateimage"); + pUIBuilder->get(mpReverseOrderBox, "reverseorder"); // HACK: this is not a dropdown box, but the dropdown line count // sets the results of GetOptimalSize in a normal ListBox - maPrinters.SetDropDownLineCount( 4 ); - - boost::shared_ptr<vcl::RowOrColumn> xLayout = - boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - - // add printer fixed line - xLayout->addWindow( &maPrinterFL ); - // add print LB - xLayout->addWindow( &maPrinters, 3 ); - - // create a row for details button/text and properties button - boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) ); - xLayout->addChild( xDetRow ); - xDetRow->addWindow( &maDetailsBtn ); - 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( xLayout.get() ) ); - xLayout->addChild( xIndent ); - // remember details controls - mxDetails = xIndent; - // create a column for the details - boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) ); - xIndent->setChild( xLabelCol ); - xLabelCol->addRow( &maStatusLabel, &maStatusTxt ); - xLabelCol->addRow( &maLocationLabel, &maLocationTxt ); - xLabelCol->addRow( &maCommentLabel, &maCommentTxt ); - - // add print range and copies columns - xLayout->addWindow( &maCopies ); - boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) ); - xLayout->addChild( xRangeRow ); - - // create print range and add to range row - mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) ); - xRangeRow->addChild( mxPrintRange ); - xRangeRow->addWindow( &maCopySpacer ); - - boost::shared_ptr< vcl::RowOrColumn > xCopyCollateCol( new vcl::RowOrColumn( xRangeRow.get() ) ); - xRangeRow->addChild( xCopyCollateCol ); - - // add copies row to copy/collate column - boost::shared_ptr< vcl::LabeledElement > xCopiesRow( new vcl::LabeledElement( xCopyCollateCol.get(), 2 ) ); - xCopyCollateCol->addChild( xCopiesRow ); - xCopiesRow->setLabel( &maCopyCount ); - xCopiesRow->setElement( &maCopyCountField ); - boost::shared_ptr< vcl::LabeledElement > xCollateRow( new vcl::LabeledElement( xCopyCollateCol.get(), 2 ) ); - xCopyCollateCol->addChild( xCollateRow ); - xCollateRow->setLabel( &maCollateBox ); - xCollateRow->setElement( &maCollateImage ); - - // maDetailsBtn.SetStyle( maDetailsBtn.GetStyle() | (WB_SMALLSTYLE | WB_BEVELBUTTON) ); - mxDetails->show( false, false ); + mpPrinters->SetDropDownLineCount( 4 ); } void PrintDialog::JobTabPage::readFromSettings() @@ -631,17 +500,16 @@ void PrintDialog::JobTabPage::readFromSettings() if( aValue.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("alwaysoff")) ) { mnCollateUIMode = 1; - maCollateBox.Check( sal_False ); - maCollateBox.Enable( sal_False ); + mpCollateBox->Check( sal_False ); + mpCollateBox->Enable( sal_False ); } else { mnCollateUIMode = 0; aValue = pItem->getValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "Collate" ) ); - maCollateBox.Check( aValue.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) ); + mpCollateBox->Check( aValue.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) ); } - Resize(); } void PrintDialog::JobTabPage::storeToSettings() @@ -649,41 +517,17 @@ void PrintDialog::JobTabPage::storeToSettings() SettingsConfigItem* pItem = SettingsConfigItem::get(); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "CopyCount" ), - maCopyCountField.GetText() ); + mpCopyCountField->GetText() ); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "Collate" ), - maCollateBox.IsChecked() ? rtl::OUString("true") : - rtl::OUString("false") ); -} - -PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId ) - : TabPage( i_pParent, i_rResId ) - , maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) ) - , maToFileBox( this, VclResId( SV_PRINT_OPT_TOFILE ) ) - , maCollateSingleJobsBox( this, VclResId( SV_PRINT_OPT_SINGLEJOBS ) ) -{ - FreeResource(); - - setupLayout(); + mpCollateBox->IsChecked() ? rtl::OUString("true") : + rtl::OUString("false") ); } -PrintDialog::OutputOptPage::~OutputOptPage() +PrintDialog::OutputOptPage::OutputOptPage( VclBuilder *pUIBuilder ) { -} - -void PrintDialog::OutputOptPage::setupLayout() -{ - boost::shared_ptr<vcl::RowOrColumn> xLayout = - boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - - xLayout->addWindow( &maOptionsLine ); - boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( xLayout.get(), -1 ) ); - xLayout->addChild( xIndent ); - boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get() ) ); - xIndent->setChild( xCol ); - mxOptGroup = xCol; - xCol->addWindow( &maToFileBox ); - xCol->addWindow( &maCollateSingleJobsBox ); + pUIBuilder->get(mpToFileBox, "printtofile"); + pUIBuilder->get(mpCollateSingleJobsBox, "singleprintjob"); } void PrintDialog::OutputOptPage::readFromSettings() @@ -694,13 +538,12 @@ void PrintDialog::OutputOptPage::readFromSettings() rtl::OUString( "CollateSingleJobs" ) ); if ( aValue.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) ) { - maCollateSingleJobsBox.Check( sal_True ); + mpCollateSingleJobsBox->Check( sal_True ); } else { - maCollateSingleJobsBox.Check( sal_False ); + mpCollateSingleJobsBox->Check( sal_False ); } - Resize(); } void PrintDialog::OutputOptPage::storeToSettings() @@ -708,30 +551,21 @@ void PrintDialog::OutputOptPage::storeToSettings() SettingsConfigItem* pItem = SettingsConfigItem::get(); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "ToFile" ), - maToFileBox.IsChecked() ? rtl::OUString("true") + mpToFileBox->IsChecked() ? rtl::OUString("true") : rtl::OUString("false") ); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "CollateSingleJobs" ), - maCollateSingleJobsBox.IsChecked() ? rtl::OUString("true") : + mpCollateSingleJobsBox->IsChecked() ? rtl::OUString("true") : rtl::OUString("false") ); } PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController ) - : ModalDialog( i_pParent, VclResId( SV_DLG_PRINT ) ) - , maTabCtrl( this, VclResId( SV_PRINT_TABCTRL ) ) - , maNUpPage( &maTabCtrl, VclResId( SV_PRINT_TAB_NUP ) ) - , maJobPage( &maTabCtrl, VclResId( SV_PRINT_TAB_JOB ) ) - , maOptionsPage( &maTabCtrl, VclResId( SV_PRINT_TAB_OPT ) ) - , maPreviewWindow( this, VclResId( SV_PRINT_PAGE_PREVIEW ) ) - , maPageEdit( this, VclResId( SV_PRINT_PAGE_EDIT ) ) - , maNumPagesText( this, VclResId( SV_PRINT_PAGE_TXT ) ) - , maBackwardBtn( this, VclResId( SV_PRINT_PAGE_BACKWARD ) ) - , maForwardBtn( this, VclResId( SV_PRINT_PAGE_FORWARD ) ) - , maButtonLine( this, VclResId( SV_PRINT_BUTTONLINE ) ) - , maOKButton( this, VclResId( SV_PRINT_OK ) ) - , maCancelButton( this, VclResId( SV_PRINT_CANCEL ) ) - , maHelpButton( this, VclResId( SV_PRINT_HELP ) ) + : ModalDialog(i_pParent, "PrintDialog", "vcl/ui/printdialog.ui") + , mpCustomOptionsUIBuilder(NULL) , maPController( i_rController ) + , maNUpPage(m_pUIBuilder) + , maJobPage(m_pUIBuilder) + , maOptionsPage(m_pUIBuilder) , maNoPageStr( VclResId( SV_PRINT_NOPAGES ).toString() ) , mnCurPage( 0 ) , mnCachedPages( 0 ) @@ -739,42 +573,45 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont , maDefPrtText( VclResId( SV_PRINT_DEFPRT_TXT ).toString() ) , mbShowLayoutPage( sal_True ) { - FreeResource(); + get(mpOKButton, "ok"); + get(mpCancelButton, "cancel"); + get(mpHelpButton, "help"); + get(mpForwardBtn, "forward"); + get(mpBackwardBtn, "backward"); + get(mpNumPagesText, "totalnumpages"); + get(mpPageEdit, "pageedit-nospin"); + get(mpTabCtrl, "tabcontrol"); + get(mpPreviewWindow, "preview"); // save printbutton text, gets exchanged occasionally with print to file - maPrintText = maOKButton.GetText(); + maPrintText = mpOKButton->GetText(); // setup preview controls - maForwardBtn.SetStyle( maForwardBtn.GetStyle() | WB_BEVELBUTTON ); - maBackwardBtn.SetStyle( maBackwardBtn.GetStyle() | WB_BEVELBUTTON ); - - // insert the job (general) tab page first - maTabCtrl.InsertPage( SV_PRINT_TAB_JOB, maJobPage.GetText() ); - maTabCtrl.SetTabPage( SV_PRINT_TAB_JOB, &maJobPage ); + mpForwardBtn->SetStyle( mpForwardBtn->GetStyle() | WB_BEVELBUTTON ); + mpBackwardBtn->SetStyle( mpBackwardBtn->GetStyle() | WB_BEVELBUTTON ); // set symbols on forward and backward button - maBackwardBtn.SetSymbol( SYMBOL_PREV ); - maForwardBtn.SetSymbol( SYMBOL_NEXT ); - maBackwardBtn.ImplSetSmallSymbol( sal_True ); - maForwardBtn.ImplSetSmallSymbol( sal_True ); + mpBackwardBtn->SetSymbol( SYMBOL_PREV ); + mpForwardBtn->SetSymbol( SYMBOL_NEXT ); + mpBackwardBtn->ImplSetSmallSymbol( sal_True ); + mpForwardBtn->ImplSetSmallSymbol( sal_True ); - maPageStr = maNumPagesText.GetText(); + maPageStr = mpNumPagesText->GetText(); // init reverse print - maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() ); - + maJobPage.mpReverseOrderBox->Check( maPController->getReversePrint() ); // fill printer listbox const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() ); for( std::vector< rtl::OUString >::const_iterator it = rQueues.begin(); it != rQueues.end(); ++it ) { - maJobPage.maPrinters.InsertEntry( *it ); + maJobPage.mpPrinters->InsertEntry( *it ); } // select current printer - if( maJobPage.maPrinters.GetEntryPos( maPController->getPrinter()->GetName() ) != LISTBOX_ENTRY_NOTFOUND ) + if( maJobPage.mpPrinters->GetEntryPos( maPController->getPrinter()->GetName() ) != LISTBOX_ENTRY_NOTFOUND ) { - maJobPage.maPrinters.SelectEntry( maPController->getPrinter()->GetName() ); + maJobPage.mpPrinters->SelectEntry( maPController->getPrinter()->GetName() ); } else { @@ -782,15 +619,15 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont SettingsConfigItem* pItem = SettingsConfigItem::get(); String aValue( pItem->getValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "LastPrinter" ) ) ); - if( maJobPage.maPrinters.GetEntryPos( aValue ) != LISTBOX_ENTRY_NOTFOUND ) + if( maJobPage.mpPrinters->GetEntryPos( aValue ) != LISTBOX_ENTRY_NOTFOUND ) { - maJobPage.maPrinters.SelectEntry( aValue ); + maJobPage.mpPrinters->SelectEntry( aValue ); maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aValue ) ) ); } else { // fall back to default printer - maJobPage.maPrinters.SelectEntry( Printer::GetDefaultPrinterName() ); + maJobPage.mpPrinters->SelectEntry( Printer::GetDefaultPrinterName() ); maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( Printer::GetDefaultPrinterName() ) ) ); } } @@ -804,7 +641,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont updatePrinterText(); // set a select handler - maJobPage.maPrinters.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); + maJobPage.mpPrinters->SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); // setup sizes for N-Up Size aNupSize( maPController->getPrinter()->PixelToLogic( @@ -821,39 +658,34 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont } maNUpPage.initFromMultiPageSetup( maPController->getMultipage() ); - // setup click handler on the various buttons - maOKButton.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + mpOKButton->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); #if OSL_DEBUG_LEVEL > 1 - maCancelButton.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + mpCancelButton->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); #endif - maHelpButton.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); - maForwardBtn.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); - maBackwardBtn.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); - maJobPage.maCollateBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maJobPage.maSetupButton.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); - maJobPage.maDetailsBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); - maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - + mpHelpButton->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + mpForwardBtn->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + mpBackwardBtn->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + + maJobPage.mpCollateBox->SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maJobPage.mpSetupButton->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + maNUpPage.mpBorderCB->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); + maOptionsPage.mpToFileBox->SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maJobPage.mpReverseOrderBox->SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maOptionsPage.mpCollateSingleJobsBox->SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maNUpPage.mpPagesBtn->SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); // setup modify hdl - maPageEdit.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); - maJobPage.maCopyCountField.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); - maNUpPage.maNupRowsEdt.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); - maNUpPage.maNupColEdt.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); - maNUpPage.maPageMarginEdt.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); - maNUpPage.maSheetMarginEdt.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); + mpPageEdit->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); + maJobPage.mpCopyCountField->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); + maNUpPage.mpNupRowsEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); + maNUpPage.mpNupColEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); + maNUpPage.mpPageMarginEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); + maNUpPage.mpSheetMarginEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) ); // setup select hdl - maNUpPage.maNupPagesBox.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); - maNUpPage.maNupOrientationBox.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); - maNUpPage.maNupOrderBox.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); - - // setup the layout - setupLayout(); + maNUpPage.mpNupPagesBox->SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); + maNUpPage.mpNupOrientationBox->SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); + maNUpPage.mpNupOrderBox->SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) ); // setup optional UI options set by application setupOptionalUI(); @@ -861,40 +693,9 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont // set change handler for UI options maPController->setOptionChangeHdl( LINK( this, PrintDialog, UIOptionsChanged ) ); - // set min size pixel to current size - Size aOutSize( GetOutputSizePixel() ); - SetMinOutputSizePixel( aOutSize ); - - // if there is space enough, enlarge the preview so it gets roughly as - // high as the tab control - if( aOutSize.Width() < 768 ) - { - Size aJobPageSize( getJobPageSize() ); - Size aTabSize( maTabCtrl.GetSizePixel() ); - if( aJobPageSize.Width() < 1 ) - aJobPageSize.Width() = aTabSize.Width(); - if( aJobPageSize.Height() < 1 ) - aJobPageSize.Height() = aTabSize.Height(); - long nOptPreviewWidth = aTabSize.Height() * aJobPageSize.Width() / aJobPageSize.Height(); - // add space for borders - nOptPreviewWidth += 15; - if( aOutSize.Width() - aTabSize.Width() < nOptPreviewWidth ) - { - aOutSize.Width() = aTabSize.Width() + nOptPreviewWidth; - if( aOutSize.Width() > 768 ) // don't enlarge the dialog too much - aOutSize.Width() = 768; - SetOutputSizePixel( aOutSize ); - } - } - - // append further tab pages - if( mbShowLayoutPage ) - { - maTabCtrl.InsertPage( SV_PRINT_TAB_NUP, maNUpPage.GetText() ); - maTabCtrl.SetTabPage( SV_PRINT_TAB_NUP, &maNUpPage ); - } - maTabCtrl.InsertPage( SV_PRINT_TAB_OPT, maOptionsPage.GetText() ); - maTabCtrl.SetTabPage( SV_PRINT_TAB_OPT, &maOptionsPage ); + // remove layout page if unwanted + if (!mbShowLayoutPage) + mpTabCtrl->RemovePage(mpTabCtrl->GetPageId(2)); // restore settings from last run readFromSettings(); @@ -903,70 +704,17 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont checkControlDependencies(); if ( maPController->getBoolProperty( rtl::OUString( "HideHelpButton" ), sal_False ) ) - maHelpButton.Hide(); - + mpHelpButton->Hide(); // set initial focus to "Number of copies" - maJobPage.maCopyCountField.GrabFocus(); - maJobPage.maCopyCountField.SetSelection( Selection(0, 0xFFFF) ); + maJobPage.mpCopyCountField->GrabFocus(); + maJobPage.mpCopyCountField->SetSelection( Selection(0, 0xFFFF) ); + + updateNupFromPages(); } PrintDialog::~PrintDialog() { - while( ! maControls.empty() ) - { - delete maControls.front(); - maControls.pop_front(); - } -} - -void PrintDialog::setupLayout() -{ - boost::shared_ptr<vcl::RowOrColumn> xLayout = - boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - xLayout->setOuterBorder( 0 ); - - - boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( xLayout.get(), false ) ); - size_t nIndex = xLayout->addChild( xPreviewAndTab, 5 ); - xLayout->setBorders( nIndex, -1, -1, -1, 0 ); - - // setup column for preview and sub controls - boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) ); - xPreviewAndTab->addChild( xPreview, 5 ); - xPreview->addWindow( &maPreviewWindow, 5 ); - // get a row for the preview controls - mxPreviewCtrls.reset( new vcl::RowOrColumn( xPreview.get(), false ) ); - nIndex = xPreview->addChild( mxPreviewCtrls ); - boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( mxPreviewCtrls.get(), 2 ) ); - mxPreviewCtrls->addChild( xSpacer ); - mxPreviewCtrls->addWindow( &maPageEdit ); - mxPreviewCtrls->addWindow( &maNumPagesText ); - xSpacer.reset( new vcl::Spacer( mxPreviewCtrls.get(), 2 ) ); - mxPreviewCtrls->addChild( xSpacer ); - mxPreviewCtrls->addWindow( &maBackwardBtn ); - mxPreviewCtrls->addWindow( &maForwardBtn ); - xSpacer.reset( new vcl::Spacer( mxPreviewCtrls.get(), 2 ) ); - mxPreviewCtrls->addChild( xSpacer ); - - // continue with the tab ctrl - xPreviewAndTab->addWindow( &maTabCtrl ); - - // add the button line - xLayout->addWindow( &maButtonLine ); - - // add the row for the buttons - boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) ); - nIndex = xLayout->addChild( xButtons ); - xLayout->setBorders( nIndex, -1, 0, -1, -1 ); - - Size aMinSize( maCancelButton.GetSizePixel() ); - // insert help button - xButtons->setMinimumSize( xButtons->addWindow( &maHelpButton ), aMinSize ); - // insert a spacer, cancel and OK buttons are right aligned - xSpacer.reset( new vcl::Spacer( xButtons.get(), 2 ) ); - xButtons->addChild( xSpacer ); - xButtons->setMinimumSize( xButtons->addWindow( &maOKButton ), aMinSize ); - xButtons->setMinimumSize( xButtons->addWindow( &maCancelButton ), aMinSize ); + delete mpCustomOptionsUIBuilder; } void PrintDialog::readFromSettings() @@ -979,17 +727,17 @@ void PrintDialog::readFromSettings() SettingsConfigItem* pItem = SettingsConfigItem::get(); rtl::OUString aValue = pItem->getValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "LastPage" ) ); - sal_uInt16 nCount = maTabCtrl.GetPageCount(); + sal_uInt16 nCount = mpTabCtrl->GetPageCount(); for( sal_uInt16 i = 0; i < nCount; i++ ) { - sal_uInt16 nPageId = maTabCtrl.GetPageId( i ); - if( aValue.equals( maTabCtrl.GetPageText( nPageId ) ) ) + sal_uInt16 nPageId = mpTabCtrl->GetPageId( i ); + if( aValue.equals( mpTabCtrl->GetPageText( nPageId ) ) ) { - maTabCtrl.SelectTabPage( nPageId ); + mpTabCtrl->SelectTabPage( nPageId ); break; } } - maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); + mpOKButton->SetText( maOptionsPage.mpToFileBox->IsChecked() ? maPrintToFileText : maPrintText ); // persistent window state rtl::OUString aWinState( pItem->getValue( rtl::OUString( "PrintDialog" ), @@ -997,7 +745,7 @@ void PrintDialog::readFromSettings() if( !aWinState.isEmpty() ) SetWindowState( rtl::OUStringToOString( aWinState, RTL_TEXTENCODING_UTF8 ) ); - if( maOptionsPage.maToFileBox.IsChecked() ) + if( maOptionsPage.mpToFileBox->IsChecked() ) { maPController->resetPrinterOptions( true ); preparePreview( true, true ); @@ -1014,11 +762,11 @@ void PrintDialog::storeToSettings() SettingsConfigItem* pItem = SettingsConfigItem::get(); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "LastPrinter" ), - maJobPage.maPrinters.GetSelectEntry() ); + maJobPage.mpPrinters->GetSelectEntry() ); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "LastPage" ), - maTabCtrl.GetPageText( maTabCtrl.GetCurPageId() ) ); + mpTabCtrl->GetPageText( mpTabCtrl->GetCurPageId() ) ); pItem->setValue( rtl::OUString( "PrintDialog" ), rtl::OUString( "WindowState" ), rtl::OStringToOUString( GetWindowState(), RTL_TEXTENCODING_UTF8 ) @@ -1028,17 +776,17 @@ void PrintDialog::storeToSettings() bool PrintDialog::isPrintToFile() { - return maOptionsPage.maToFileBox.IsChecked(); + return maOptionsPage.mpToFileBox->IsChecked(); } bool PrintDialog::isCollate() { - return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : sal_False; + return maJobPage.mpCopyCountField->GetValue() > 1 ? maJobPage.mpCollateBox->IsChecked() : sal_False; } bool PrintDialog::isSingleJobs() { - return maOptionsPage.maCollateSingleJobsBox.IsChecked(); + return maOptionsPage.mpCollateSingleJobsBox->IsChecked(); } void setHelpId( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpIds, sal_Int32 i_nIndex ) @@ -1055,39 +803,41 @@ static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_r i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] ); } -void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize ) -{ - if( i_rCheckSize.Width() > o_rMaxSize.Width() ) - o_rMaxSize.Width() = i_rCheckSize.Width(); - if( i_rCheckSize.Height() > o_rMaxSize.Height() ) - o_rMaxSize.Height() = i_rCheckSize.Height(); -} - void PrintDialog::setupOptionalUI() { - std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns; - boost::shared_ptr< vcl::RowOrColumn > pCurColumn; - - Window* pCurParent = 0, *pDynamicPageParent = 0; - sal_uInt16 nOptPageId = 9; - bool bOnStaticPage = false; - bool bSubgroupOnStaticPage = false; - - std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap; - const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() ); for( int i = 0; i < rOptions.getLength(); i++ ) { + fprintf(stderr, "property name is %s\n", rtl::OUStringToOString(rOptions[i].Name, RTL_TEXTENCODING_UTF8).getStr()); + + if (rOptions[i].Name == "OptionsUIFile") + { + rtl::OUString sOptionsUIFile; + rOptions[i].Value >>= sOptionsUIFile; + + Window *pCustom = get<Window>("customcontents"); + + fprintf(stderr, "pcustom is %p\n", pCustom); + + delete mpCustomOptionsUIBuilder; + mpCustomOptionsUIBuilder = new VclBuilder(pCustom, getUIRootDir(), sOptionsUIFile); + Window *pWindow = mpCustomOptionsUIBuilder->get_widget_root(); + pWindow->Show(); + continue; + } + Sequence< beans::PropertyValue > aOptProp; rOptions[i].Value >>= aOptProp; // extract ui element rtl::OUString aCtrlType; + rtl::OString aID; rtl::OUString aText; rtl::OUString aPropertyName; Sequence< rtl::OUString > aChoices; Sequence< sal_Bool > aChoicesDisabled; Sequence< rtl::OUString > aHelpTexts; + Sequence< rtl::OUString > aIDs; Sequence< rtl::OUString > aHelpIds; sal_Int64 nMinValue = 0, nMaxValue = 0; rtl::OUString aGroupingHint; @@ -1098,6 +848,11 @@ void PrintDialog::setupOptionalUI() for( int n = 0; n < aOptProp.getLength(); n++ ) { const beans::PropertyValue& rEntry( aOptProp[ n ] ); + if ( rEntry.Name == "ID" ) + { + rEntry.Value >>= aIDs; + aID = rtl::OUStringToOString(aIDs[0], RTL_TEXTENCODING_UTF8); + } if ( rEntry.Name == "Text" ) { rEntry.Value >>= aText; @@ -1181,463 +936,225 @@ void PrintDialog::setupOptionalUI() } } - // bUseDependencyRow should only be true if a dependency exists - bUseDependencyRow = bUseDependencyRow && !aDependsOnName.isEmpty(); - - // is it necessary to switch between static and dynamic pages ? - bool bSwitchPage = false; - if( !aGroupingHint.isEmpty() ) - bSwitchPage = true; - else if( aCtrlType == "Subgroup" || (bOnStaticPage && ! bSubgroupOnStaticPage ) ) - bSwitchPage = true; - if( bSwitchPage ) + if (aCtrlType == "Group" && !aID.isEmpty()) { - // restore to dynamic - pCurParent = pDynamicPageParent; - if( ! aDynamicColumns.empty() ) - pCurColumn = aDynamicColumns.back(); - else - pCurColumn.reset(); - bOnStaticPage = false; - bSubgroupOnStaticPage = false; - - if ( aGroupingHint == "PrintRange" ) - { - pCurColumn = maJobPage.mxPrintRange; - pCurParent = &maJobPage; // set job page as current parent - bOnStaticPage = true; - } - else if ( aGroupingHint == "OptionsPage" ) - { - pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout()); - pCurParent = &maOptionsPage; // set options page as current parent - bOnStaticPage = true; - } - else if ( aGroupingHint == "OptionsPageOptGroup" ) - { - pCurColumn = maOptionsPage.mxOptGroup; - pCurParent = &maOptionsPage; // set options page as current parent - bOnStaticPage = true; - } - else if ( aGroupingHint == "LayoutPage" ) - { - pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout()); - pCurParent = &maNUpPage; // set layout page as current parent - bOnStaticPage = true; - } - else if( !aGroupingHint.isEmpty() ) - { - pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout()); - pCurParent = &maJobPage; // set job page as current parent - bOnStaticPage = true; - } - } + TabPage *pPage = get<TabPage>(aID); + if (!pPage && mpCustomOptionsUIBuilder) + pPage = mpCustomOptionsUIBuilder->get<TabPage>(aID); + sal_uInt16 nPageId = mpTabCtrl->GetPageId(*pPage); - if( aCtrlType == "Group" || ( ! pCurParent && ! (bOnStaticPage || !aGroupingHint.isEmpty() ) ) ) - { - // add new tab page - TabPage* pNewGroup = new TabPage( &maTabCtrl ); - maControls.push_front( pNewGroup ); - pDynamicPageParent = pCurParent = pNewGroup; - pNewGroup->SetText( aText ); - maTabCtrl.InsertPage( ++nOptPageId, aText ); - maTabCtrl.SetTabPage( nOptPageId, pNewGroup ); + fprintf(stderr, "pCustomPage %p for %s\n", pPage, rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); + mpTabCtrl->SetPageText(nPageId, aText); // set help id - setHelpId( pNewGroup, aHelpIds, 0 ); + if (aHelpIds.getLength() > 0) + mpTabCtrl->SetHelpId(nPageId, rtl::OUStringToOString(aHelpIds.getConstArray()[0], RTL_TEXTENCODING_UTF8)); + // set help text - setHelpText( pNewGroup, aHelpTexts, 0 ); + if (aHelpTexts.getLength() > 0) + mpTabCtrl->SetHelpText(nPageId, aHelpTexts.getConstArray()[0]); - aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) ); - pCurColumn = aDynamicColumns.back(); - pCurColumn->setParentWindow( pNewGroup ); - bSubgroupOnStaticPage = false; - bOnStaticPage = false; + pPage->Show(); } - else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && (pCurParent || !aGroupingHint.isEmpty() ) ) + else if (aCtrlType == "Subgroup" && !aID.isEmpty()) { - bSubgroupOnStaticPage = !aGroupingHint.isEmpty(); - // create group FixedLine - if( ! aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) || - ! pCurColumn->countElements() == 0 - ) - { - Window* pNewSub = NULL; - if ( aGroupingHint == "PrintRange" ) - pNewSub = new FixedText( pCurParent, WB_VCENTER ); - else - pNewSub = new FixedLine( pCurParent ); - maControls.push_front( pNewSub ); - pNewSub->SetText( aText ); - pNewSub->Show(); + Window *pFrame = get<Window>(aID); + if (!pFrame && mpCustomOptionsUIBuilder) + pFrame = mpCustomOptionsUIBuilder->get<Window>(aID); - // set help id - setHelpId( pNewSub, aHelpIds, 0 ); - // set help text - setHelpText( pNewSub, aHelpTexts, 0 ); - // add group to current column - pCurColumn->addWindow( pNewSub ); - } + pFrame->SetText(aText); + + // set help id + setHelpId(pFrame, aHelpIds, 0); + // set help text + setHelpText(pFrame, aHelpTexts, 0); - // add an indent to the current column - vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 ); - pCurColumn->addChild( pIndent ); - // and create a column inside the indent - pCurColumn.reset( new vcl::RowOrColumn( pIndent ) ); - pIndent->setChild( pCurColumn ); + pFrame->Show(); } // EVIL else if( aCtrlType == "Bool" && aGroupingHint == "LayoutPage" && aPropertyName == "PrintProspect" ) { - maNUpPage.maBrochureBtn.SetText( aText ); - maNUpPage.maBrochureBtn.Show(); - setHelpText( &maNUpPage.maBrochureBtn, aHelpTexts, 0 ); + maNUpPage.mpBrochureBtn->SetText( aText ); + maNUpPage.mpBrochureBtn->Show(); + setHelpText( maNUpPage.mpBrochureBtn, aHelpTexts, 0 ); sal_Bool bVal = sal_False; PropertyValue* pVal = maPController->getValue( aPropertyName ); if( pVal ) pVal->Value >>= bVal; - maNUpPage.maBrochureBtn.Check( bVal ); - maNUpPage.maBrochureBtn.Enable( maPController->isUIOptionEnabled( aPropertyName ) && pVal != NULL ); - maNUpPage.maBrochureBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maNUpPage.mpBrochureBtn->Check( bVal ); + maNUpPage.mpBrochureBtn->Enable( maPController->isUIOptionEnabled( aPropertyName ) && pVal != NULL ); + maNUpPage.mpBrochureBtn->SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn ); - maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName; + maPropertyToWindowMap[ aPropertyName ].push_back( maNUpPage.mpBrochureBtn ); + maControlToPropertyMap[maNUpPage.mpBrochureBtn] = aPropertyName; + } + else if (aCtrlType == "Bool") + { + // add a check box + CheckBox* pNewBox = get<CheckBox>(aID); + if (!pNewBox && mpCustomOptionsUIBuilder) + pNewBox = mpCustomOptionsUIBuilder->get<CheckBox>(aID); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) ); + pNewBox->SetText( aText ); + pNewBox->Show(); + + sal_Bool bVal = sal_False; + PropertyValue* pVal = maPController->getValue( aPropertyName ); + if( pVal ) + pVal->Value >>= bVal; + pNewBox->Check( bVal ); + pNewBox->SetToggleHdl( LINK( this, PrintDialog, UIOption_CheckHdl ) ); + + maPropertyToWindowMap[ aPropertyName ].push_back( pNewBox ); + maControlToPropertyMap[pNewBox] = aPropertyName; + + // set help id + setHelpId( pNewBox, aHelpIds, 0 ); + // set help text + setHelpText( pNewBox, aHelpTexts, 0 ); } - else + else if (aCtrlType == "Radio") { - boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn ); + sal_Int32 nCurHelpText = 0; - if( bUseDependencyRow ) - { - // find the correct dependency row (if any) - std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator, - std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange; - aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName ); - if( aDepRange.first != aDepRange.second ) - { - while( nDependsOnValue && aDepRange.first != aDepRange.second ) - { - nDependsOnValue--; - ++aDepRange.first; - } - if( aDepRange.first != aPropertyToDependencyRowMap.end() ) - { - pCurColumn = aDepRange.first->second; - maReverseDependencySet.insert( aPropertyName ); - } - } - } - if( aCtrlType == "Bool" && pCurParent ) + // iterate options + sal_Int32 nSelectVal = 0; + PropertyValue* pVal = maPController->getValue( aPropertyName ); + if( pVal && pVal->Value.hasValue() ) + pVal->Value >>= nSelectVal; + for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) { - // add a check box - CheckBox* pNewBox = new CheckBox( pCurParent ); - maControls.push_front( pNewBox ); - pNewBox->SetText( aText ); - pNewBox->Show(); - - sal_Bool bVal = sal_False; - PropertyValue* pVal = maPController->getValue( aPropertyName ); - if( pVal ) - pVal->Value >>= bVal; - pNewBox->Check( bVal ); - pNewBox->SetToggleHdl( LINK( this, PrintDialog, UIOption_CheckHdl ) ); - - maPropertyToWindowMap[ aPropertyName ].push_back( pNewBox ); - maControlToPropertyMap[pNewBox] = aPropertyName; + aID = rtl::OUStringToOString(aIDs[m], RTL_TEXTENCODING_UTF8); + RadioButton* pBtn = get<RadioButton>(aID); + if (!pBtn && mpCustomOptionsUIBuilder) + pBtn = mpCustomOptionsUIBuilder->get<RadioButton>(aID); + + pBtn->SetText( aChoices[m] ); + pBtn->Check( m == nSelectVal ); + pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) ); + if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True ) + pBtn->Enable( sal_False ); + pBtn->Show(); + maPropertyToWindowMap[ aPropertyName ].push_back( pBtn ); + maControlToPropertyMap[pBtn] = aPropertyName; + maControlToNumValMap[pBtn] = m; // set help id - setHelpId( pNewBox, aHelpIds, 0 ); + setHelpId( pBtn, aHelpIds, nCurHelpText ); // set help text - setHelpText( pNewBox, aHelpTexts, 0 ); - - boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) ); - pCurColumn->addChild( pDependencyRow ); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) ); - - // add checkbox to current column - pDependencyRow->addWindow( pNewBox ); + setHelpText( pBtn, aHelpTexts, nCurHelpText ); + nCurHelpText++; } - else if( aCtrlType == "Radio" && pCurParent ) + } + else if ( aCtrlType == "List" ) + { + ListBox* pList = get<ListBox>(aID); + if (!pList && mpCustomOptionsUIBuilder) + pList = mpCustomOptionsUIBuilder->get<ListBox>(aID); + + // iterate options + for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) { - sal_Int32 nCurHelpText = 0; - boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn ); - if( !aText.isEmpty() ) - { - // add a FixedText: - FixedText* pHeading = new FixedText( pCurParent ); - maControls.push_front( pHeading ); - pHeading->SetText( aText ); - pHeading->Show(); - - // set help id - setHelpId( pHeading, aHelpIds, nCurHelpText ); - // set help text - setHelpText( pHeading, aHelpTexts, nCurHelpText ); - nCurHelpText++; - // add fixed text to current column - pCurColumn->addWindow( pHeading ); - // add an indent to the current column - vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 ); - pCurColumn->addChild( pIndent ); - // and create a column inside the indent - pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) ); - pIndent->setChild( pRadioColumn ); - } - // iterate options - sal_Int32 nSelectVal = 0; - PropertyValue* pVal = maPController->getValue( aPropertyName ); - if( pVal && pVal->Value.hasValue() ) - pVal->Value >>= nSelectVal; - for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) - { - boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn.get(), 1 ) ); - pRadioColumn->addChild( pLabel ); - boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pLabel.get(), false ) ); - pLabel->setElement( pDependencyRow ); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) ); - - RadioButton* pBtn = new RadioButton( pCurParent, m == 0 ? WB_GROUP : 0 ); - maControls.push_front( pBtn ); - pBtn->SetText( aChoices[m] ); - pBtn->Check( m == nSelectVal ); - pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) ); - if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True ) - pBtn->Enable( sal_False ); - pBtn->Show(); - maPropertyToWindowMap[ aPropertyName ].push_back( pBtn ); - maControlToPropertyMap[pBtn] = aPropertyName; - maControlToNumValMap[pBtn] = m; - - // set help id - setHelpId( pBtn, aHelpIds, nCurHelpText ); - // set help text - setHelpText( pBtn, aHelpTexts, nCurHelpText ); - nCurHelpText++; - // add the radio button to the column - pLabel->setLabel( pBtn ); - } + pList->InsertEntry( aChoices[m] ); } - else if( ( aCtrlType == "List" || aCtrlType == "Range" || aCtrlType == "Edit" ) && pCurParent ) - { - // create a row in the current column - boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) ); - pCurColumn->addChild( pFieldColumn ); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) ); + sal_Int32 nSelectVal = 0; + PropertyValue* pVal = maPController->getValue( aPropertyName ); + if( pVal && pVal->Value.hasValue() ) + pVal->Value >>= nSelectVal; + pList->SelectEntryPos( static_cast<sal_uInt16>(nSelectVal) ); + pList->SetSelectHdl( LINK( this, PrintDialog, UIOption_SelectHdl ) ); + pList->SetDropDownLineCount( static_cast<sal_uInt16>(aChoices.getLength()) ); + pList->Show(); - vcl::LabeledElement* pLabel = NULL; - if( !aText.isEmpty() ) - { - // add a FixedText: - FixedText* pHeading = new FixedText( pCurParent, WB_VCENTER ); - maControls.push_front( pHeading ); - pHeading->SetText( aText ); - pHeading->Show(); + // set help id + setHelpId( pList, aHelpIds, 0 ); + // set help text + setHelpText( pList, aHelpTexts, 0 ); + maPropertyToWindowMap[ aPropertyName ].push_back( pList ); + maControlToPropertyMap[pList] = aPropertyName; + } + else if ( aCtrlType == "Range" ) + { + NumericField* pField = get<NumericField>(aID); + if (!pField && mpCustomOptionsUIBuilder) + pField = mpCustomOptionsUIBuilder->get<NumericField>(aID); - // add to row - pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 ); - pFieldColumn->addChild( pLabel ); - pLabel->setLabel( pHeading ); - } + // set min/max and current value + if( nMinValue != nMaxValue ) + { + pField->SetMin( nMinValue ); + pField->SetMax( nMaxValue ); + } + sal_Int64 nCurVal = 0; + PropertyValue* pVal = maPController->getValue( aPropertyName ); + if( pVal && pVal->Value.hasValue() ) + pVal->Value >>= nCurVal; + pField->SetValue( nCurVal ); + pField->SetModifyHdl( LINK( this, PrintDialog, UIOption_ModifyHdl ) ); + pField->Show(); - if ( aCtrlType == "List" ) - { - ListBox* pList = new ListBox( pCurParent, WB_DROPDOWN | WB_BORDER ); - maControls.push_front( pList ); + // set help id + setHelpId( pField, aHelpIds, 0 ); + // set help text + setHelpText( pField, aHelpTexts, 0 ); - // iterate options - for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) - { - pList->InsertEntry( aChoices[m] ); - } - sal_Int32 nSelectVal = 0; - PropertyValue* pVal = maPController->getValue( aPropertyName ); - if( pVal && pVal->Value.hasValue() ) - pVal->Value >>= nSelectVal; - pList->SelectEntryPos( static_cast<sal_uInt16>(nSelectVal) ); - pList->SetSelectHdl( LINK( this, PrintDialog, UIOption_SelectHdl ) ); - pList->SetDropDownLineCount( static_cast<sal_uInt16>(aChoices.getLength()) ); - pList->Show(); - - // set help id - setHelpId( pList, aHelpIds, 0 ); - // set help text - setHelpText( pList, aHelpTexts, 0 ); - - maPropertyToWindowMap[ aPropertyName ].push_back( pList ); - maControlToPropertyMap[pList] = aPropertyName; - - // finish the pair - if( pLabel ) - pLabel->setElement( pList ); - else - pFieldColumn->addWindow( pList ); - } - else if ( aCtrlType == "Range" ) - { - NumericField* pField = new NumericField( pCurParent, WB_BORDER | WB_SPIN ); - maControls.push_front( pField ); + maPropertyToWindowMap[ aPropertyName ].push_back( pField ); + maControlToPropertyMap[pField] = aPropertyName; + } + else if (aCtrlType == "Edit") + { + Edit *pField = get<Edit>(aID); + if (!pField && mpCustomOptionsUIBuilder) + pField = mpCustomOptionsUIBuilder->get<Edit>(aID); - // set min/max and current value - if( nMinValue != nMaxValue ) - { - pField->SetMin( nMinValue ); - pField->SetMax( nMaxValue ); - } - sal_Int64 nCurVal = 0; - PropertyValue* pVal = maPController->getValue( aPropertyName ); - if( pVal && pVal->Value.hasValue() ) - pVal->Value >>= nCurVal; - pField->SetValue( nCurVal ); - pField->SetModifyHdl( LINK( this, PrintDialog, UIOption_ModifyHdl ) ); - pField->Show(); - - // set help id - setHelpId( pField, aHelpIds, 0 ); - // set help text - setHelpText( pField, aHelpTexts, 0 ); - - maPropertyToWindowMap[ aPropertyName ].push_back( pField ); - maControlToPropertyMap[pField] = aPropertyName; - - // add to row - if( pLabel ) - pLabel->setElement( pField ); - else - pFieldColumn->addWindow( pField ); - } - else if ( aCtrlType == "Edit" ) - { - Edit* pField = new Edit( pCurParent, WB_BORDER ); - maControls.push_front( pField ); - - rtl::OUString aCurVal; - PropertyValue* pVal = maPController->getValue( aPropertyName ); - if( pVal && pVal->Value.hasValue() ) - pVal->Value >>= aCurVal; - pField->SetText( aCurVal ); - pField->SetModifyHdl( LINK( this, PrintDialog, UIOption_ModifyHdl ) ); - pField->Show(); - - // set help id - setHelpId( pField, aHelpIds, 0 ); - // set help text - setHelpText( pField, aHelpTexts, 0 ); - - maPropertyToWindowMap[ aPropertyName ].push_back( pField ); - maControlToPropertyMap[pField] = aPropertyName; - - // add to row - if( pLabel ) - pLabel->setElement( pField ); - else - pFieldColumn->addWindow( pField, 2 ); - } - } - else - { - rtl::OStringBuffer sMessage; - sMessage.append(RTL_CONSTASCII_STRINGPARAM("Unsupported UI option: \"")); - sMessage.append(rtl::OUStringToOString(aCtrlType, RTL_TEXTENCODING_UTF8)); - sMessage.append('"'); - OSL_FAIL( sMessage.getStr() ); - } + rtl::OUString aCurVal; + PropertyValue* pVal = maPController->getValue( aPropertyName ); + if( pVal && pVal->Value.hasValue() ) + pVal->Value >>= aCurVal; + pField->SetText( aCurVal ); + pField->SetModifyHdl( LINK( this, PrintDialog, UIOption_ModifyHdl ) ); + pField->Show(); - pCurColumn = pSaveCurColumn; + // set help id + setHelpId( pField, aHelpIds, 0 ); + // set help text + setHelpText( pField, aHelpTexts, 0 ); + + maPropertyToWindowMap[ aPropertyName ].push_back( pField ); + maControlToPropertyMap[pField] = aPropertyName; + } + else + { + rtl::OStringBuffer sMessage; + sMessage.append(RTL_CONSTASCII_STRINGPARAM("Unsupported UI option: \"")); + sMessage.append(rtl::OUStringToOString(aCtrlType, RTL_TEXTENCODING_UTF8)); + sMessage.append('"'); + OSL_FAIL( sMessage.getStr() ); } } // #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.mpBrochureBtn->IsVisible() && maNUpPage.mpPagesBtn->IsVisible()) { - if( maNUpPage.mxPagesBtnLabel.get() ) - { - maNUpPage.maPagesBoxTitleTxt.SetText( maNUpPage.maPagesBtn.GetText() ); - maNUpPage.maPagesBoxTitleTxt.Show( sal_True ); - maNUpPage.mxPagesBtnLabel->setLabel( &maNUpPage.maPagesBoxTitleTxt ); - maNUpPage.maPagesBtn.Show( sal_False ); - } + maNUpPage.mpPagesBoxTitleTxt->SetText( maNUpPage.mpPagesBtn->GetText() ); + maNUpPage.mpPagesBoxTitleTxt->Show( sal_True ); + maNUpPage.mpPagesBtn->Show( sal_False ); } // update enable states checkOptionalControlDependencies(); - // print range empty (currently math only) -> hide print range and spacer line - if( maJobPage.mxPrintRange->countElements() == 0 ) - { - maJobPage.mxPrintRange->show( false, false ); - maJobPage.maCopySpacer.Show( sal_False ); - maJobPage.maReverseOrderBox.Show( sal_False ); - } - else - { - // add an indent to the current column - vcl::Indenter* pIndent = new vcl::Indenter( maJobPage.mxPrintRange.get(), -1 ); - maJobPage.mxPrintRange->addChild( pIndent ); - // and create a column inside the indent - pIndent->setWindow( &maJobPage.maReverseOrderBox ); - maJobPage.maReverseOrderBox.Show( sal_True ); - } + Window *pPageRange = get<Window>("pagerange"); -#ifdef WNT - // FIXME: the GetNativeControlRegion call on Windows has some issues - // (which skew the results of GetOptimalSize()) - // however fixing this thoroughly needs to take interaction with paint into - // account, making the right fix less simple. Fix this the right way - // at some point. For now simply add some space at the lowest element - size_t nIndex = maJobPage.getLayout()->countElements(); - if( nIndex > 0 ) // sanity check - maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 ); -#endif - - // create auto mnemomnics now so they can be calculated in layout - ImplWindowAutoMnemonic( &maJobPage ); - ImplWindowAutoMnemonic( &maNUpPage ); - ImplWindowAutoMnemonic( &maOptionsPage ); - ImplWindowAutoMnemonic( this ); - - // calculate job page - Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ); - // and layout page - updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize ); - // and options page - updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize ); - - for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin(); - it != aDynamicColumns.end(); ++it ) + // print range not shown (currently math only) -> hide spacer line and reverse order + if (!pPageRange || !pPageRange->IsVisible()) { - Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) ); - updateMaxSize( aPageSize, aMaxSize ); + maJobPage.mpCopySpacer->Show( sal_False ); + maJobPage.mpReverseOrderBox->Show( sal_False ); } - - // resize dialog if necessary - Size aTabSize = maTabCtrl.GetTabPageSizePixel(); - maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() ); - if( aMaxSize.Height() > aTabSize.Height() || aMaxSize.Width() > aTabSize.Width() ) - { - Size aCurSize( GetOutputSizePixel() ); - if( aMaxSize.Height() > aTabSize.Height() ) - { - aCurSize.Height() += aMaxSize.Height() - aTabSize.Height(); - aTabSize.Height() = aMaxSize.Height(); - } - if( aMaxSize.Width() > aTabSize.Width() ) - { - aCurSize.Width() += aMaxSize.Width() - aTabSize.Width(); - // and the tab ctrl needs more space, too - aTabSize.Width() = aMaxSize.Width(); - } - maTabCtrl.SetTabPageSizePixel( aTabSize ); - maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() ); - } - - Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ); - - SetOutputSizePixel( aSz ); } void PrintDialog::DataChanged( const DataChangedEvent& i_rDCEvt ) @@ -1650,50 +1167,22 @@ void PrintDialog::DataChanged( const DataChangedEvent& i_rDCEvt ) void PrintDialog::checkControlDependencies() { - if( maJobPage.maCopyCountField.GetValue() > 1 ) - maJobPage.maCollateBox.Enable( maJobPage.mnCollateUIMode == 0 ); + if( maJobPage.mpCopyCountField->GetValue() > 1 ) + maJobPage.mpCollateBox->Enable( maJobPage.mnCollateUIMode == 0 ); else - maJobPage.maCollateBox.Enable( sal_False ); + maJobPage.mpCollateBox->Enable( sal_False ); - Image aImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg ); + Image aImg( maJobPage.mpCollateBox->IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg ); Size aImgSize( aImg.GetSizePixel() ); // adjust size of image - maJobPage.maCollateImage.SetSizePixel( aImgSize ); - maJobPage.maCollateImage.SetImage( aImg ); - maJobPage.getLayout()->resize(); + maJobPage.mpCollateImage->SetSizePixel( aImgSize ); + maJobPage.mpCollateImage->SetImage( aImg ); // enable setup button only for printers that can be setup bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG ); - maJobPage.maSetupButton.Enable( bHaveSetup ); - if( bHaveSetup ) - { - if( ! maJobPage.maSetupButton.IsVisible() ) - { - Point aPrinterPos( maJobPage.maPrinters.GetPosPixel() ); - Point aSetupPos( maJobPage.maSetupButton.GetPosPixel() ); - Size aPrinterSize( maJobPage.maPrinters.GetSizePixel() ); - aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width(); - maJobPage.maPrinters.SetSizePixel( aPrinterSize ); - maJobPage.maSetupButton.Show(); - getLayout()->resize(); - } - } - else - { - if( maJobPage.maSetupButton.IsVisible() ) - { - Point aPrinterPos( maJobPage.maPrinters.GetPosPixel() ); - Point aSetupPos( maJobPage.maSetupButton.GetPosPixel() ); - Size aPrinterSize( maJobPage.maPrinters.GetSizePixel() ); - Size aSetupSize( maJobPage.maSetupButton.GetSizePixel() ); - aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X(); - maJobPage.maPrinters.SetSizePixel( aPrinterSize ); - maJobPage.maSetupButton.Hide(); - getLayout()->resize(); - } - } + maJobPage.mpSetupButton->Enable(bHaveSetup); } void PrintDialog::checkOptionalControlDependencies() @@ -1755,29 +1244,29 @@ static rtl::OUString searchAndReplace( const rtl::OUString& i_rOrig, const char* void PrintDialog::updatePrinterText() { const rtl::OUString aDefPrt( Printer::GetDefaultPrinterName() ); - const QueueInfo* pInfo = Printer::GetQueueInfo( maJobPage.maPrinters.GetSelectEntry(), true ); + const QueueInfo* pInfo = Printer::GetQueueInfo( maJobPage.mpPrinters->GetSelectEntry(), true ); if( pInfo ) { - maJobPage.maLocationTxt.SetText( pInfo->GetLocation() ); - maJobPage.maCommentTxt.SetText( pInfo->GetComment() ); + maJobPage.mpLocationTxt->SetText( pInfo->GetLocation() ); + maJobPage.mpCommentTxt->SetText( pInfo->GetComment() ); // FIXME: status text rtl::OUString aStatus; if( aDefPrt == pInfo->GetPrinterName() ) aStatus = maDefPrtText; - maJobPage.maStatusTxt.SetText( aStatus ); + maJobPage.mpStatusTxt->SetText( aStatus ); } else { - maJobPage.maLocationTxt.SetText( String() ); - maJobPage.maCommentTxt.SetText( String() ); - maJobPage.maStatusTxt.SetText( String() ); + maJobPage.mpLocationTxt->SetText( String() ); + maJobPage.mpCommentTxt->SetText( String() ); + maJobPage.mpStatusTxt->SetText( String() ); } } void PrintDialog::setPreviewText( sal_Int32 ) { rtl::OUString aNewText( searchAndReplace( maPageStr, "%n", 2, rtl::OUString::valueOf( mnCachedPages ) ) ); - maNumPagesText.SetText( aNewText ); + mpNumPagesText->SetText( aNewText ); // if layout is already established the refresh layout of // preview controls since text length may have changes @@ -1798,8 +1287,8 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache ) setPreviewText( mnCurPage ); - maPageEdit.SetMin( 1 ); - maPageEdit.SetMax( nPages ); + mpPageEdit->SetMin( 1 ); + mpPageEdit->SetMax( nPages ); if( i_bNewPage ) { @@ -1818,16 +1307,16 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache ) } Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ); - maPreviewWindow.setPreview( aMtf, aCurPageSize, + mpPreviewWindow->setPreview( aMtf, aCurPageSize, aPrt->GetPaperName( false ), nPages > 0 ? rtl::OUString() : maNoPageStr, aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(), aPrt->GetPrinterOptions().IsConvertToGreyscales() ); - maForwardBtn.Enable( mnCurPage < nPages-1 ); - maBackwardBtn.Enable( mnCurPage != 0 ); - maPageEdit.Enable( nPages > 1 ); + mpForwardBtn->Enable( mnCurPage < nPages-1 ); + mpBackwardBtn->Enable( mnCurPage != 0 ); + mpPageEdit->Enable( nPages > 1 ); } } @@ -1848,11 +1337,11 @@ Size PrintDialog::getJobPageSize() void PrintDialog::updateNupFromPages() { - long nPages = long(maNUpPage.maNupPagesBox.GetEntryData(maNUpPage.maNupPagesBox.GetSelectEntryPos())); - int nRows = int(maNUpPage.maNupRowsEdt.GetValue()); - int nCols = int(maNUpPage.maNupColEdt.GetValue()); - long nPageMargin = long(maNUpPage.maPageMarginEdt.Denormalize(maNUpPage.maPageMarginEdt.GetValue( FUNIT_100TH_MM ))); - long nSheetMargin = long(maNUpPage.maSheetMarginEdt.Denormalize(maNUpPage.maSheetMarginEdt.GetValue( FUNIT_100TH_MM ))); + long nPages = long(maNUpPage.mpNupPagesBox->GetEntryData(maNUpPage.mpNupPagesBox->GetSelectEntryPos())); + int nRows = int(maNUpPage.mpNupRowsEdt->GetValue()); + int nCols = int(maNUpPage.mpNupColEdt->GetValue()); + long nPageMargin = long(maNUpPage.mpPageMarginEdt->Denormalize(maNUpPage.mpPageMarginEdt->GetValue( FUNIT_100TH_MM ))); + long nSheetMargin = long(maNUpPage.mpSheetMarginEdt->Denormalize(maNUpPage.mpSheetMarginEdt->GetValue( FUNIT_100TH_MM ))); bool bCustom = false; if( nPages == 1 ) @@ -1904,8 +1393,8 @@ void PrintDialog::updateNupFromPages() if( nSheetMargin > nVertMax ) nSheetMargin = nVertMax; - maNUpPage.maSheetMarginEdt.SetMax( - maNUpPage.maSheetMarginEdt.Normalize( + maNUpPage.mpSheetMarginEdt->SetMax( + maNUpPage.mpSheetMarginEdt->Normalize( nHorzMax > nVertMax ? nVertMax : nHorzMax ), FUNIT_100TH_MM ); // maximum page distance @@ -1921,39 +1410,27 @@ void PrintDialog::updateNupFromPages() if( nPageMargin > nVertMax ) nPageMargin = nVertMax; - maNUpPage.maPageMarginEdt.SetMax( - maNUpPage.maSheetMarginEdt.Normalize( + maNUpPage.mpPageMarginEdt->SetMax( + maNUpPage.mpSheetMarginEdt->Normalize( nHorzMax > nVertMax ? nVertMax : nHorzMax ), FUNIT_100TH_MM ); } - maNUpPage.maNupRowsEdt.SetValue( nRows ); - maNUpPage.maNupColEdt.SetValue( nCols ); - maNUpPage.maPageMarginEdt.SetValue( maNUpPage.maPageMarginEdt.Normalize( nPageMargin ), FUNIT_100TH_MM ); - maNUpPage.maSheetMarginEdt.SetValue( maNUpPage.maSheetMarginEdt.Normalize( nSheetMargin ), FUNIT_100TH_MM ); + maNUpPage.mpNupRowsEdt->SetValue( nRows ); + maNUpPage.mpNupColEdt->SetValue( nCols ); + maNUpPage.mpPageMarginEdt->SetValue( maNUpPage.mpPageMarginEdt->Normalize( nPageMargin ), FUNIT_100TH_MM ); + maNUpPage.mpSheetMarginEdt->SetValue( maNUpPage.mpSheetMarginEdt->Normalize( nSheetMargin ), FUNIT_100TH_MM ); maNUpPage.showAdvancedControls( bCustom ); - if( bCustom ) - { - // see if we have to enlarge the dialog to make the tab page fit - Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) ); - Size aTabSize( maTabCtrl.GetTabPageSizePixel() ); - if( aTabSize.Height() < aCurSize.Height() ) - { - Size aDlgSize( GetSizePixel() ); - aDlgSize.Height() += aCurSize.Height() - aTabSize.Height(); - SetSizePixel( aDlgSize ); - } - } updateNup(); } void PrintDialog::updateNup() { - int nRows = int(maNUpPage.maNupRowsEdt.GetValue()); - int nCols = int(maNUpPage.maNupColEdt.GetValue()); - long nPageMargin = long(maNUpPage.maPageMarginEdt.Denormalize(maNUpPage.maPageMarginEdt.GetValue( FUNIT_100TH_MM ))); - long nSheetMargin = long(maNUpPage.maSheetMarginEdt.Denormalize(maNUpPage.maSheetMarginEdt.GetValue( FUNIT_100TH_MM ))); + int nRows = int(maNUpPage.mpNupRowsEdt->GetValue()); + int nCols = int(maNUpPage.mpNupColEdt->GetValue()); + long nPageMargin = long(maNUpPage.mpPageMarginEdt->Denormalize(maNUpPage.mpPageMarginEdt->GetValue( FUNIT_100TH_MM ))); + long nSheetMargin = long(maNUpPage.mpSheetMarginEdt->Denormalize(maNUpPage.mpSheetMarginEdt->GetValue( FUNIT_100TH_MM ))); PrinterController::MultiPageSetup aMPS; aMPS.nRows = nRows; @@ -1967,10 +1444,10 @@ void PrintDialog::updateNup() aMPS.nHorizontalSpacing = aMPS.nVerticalSpacing = nPageMargin; - aMPS.bDrawBorder = maNUpPage.maBorderCB.IsChecked(); + aMPS.bDrawBorder = maNUpPage.mpBorderCB->IsChecked(); - int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData( - maNUpPage.maNupOrderBox.GetSelectEntryPos() ))); + int nOrderMode = int(sal_IntPtr(maNUpPage.mpNupOrderBox->GetEntryData( + maNUpPage.mpNupOrderBox->GetSelectEntryPos() ))); if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB ) aMPS.nOrder = PrinterController::LRTB; else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR ) @@ -1980,8 +1457,8 @@ void PrintDialog::updateNup() else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL ) aMPS.nOrder = PrinterController::TBRL; - int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData( - maNUpPage.maNupOrientationBox.GetSelectEntryPos() ))); + int nOrientationMode = int(sal_IntPtr(maNUpPage.mpNupOrientationBox->GetEntryData( + maNUpPage.mpNupOrientationBox->GetSelectEntryPos() ))); if( nOrientationMode == SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE ) aMPS.aPaperSize = maNupLandscapeSize; else if( nOrientationMode == SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT ) @@ -2001,31 +1478,31 @@ void PrintDialog::updateNup() maPController->setMultipage( aMPS ); - maNUpPage.maNupOrderWin.setValues( nOrderMode, nCols, nRows ); + maNUpPage.mpNupOrderWin->setValues( nOrderMode, nCols, nRows ); preparePreview( true, true ); } IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) { - if( pBox == &maJobPage.maPrinters ) + if( pBox == maJobPage.mpPrinters ) { String aNewPrinter( pBox->GetSelectEntry() ); // set new printer maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aNewPrinter ) ) ); - maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); + maPController->resetPrinterOptions( maOptionsPage.mpToFileBox->IsChecked() ); // update text fields updatePrinterText(); preparePreview( true, false ); } - else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox ) + else if( pBox == maNUpPage.mpNupOrientationBox || pBox == maNUpPage.mpNupOrderBox ) { updateNup(); } - else if( pBox == &maNUpPage.maNupPagesBox ) + else if( pBox == maNUpPage.mpNupPagesBox ) { - if( !maNUpPage.maPagesBtn.IsChecked() ) - maNUpPage.maPagesBtn.Check(); + if( !maNUpPage.mpPagesBtn->IsChecked() ) + maNUpPage.mpPagesBtn->Check(); updateNupFromPages(); } @@ -2034,41 +1511,40 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) { - if( pButton == &maOKButton || pButton == &maCancelButton ) + if( pButton == mpOKButton || pButton == mpCancelButton ) { storeToSettings(); - EndDialog( pButton == &maOKButton ); + EndDialog( pButton == mpOKButton ); } - else if( pButton == &maHelpButton ) + else if( pButton == mpHelpButton ) { // start help system Help* pHelp = Application::GetHelp(); if( pHelp ) { - pHelp->Start( rtl::OUString( ".HelpID:vcl:PrintDialog:OK" ), &maOKButton ); + pHelp->Start( rtl::OUString("vcl/ui/printdialog"), mpOKButton ); } } - else if( pButton == &maForwardBtn ) + else if( pButton == mpForwardBtn ) { previewForward(); } - else if( pButton == &maBackwardBtn ) + else if( pButton == mpBackwardBtn ) { previewBackward(); } - else if( pButton == &maOptionsPage.maToFileBox ) + else if( pButton == maOptionsPage.mpToFileBox ) { - maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); - maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); - getLayout()->resize(); + mpOKButton->SetText( maOptionsPage.mpToFileBox->IsChecked() ? maPrintToFileText : maPrintText ); + maPController->resetPrinterOptions( maOptionsPage.mpToFileBox->IsChecked() ); preparePreview( true, true ); } - else if( pButton == &maNUpPage.maBrochureBtn ) + else if( pButton == maNUpPage.mpBrochureBtn ) { PropertyValue* pVal = getValueForWindow( pButton ); if( pVal ) { - sal_Bool bVal = maNUpPage.maBrochureBtn.IsChecked(); + sal_Bool bVal = maNUpPage.mpBrochureBtn->IsChecked(); pVal->Value <<= bVal; checkOptionalControlDependencies(); @@ -2076,71 +1552,40 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) // update preview and page settings preparePreview(); } - if( maNUpPage.maBrochureBtn.IsChecked() ) + if( maNUpPage.mpBrochureBtn->IsChecked() ) { - maNUpPage.maNupPagesBox.SelectEntryPos( 0 ); + maNUpPage.mpNupPagesBox->SelectEntryPos( 0 ); updateNupFromPages(); maNUpPage.showAdvancedControls( false ); maNUpPage.enableNupControls( false ); } } - else if( pButton == &maNUpPage.maPagesBtn ) + else if( pButton == maNUpPage.mpPagesBtn ) { maNUpPage.enableNupControls( true ); updateNupFromPages(); } - else if( pButton == &maJobPage.maDetailsBtn ) - { - bool bShow = maJobPage.maDetailsBtn.IsChecked(); - maJobPage.mxDetails->show( bShow ); - if( bShow ) - { - maDetailsCollapsedSize = GetOutputSizePixel(); - // enlarge dialog if necessary - Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) ); - Size aCurSize( maJobPage.GetSizePixel() ); - if( aCurSize.Height() < aMinSize.Height() ) - { - Size aDlgSize( GetOutputSizePixel() ); - aDlgSize.Height() += aMinSize.Height() - aCurSize.Height(); - SetOutputSizePixel( aDlgSize ); - } - maDetailsExpandedSize = GetOutputSizePixel(); - } - else if( maDetailsCollapsedSize.Width() > 0 && - maDetailsCollapsedSize.Height() > 0 ) - { - // if the user did not resize the dialog - // make it smaller again on collapsing the details - Size aDlgSize( GetOutputSizePixel() ); - if( aDlgSize == maDetailsExpandedSize && - aDlgSize.Height() > maDetailsCollapsedSize.Height() ) - { - SetOutputSizePixel( maDetailsCollapsedSize ); - } - } - } - else if( pButton == &maJobPage.maCollateBox ) + else if( pButton == maJobPage.mpCollateBox ) { maPController->setValue( rtl::OUString( "Collate" ), makeAny( sal_Bool(isCollate()) ) ); checkControlDependencies(); } - else if( pButton == &maJobPage.maReverseOrderBox ) + else if( pButton == maJobPage.mpReverseOrderBox ) { - sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked(); + sal_Bool bChecked = maJobPage.mpReverseOrderBox->IsChecked(); maPController->setReversePrint( bChecked ); maPController->setValue( rtl::OUString( "PrintReverse" ), makeAny( bChecked ) ); preparePreview( true, true ); } - else if( pButton == &maNUpPage.maBorderCB ) + else if( pButton == maNUpPage.mpBorderCB ) { updateNup(); } else { - if( pButton == &maJobPage.maSetupButton ) + if( pButton == maJobPage.mpSetupButton ) { maPController->setupPrinter( this ); preparePreview( true, true ); @@ -2153,21 +1598,21 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) IMPL_LINK( PrintDialog, ModifyHdl, Edit*, pEdit ) { checkControlDependencies(); - if( pEdit == &maNUpPage.maNupRowsEdt || pEdit == &maNUpPage.maNupColEdt || - pEdit == &maNUpPage.maSheetMarginEdt || pEdit == &maNUpPage.maPageMarginEdt + if( pEdit == maNUpPage.mpNupRowsEdt || pEdit == maNUpPage.mpNupColEdt || + pEdit == maNUpPage.mpSheetMarginEdt || pEdit == maNUpPage.mpPageMarginEdt ) { updateNupFromPages(); } - else if( pEdit == &maPageEdit ) + else if( pEdit == mpPageEdit ) { - mnCurPage = sal_Int32( maPageEdit.GetValue() - 1 ); + mnCurPage = sal_Int32( mpPageEdit->GetValue() - 1 ); preparePreview( true, true ); } - else if( pEdit == &maJobPage.maCopyCountField ) + else if( pEdit == maJobPage.mpCopyCountField ) { maPController->setValue( rtl::OUString( "CopyCount" ), - makeAny( sal_Int32(maJobPage.maCopyCountField.GetValue()) ) ); + makeAny( sal_Int32(maJobPage.mpCopyCountField->GetValue()) ) ); maPController->setValue( rtl::OUString( "Collate" ), makeAny( sal_Bool(isCollate()) ) ); } @@ -2219,9 +1664,9 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty ) { // EVIL special case if( bVal ) - maNUpPage.maBrochureBtn.Check(); + maNUpPage.mpBrochureBtn->Check(); else - maNUpPage.maPagesBtn.Check(); + maNUpPage.mpPagesBtn->Check(); } else { @@ -2362,10 +1807,6 @@ void PrintDialog::Command( const CommandEvent& rEvt ) previewForward(); else if( pWheelData->GetDelta() < 0 ) previewBackward(); - /* - else - huh ? - */ } } @@ -2375,18 +1816,17 @@ void PrintDialog::Resize() // and do the preview; however the metafile does not need to be gotten anew preparePreview( false ); - // do an invalidate for the benefit of the grouping elements - Invalidate(); + Dialog::Resize(); } void PrintDialog::previewForward() { - maPageEdit.Up(); + mpPageEdit->Up(); } void PrintDialog::previewBackward() { - maPageEdit.Down(); + mpPageEdit->Down(); } // ----------------------------------------------------------------------------- diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index 8d5baf81b5ee..9daace2db461 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -220,6 +220,7 @@ bool TabPage::isLayoutEnabled() const Size TabPage::GetOptimalSize(WindowSizeType eType) const { + fprintf(stderr, "asked for optimalsize of tabpage %p (%d) vis is %d\n", this, isLayoutEnabled(), IsVisible()); if (eType == WINDOWSIZE_MAXIMUM) return Window::GetOptimalSize(eType); Size aSize; diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui new file mode 100644 index 000000000000..26a2fadc5615 --- /dev/null +++ b/vcl/uiconfig/ui/printdialog.ui @@ -0,0 +1,1572 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">16384</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="lower">1</property> + <property name="upper">32</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment3"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkDialog" id="PrintDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="vcllo:PrintPreviewWindow" id="preview"> + <property name="width_request">235</property> + <property name="height_request">331</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">30</property> + <property name="margin_right">30</property> + <property name="spacing">5</property> + <child> + <object class="GtkSpinButton" id="pageedit-nospin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="totalnumpages"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">/ %n</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="forward"> + <property name="label">gtk-media-next</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="backward"> + <property name="label">gtk-media-previous</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <object class="GtkExpander" id="expander1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> + <property name="row_spacing">5</property> + <property name="column_spacing">7</property> + <child> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Status:</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Location:</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Comment:</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="status"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Default printer</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="location"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Place</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="comment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Long printer name</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Details</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="setup"> + <property name="label" translatable="yes">Properties...</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">end</property> + <property name="valign">start</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkTreeView" id="printers"> + <property name="height_request">100</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection"/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Printer</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="printrange"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">7</property> + <child> + <object class="GtkSeparator" id="copyspacer"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box15"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox" id="box6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_right">7</property> + <property name="label" translatable="yes">Number of copies</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="copycount"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box14"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">center</property> + <child> + <object class="GtkCheckButton" id="collate"> + <property name="label" translatable="yes">Collate</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="margin_right">7</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="collateimage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-missing-image</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox" id="box16"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">6</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="printallsheets"> + <property name="label" translatable="yes">All sheets</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">printselectedsheets</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="printselectedsheets"> + <property name="label" translatable="yes">Selected sheets</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">printselectedcells</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="printselectedcells"> + <property name="label" translatable="yes">Selected cells</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">printallsheets</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="fromwhich"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">From which print</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box12"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">6</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkRadioButton" id="printallpages"> + <property name="label" translatable="yes">All pages</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">printpages</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box13"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkRadioButton" id="printpages"> + <property name="label" translatable="yes">Pages</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">printselection</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="pagerange"> + <property name="can_focus">True</property> + <property name="no_show_all">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="printselection"> + <property name="label" translatable="yes">Selection</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">printallpages</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="reverseorder"> + <property name="label" translatable="yes">Print in reverse page order</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Range and copies</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="extrawriterprintoptions"> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">7</property> + <child> + <object class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Comments</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="writercomments"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Print</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="extraimpressprintoptions"> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">3</property> + <child> + <object class="GtkBox" id="box17"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">7</property> + <child> + <object class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Document</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="impressdocument"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box18"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">7</property> + <child> + <object class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Slides per page</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="slidesperpage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Order</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="slidesperpageorder"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Print</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="label1"> + <property name="can_focus">False</property> + <property name="label" translatable="yes">General</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox" id="customcontents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="customlabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">custom</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">7</property> + <child> + <object class="GtkComboBox" id="paperspersheetlb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="model">liststore1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box11"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkRadioButton" id="pagespersheetbtn"> + <property name="label" translatable="yes">Pages per sheet</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">brochure</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pagespersheettxt"> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="brochure"> + <property name="label" translatable="yes">Brochure</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">pagespersheetbtn</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">7</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pagestxt"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + <property name="label" translatable="yes">Pages</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sheetmargintxt1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + <property name="label" translatable="yes">Margin</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="orientationtxt"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + <property name="label" translatable="yes">Orientation</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pagemargintxt1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + <property name="label" translatable="yes">Distance</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="orientationlb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="model">liststore3</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="vcllo:ShowNupOrderWindow" id="orderpreview"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">False</property> + <property name="vexpand">False</property> + <property name="halign">center</property> + <property name="valign">start</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">8</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="pagecols"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="pagerows"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment2</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="pagemarginsb:0mm"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment3</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="sheetmarginsb:0mm"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment3</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="by"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">by</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pagemargintxt2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">between pages</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">2</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sheetmargintxt2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">to sheet border</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">3</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="bordercb"> + <property name="label" translatable="yes">Draw a border around each page</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + <property name="width">4</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="ordertxt"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">12</property> + <property name="label" translatable="yes">Order</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="orderlb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="model">liststore2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">5</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="scriptdirection"> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">7</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label18"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Layout</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="pagesides"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">7</property> + <child> + <object class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Include</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="brochureinclude"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Page sides</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Page Layout</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkCheckButton" id="printtofile"> + <property name="label" translatable="yes">Print to file</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="singleprintjob"> + <property name="label" translatable="yes">Create single print jobs for collated output</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="printpaperfromsetup"> + <property name="label" translatable="yes">Use only paper tray from printer preferences</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Options</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Options</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name gchararray1 --> + <column type="gchararray"/> + <!-- column-name gint1 --> + <column type="gint"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">1</col> + <col id="1">1</col> + </row> + <row> + <col id="0" translatable="yes">2</col> + <col id="1">2</col> + </row> + <row> + <col id="0" translatable="yes">4</col> + <col id="1">4</col> + </row> + <row> + <col id="0" translatable="yes">6</col> + <col id="1">6</col> + </row> + <row> + <col id="0" translatable="yes">9</col> + <col id="1">9</col> + </row> + <row> + <col id="0" translatable="yes">16</col> + <col id="1">16</col> + </row> + <row> + <col id="0" translatable="yes">Custom</col> + <col id="1">65535</col> + </row> + </data> + </object> + <object class="GtkListStore" id="liststore2"> + <columns> + <!-- column-name gchararray1 --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">left to right, then down</col> + </row> + <row> + <col id="0" translatable="yes">top to bottom, then right</col> + </row> + <row> + <col id="0" translatable="yes">top to bottom, then left</col> + </row> + <row> + <col id="0" translatable="yes">right to left, then down</col> + </row> + </data> + </object> + <object class="GtkListStore" id="liststore3"> + <columns> + <!-- column-name gchararray1 --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">Automatic</col> + </row> + <row> + <col id="0" translatable="yes">Portrait</col> + </row> + <row> + <col id="0" translatable="yes">Landscape</col> + </row> + </data> + </object> +</interface> |