From 8755bef6dd4145f2eac8c18a4a7eb58c52b83d47 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 24 Oct 2013 12:46:27 +0100 Subject: convert SolverInteger dialog to .ui Change-Id: Iec4b0d041ec0389630d21572d6c5658639d85b17 --- sc/UIConfig_scalc.mk | 1 + sc/inc/helpids.h | 1 - sc/inc/sc.hrc | 1 - sc/source/ui/inc/solveroptions.hxx | 13 ++-- sc/source/ui/miscdlgs/solveroptions.cxx | 19 +++--- sc/source/ui/src/solveroptions.src | 50 -------------- sc/uiconfig/scalc/ui/integerdialog.ui | 113 ++++++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+), 71 deletions(-) create mode 100644 sc/uiconfig/scalc/ui/integerdialog.ui diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 2bbaf3a5d0c7..29893fe913fa 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -86,6 +86,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/insertcells \ sc/uiconfig/scalc/ui/insertname \ sc/uiconfig/scalc/ui/insertsheet \ + sc/uiconfig/scalc/ui/integerdialog \ sc/uiconfig/scalc/ui/leftfooterdialog \ sc/uiconfig/scalc/ui/leftheaderdialog \ sc/uiconfig/scalc/ui/namerangesdialog \ diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index b7856b2e65ed..126eba6513bf 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -170,7 +170,6 @@ #define HID_SC_SOLVEROPTIONS "SC_HID_SC_SOLVEROPTIONS" #define HID_SC_SOLVEROPTIONS_LB "SC_HID_SC_SOLVEROPTIONS_LB" -#define HID_SC_SOLVER_INTEGER "SC_HID_SC_SOLVER_INTEGER" #define HID_SC_SOLVER_DOUBLE "SC_HID_SC_SOLVER_DOUBLE" #define HID_SC_SOLVER_PROGRESS "SC_HID_SC_SOLVER_PROGRESS" #define HID_SC_SOLVER_NOSOLUTION "SC_HID_SC_SOLVER_NOSOLUTION" diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 7e945b6685ee..a8ad8ebc6391 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1090,7 +1090,6 @@ #define RID_SCDLG_DPSHOWDETAIL (SC_DIALOGS_START + 137) #define RID_SCDLG_SOLVEROPTIONS (SC_DIALOGS_START + 139) -#define RID_SCDLG_SOLVER_INTEGER (SC_DIALOGS_START + 140) #define RID_SCDLG_SOLVER_DOUBLE (SC_DIALOGS_START + 141) #define RID_SCDLG_SOLVER_PROGRESS (SC_DIALOGS_START + 142) #define RID_SCDLG_SOLVER_NOSOLUTION (SC_DIALOGS_START + 143) diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx index b632b47f94d3..9dbde596589f 100644 --- a/sc/source/ui/inc/solveroptions.hxx +++ b/sc/source/ui/inc/solveroptions.hxx @@ -20,12 +20,12 @@ #ifndef SC_SOLVEROPTIONS_HXX #define SC_SOLVEROPTIONS_HXX -#include - #include +#include +#include #include +#include #include -#include #include #include @@ -77,11 +77,8 @@ public: class ScSolverIntegerDialog : public ModalDialog { - FixedText maFtName; - NumericField maNfValue; - FixedLine maFlButtons; - OKButton maBtnOk; - CancelButton maBtnCancel; + VclFrame* m_pFrame; + NumericField* m_pNfValue; public: ScSolverIntegerDialog( Window * pParent ); diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 6488c7b46261..479f3a4501ab 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -401,15 +401,12 @@ IMPL_LINK_NOARG(ScSolverOptionsDialog, SettingsSelHdl) //------------------------------------------------------------------ -ScSolverIntegerDialog::ScSolverIntegerDialog( Window * pParent ) - : ModalDialog( pParent, ScResId( RID_SCDLG_SOLVER_INTEGER ) ), - maFtName ( this, ScResId( FT_OPTIONNAME ) ), - maNfValue ( this, ScResId( NF_VALUE ) ), - maFlButtons ( this, ScResId( FL_BUTTONS ) ), - maBtnOk ( this, ScResId( BTN_OK ) ), - maBtnCancel ( this, ScResId( BTN_CANCEL ) ) +ScSolverIntegerDialog::ScSolverIntegerDialog(Window * pParent) + : ModalDialog( pParent, "IntegerDialog", + "modules/scalc/ui/integerdialog.ui" ) { - FreeResource(); + get(m_pFrame, "frame"); + get(m_pNfValue, "value"); } ScSolverIntegerDialog::~ScSolverIntegerDialog() @@ -418,17 +415,17 @@ ScSolverIntegerDialog::~ScSolverIntegerDialog() void ScSolverIntegerDialog::SetOptionName( const OUString& rName ) { - maFtName.SetText( rName ); + m_pFrame->set_label(rName); } void ScSolverIntegerDialog::SetValue( sal_Int32 nValue ) { - maNfValue.SetValue( nValue ); + m_pNfValue->SetValue( nValue ); } sal_Int32 ScSolverIntegerDialog::GetValue() const { - sal_Int64 nValue = maNfValue.GetValue(); + sal_Int64 nValue = m_pNfValue->GetValue(); if ( nValue < SAL_MIN_INT32 ) return SAL_MIN_INT32; if ( nValue > SAL_MAX_INT32 ) diff --git a/sc/source/ui/src/solveroptions.src b/sc/source/ui/src/solveroptions.src index 0d7499860d25..8f7bb13214a0 100644 --- a/sc/source/ui/src/solveroptions.src +++ b/sc/source/ui/src/solveroptions.src @@ -89,56 +89,6 @@ ModalDialog RID_SCDLG_SOLVEROPTIONS Text [ en-US ] = "Options" ; }; -ModalDialog RID_SCDLG_SOLVER_INTEGER -{ - OutputSize = TRUE ; - HelpId = HID_SC_SOLVER_INTEGER ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 118 , 76 ) ; - Moveable = TRUE ; - FixedText FT_OPTIONNAME - { - Pos = MAP_APPFONT ( 6 , 8 ) ; - Size = MAP_APPFONT ( 106 , 16 ) ; - WordBreak = TRUE ; - // text is dynamic - }; - NumericField NF_VALUE - { - HelpID = "sc:NumericField:RID_SCDLG_SOLVER_INTEGER:NF_VALUE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 27 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - SpinSize = 1 ; - Repeat = TRUE ; - Minimum = -2147483648 ; - Maximum = 2147483647 ; - First = 0 ; - Last = 100 ; - }; - FixedLine FL_BUTTONS - { - Pos = MAP_APPFONT ( 0 , 45 ) ; - Size = MAP_APPFONT ( 118 , 8 ) ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 6 , 56 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 62 , 56 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - Text [ en-US ] = "Edit Setting" ; -}; - ModalDialog RID_SCDLG_SOLVER_DOUBLE { OutputSize = TRUE ; diff --git a/sc/uiconfig/scalc/ui/integerdialog.ui b/sc/uiconfig/scalc/ui/integerdialog.ui new file mode 100644 index 000000000000..dece80aa2156 --- /dev/null +++ b/sc/uiconfig/scalc/ui/integerdialog.ui @@ -0,0 +1,113 @@ + + + + + 2147483647 + 100 + 1 + 10 + + + False + 6 + Edit Setting + dialog + + + False + vertical + 12 + + + False + start + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + True + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + True + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + 6 + 12 + + + True + True + start + start + + adjustment1 + + + + + + + True + False + + + + + + + + False + True + 1 + + + + + + ok + cancel + + + -- cgit