From ab80ea279bea37f4dd919417433cfd72ca28e8bd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 5 Dec 2013 11:21:02 +0000 Subject: Related: fdo#34396 convert extrusion dialog to .ui Change-Id: Iea6e42fb7b65e148dcf6b566a7595b9e18f2e2eb --- include/svx/dialogs.hrc | 1 - svx/UIConfig_svx.mk | 1 + svx/inc/extrusiondepthdialog.hxx | 7 +- svx/source/tbxctrls/extrusioncontrols.cxx | 20 +--- svx/source/tbxctrls/extrusioncontrols.hrc | 2 - svx/source/tbxctrls/extrusioncontrols.src | 57 ----------- svx/uiconfig/ui/extrustiondepthdialog.ui | 156 ++++++++++++++++++++++++++++++ 7 files changed, 163 insertions(+), 81 deletions(-) create mode 100644 svx/uiconfig/ui/extrustiondepthdialog.ui 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 @@ + + + + + 338.666 + 0.10000000000000001 + 1 + + + False + 6 + Extrusion Depth + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + 12 + + + True + True + + adjustment1 + 2 + + + 1 + 0 + 1 + 1 + + + + + True + False + _Value + True + depth:0.00cm + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Depth + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit v1.2.3