summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-24 14:09:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-24 14:12:42 +0100
commit57ebd448497ec357aa348f5df90a52e8d58b4bb6 (patch)
treef1b60abd886326452467e627592ebd2c8592032b
parentf61e82eb3b46a6ff7312dfc8ebacee73658f23ad (diff)
convert SolverDouble dialog to .ui
Change-Id: I996038a45495a5b6a63622ac0d290ac4fbc0bedd
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/helpids.h1
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/source/ui/inc/solveroptions.hxx9
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx25
-rw-r--r--sc/source/ui/src/solveroptions.src43
-rw-r--r--sc/uiconfig/scalc/ui/doubledialog.ui106
7 files changed, 116 insertions, 70 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 29893fe913fa..6ec6ee42eb21 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -71,6 +71,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/deletecells \
sc/uiconfig/scalc/ui/deletecontents \
sc/uiconfig/scalc/ui/descriptivestatisticsdialog \
+ sc/uiconfig/scalc/ui/doubledialog \
sc/uiconfig/scalc/ui/erroralerttabpage \
sc/uiconfig/scalc/ui/externaldata \
sc/uiconfig/scalc/ui/filldlg \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 126eba6513bf..f772fc779c96 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_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"
#define HID_SC_SOLVER_SUCCESS "SC_HID_SC_SOLVER_SUCCESS"
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index a8ad8ebc6391..89f3898b8430 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_DOUBLE (SC_DIALOGS_START + 141)
#define RID_SCDLG_SOLVER_PROGRESS (SC_DIALOGS_START + 142)
#define RID_SCDLG_SOLVER_NOSOLUTION (SC_DIALOGS_START + 143)
#define RID_SCDLG_SOLVER_SUCCESS (SC_DIALOGS_START + 144)
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx
index 9dbde596589f..5ce5ec774571 100644
--- a/sc/source/ui/inc/solveroptions.hxx
+++ b/sc/source/ui/inc/solveroptions.hxx
@@ -82,7 +82,6 @@ class ScSolverIntegerDialog : public ModalDialog
public:
ScSolverIntegerDialog( Window * pParent );
- ~ScSolverIntegerDialog();
void SetOptionName( const OUString& rName );
void SetValue( sal_Int32 nValue );
@@ -91,15 +90,11 @@ public:
class ScSolverValueDialog : public ModalDialog
{
- FixedText maFtName;
- Edit maEdValue;
- FixedLine maFlButtons;
- OKButton maBtnOk;
- CancelButton maBtnCancel;
+ VclFrame* m_pFrame;
+ Edit* m_pEdValue;
public:
ScSolverValueDialog( Window * pParent );
- ~ScSolverValueDialog();
void SetOptionName( const OUString& rName );
void SetValue( double fValue );
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 479f3a4501ab..256f33428447 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -409,10 +409,6 @@ ScSolverIntegerDialog::ScSolverIntegerDialog(Window * pParent)
get(m_pNfValue, "value");
}
-ScSolverIntegerDialog::~ScSolverIntegerDialog()
-{
-}
-
void ScSolverIntegerDialog::SetOptionName( const OUString& rName )
{
m_pFrame->set_label(rName);
@@ -436,35 +432,28 @@ sal_Int32 ScSolverIntegerDialog::GetValue() const
//------------------------------------------------------------------
ScSolverValueDialog::ScSolverValueDialog( Window * pParent )
- : ModalDialog( pParent, ScResId( RID_SCDLG_SOLVER_DOUBLE ) ),
- maFtName ( this, ScResId( FT_OPTIONNAME ) ),
- maEdValue ( this, ScResId( ED_VALUE ) ),
- maFlButtons ( this, ScResId( FL_BUTTONS ) ),
- maBtnOk ( this, ScResId( BTN_OK ) ),
- maBtnCancel ( this, ScResId( BTN_CANCEL ) )
-{
- FreeResource();
-}
-
-ScSolverValueDialog::~ScSolverValueDialog()
+ : ModalDialog( pParent, "DoubleDialog",
+ "modules/scalc/ui/doubledialog.ui" )
{
+ get(m_pFrame, "frame");
+ get(m_pEdValue, "value");
}
void ScSolverValueDialog::SetOptionName( const OUString& rName )
{
- maFtName.SetText( rName );
+ m_pFrame->set_label(rName);
}
void ScSolverValueDialog::SetValue( double fValue )
{
- maEdValue.SetText( rtl::math::doubleToUString( fValue,
+ m_pEdValue->SetText( rtl::math::doubleToUString( fValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ) );
}
double ScSolverValueDialog::GetValue() const
{
- OUString aInput = maEdValue.GetText();
+ OUString aInput = m_pEdValue->GetText();
const LocaleDataWrapper* pLocaleData = ScGlobal::GetpLocaleData();
rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
diff --git a/sc/source/ui/src/solveroptions.src b/sc/source/ui/src/solveroptions.src
index 8f7bb13214a0..ae825a49fcc9 100644
--- a/sc/source/ui/src/solveroptions.src
+++ b/sc/source/ui/src/solveroptions.src
@@ -89,47 +89,4 @@ ModalDialog RID_SCDLG_SOLVEROPTIONS
Text [ en-US ] = "Options" ;
};
-ModalDialog RID_SCDLG_SOLVER_DOUBLE
-{
- OutputSize = TRUE ;
- HelpId = HID_SC_SOLVER_DOUBLE ;
- 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
- };
- Edit ED_VALUE
- {
- HelpID = "sc:Edit:RID_SCDLG_SOLVER_DOUBLE:ED_VALUE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 27 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- };
- 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" ;
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/doubledialog.ui b/sc/uiconfig/scalc/ui/doubledialog.ui
new file mode 100644
index 000000000000..39ac15ecf0e9
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/doubledialog.ui
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="DoubleDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Edit Setting</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">start</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>
+ <property name="secondary">True</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>
+ <property name="secondary">True</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="frame">
+ <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="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkEntry" id="value">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">start</property>
+ <property name="valign">start</property>
+ <property name="invisible_char">•</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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-widgets>
+ </object>
+</interface>