summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-24 12:46:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-24 13:33:00 +0100
commit8755bef6dd4145f2eac8c18a4a7eb58c52b83d47 (patch)
tree3b3de25a0a9f113a8307813aaf67196a5f86f24a /sc
parentd05918d42a6af99758118970733cd77cb218f28e (diff)
convert SolverInteger dialog to .ui
Change-Id: Iec4b0d041ec0389630d21572d6c5658639d85b17
Diffstat (limited to 'sc')
-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.hxx13
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx19
-rw-r--r--sc/source/ui/src/solveroptions.src50
-rw-r--r--sc/uiconfig/scalc/ui/integerdialog.ui113
7 files changed, 127 insertions, 71 deletions
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 <vcl/dialog.hxx>
-
#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
-#include <vcl/field.hxx>
#include <svx/checklbx.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">2147483647</property>
+ <property name="value">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkDialog" id="IntegerDialog">
+ <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="GtkSpinButton" 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>
+ <property name="adjustment">adjustment1</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>