summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-10 16:59:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:44 +0100
commit87b5cdd5ed13f5d05fe90b11b01e3832e5725b72 (patch)
tree3ce67b9dd7f1c9378a09b0d55bafb8d416f7d894 /starmath
parent644cb58ac6ea53abab37c61e49d047eab0a1735c (diff)
convert writer, draw, impress, calc and starmath printer dialogs
to new-style widget layout mostly described in .ui format Change-Id: I8ead53a246a8ac3e2d446d158f06d7e2e436ce60
Diffstat (limited to 'starmath')
-rw-r--r--starmath/Module_starmath.mk1
-rw-r--r--starmath/UI_smath.mk16
-rw-r--r--starmath/source/unomodel.cxx39
-rw-r--r--starmath/uiconfig/smath/ui/printeroptions.ui210
4 files changed, 252 insertions, 14 deletions
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>