summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-05 11:21:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-05 11:32:18 +0000
commitab80ea279bea37f4dd919417433cfd72ca28e8bd (patch)
treeeee7c9d48a04f75cf5919634290cfa2c0656a16f
parent130833f80e89774269108cf30b2d1155a00354ce (diff)
Related: fdo#34396 convert extrusion dialog to .ui
Change-Id: Iea6e42fb7b65e148dcf6b566a7595b9e18f2e2eb
-rw-r--r--include/svx/dialogs.hrc1
-rw-r--r--svx/UIConfig_svx.mk1
-rw-r--r--svx/inc/extrusiondepthdialog.hxx7
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx20
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hrc2
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.src57
-rw-r--r--svx/uiconfig/ui/extrustiondepthdialog.ui156
7 files changed, 163 insertions, 81 deletions
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 4c3d681016f7..7c89bb7db318 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -1020,7 +1020,6 @@
// "ModalDialog" resource ids
#define RID_SVX_MDLG_FONTWORK_GALLERY ( RID_SVX_START + 2 )
-#define RID_SVX_MDLG_EXTRUSION_DEPTH ( RID_SVX_START + 3 )
// ----------------------------------------------------------------------------
// "Menu" resource ids
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index fb29eb1cf07c..76627848d540 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/compressgraphicdialog \
svx/uiconfig/ui/deleteheaderdialog \
svx/uiconfig/ui/deletefooterdialog \
+ svx/uiconfig/ui/extrustiondepthdialog \
svx/uiconfig/ui/headfootformatpage \
svx/uiconfig/ui/findreplacedialog \
svx/uiconfig/ui/linkwarndialog \
diff --git a/svx/inc/extrusiondepthdialog.hxx b/svx/inc/extrusiondepthdialog.hxx
index 30765b9838a3..43bafe56c7ef 100644
--- a/svx/inc/extrusiondepthdialog.hxx
+++ b/svx/inc/extrusiondepthdialog.hxx
@@ -31,15 +31,10 @@ namespace svx {
class ExtrusionDepthDialog : public ModalDialog
{
- FixedText maFLDepth;
- MetricField maMtrDepth;
- OKButton maOKButton;
- CancelButton maCancelButton;
- HelpButton maHelpButton;
+ MetricField* m_pMtrDepth;
public:
ExtrusionDepthDialog( Window* pParent, double fDepth, FieldUnit eDefaultUnit );
- ~ExtrusionDepthDialog();
double getDepth() const;
};
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index 9a98163f0879..8ebf54ea92e8 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -297,27 +297,17 @@ Sequence< OUString > SAL_CALL ExtrusionDirectionControl::getSupportedServiceName
// ####################################################################
ExtrusionDepthDialog::ExtrusionDepthDialog( Window* pParent, double fDepth, FieldUnit eDefaultUnit )
-: ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_EXTRUSION_DEPTH ) ),
- maFLDepth( this, SVX_RES( FL_DEPTH ) ),
- maMtrDepth( this, SVX_RES( MTR_DEPTH ) ),
- maOKButton( this, SVX_RES( BTN_OK ) ),
- maCancelButton( this, SVX_RES( BTN_CANCEL ) ),
- maHelpButton( this, SVX_RES( BTN_HELP ) )
+ : ModalDialog( pParent, "ExtrustionDepthDialog", "svx/ui/extrustiondepthdialog.ui" )
{
+ get(m_pMtrDepth, "depth");
bool bMetric = IsMetric( eDefaultUnit );
- maMtrDepth.SetUnit( bMetric ? FUNIT_CM : FUNIT_INCH );
- maMtrDepth.SetValue( (int) fDepth * 100, FUNIT_100TH_MM );
-
- FreeResource();
-}
-
-ExtrusionDepthDialog::~ExtrusionDepthDialog()
-{
+ m_pMtrDepth->SetUnit( bMetric ? FUNIT_CM : FUNIT_INCH );
+ m_pMtrDepth->SetValue( (int) fDepth * 100, FUNIT_100TH_MM );
}
double ExtrusionDepthDialog::getDepth() const
{
- return (double)( maMtrDepth.GetValue( FUNIT_100TH_MM ) ) / 100.0;
+ return (double)( m_pMtrDepth->GetValue( FUNIT_100TH_MM ) ) / 100.0;
}
// ####################################################################
diff --git a/svx/source/tbxctrls/extrusioncontrols.hrc b/svx/source/tbxctrls/extrusioncontrols.hrc
index f878df263633..6193ccadb2c5 100644
--- a/svx/source/tbxctrls/extrusioncontrols.hrc
+++ b/svx/source/tbxctrls/extrusioncontrols.hrc
@@ -80,8 +80,6 @@
#define IMG_LIGHTING_NORMAL 111
#define IMG_LIGHTING_DIM 112
-#define FL_DEPTH 1
-#define MTR_DEPTH 2
#define BTN_OK 3
#define BTN_CANCEL 4
#define BTN_HELP 5
diff --git a/svx/source/tbxctrls/extrusioncontrols.src b/svx/source/tbxctrls/extrusioncontrols.src
index 527707616a27..3600a28cc02c 100644
--- a/svx/source/tbxctrls/extrusioncontrols.src
+++ b/svx/source/tbxctrls/extrusioncontrols.src
@@ -430,63 +430,6 @@ DockingWindow RID_SVXFLOAT_EXTRUSION_SURFACE
};
};
-#define WIDTH 140
-#define HEIGHT (4 * 3 + 3 * 14)
-
-ModalDialog RID_SVX_MDLG_EXTRUSION_DEPTH
-{
- HelpID = "svx:ModalDialog:RID_SVX_MDLG_EXTRUSION_DEPTH";
- OutputSize = TRUE;
- SVLook = TRUE ;
- Moveable = TRUE;
- Closeable = TRUE;
-
- Size = MAP_APPFONT( WIDTH, HEIGHT );
-
- Text [ en-US ] = "Extrusion Depth" ;
-
- FixedText FL_DEPTH
- {
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( WIDTH - 50 - 12 , 8 ) ;
- Text [ en-US ] = "~Value" ;
- };
- MetricField MTR_DEPTH
- {
- Border = FALSE ;
- Pos = MAP_APPFONT ( 3 , 14 ) ;
- Size = MAP_APPFONT ( WIDTH - 50 - 12, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 338666 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- OkButton BTN_OK
- {
- Pos = MAP_APPFONT ( WIDTH - 50 - 3 , 1 * 3 + 0 * 14 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- DefButton = TRUE ;
- TabStop = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( WIDTH - 50 - 3 , 2 * 3 + 1 * 14 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( WIDTH - 50 - 3 , 3 * 3 + 2 * 14 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
String RID_SVXSTR_EXTRUSION_COLOR
{
Text [ en-US ] = "Extrusion Color";
diff --git a/svx/uiconfig/ui/extrustiondepthdialog.ui b/svx/uiconfig/ui/extrustiondepthdialog.ui
new file mode 100644
index 000000000000..593c1a95484c
--- /dev/null
+++ b/svx/uiconfig/ui/extrustiondepthdialog.ui
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">338.666</property>
+ <property name="step_increment">0.10000000000000001</property>
+ <property name="page_increment">1</property>
+ </object>
+ <object class="GtkDialog" id="ExtrustionDepthDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Extrusion Depth</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">12</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="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</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="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</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="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</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="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</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="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkSpinButton" id="depth:0.00cm">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">adjustment1</property>
+ <property name="digits">2</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="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Value</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">depth:0.00cm</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>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Depth</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</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>
+</interface>