Kaydet (Commit) 73e7db91 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ScSolverDlg

Change-Id: I35fa2f63eb47f18289892ffcf042d041752bfbd7
Reviewed-on: https://gerrit.libreoffice.org/70653
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst dd5fbb68
......@@ -46,7 +46,7 @@
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDefDlgWrapper)
DECL_WRAPPER_WITHID(ScSolverDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScXMLSourceDlgWrapper)
DECL_WRAPPER_WITHID(ScPivotLayoutWrapper)
......
......@@ -33,54 +33,59 @@ enum ScSolverErr
SOLVERR_INVALID_TARGETVALUE
};
class ScSolverDlg : public ScAnyRefDlg
class ScSolverDlg : public ScAnyRefDlgController
{
public:
ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScDocument* pDocument,
const ScAddress& aCursorPos );
virtual ~ScSolverDlg() override;
virtual void dispose() override;
ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
ScDocument* pDocument,
const ScAddress& aCursorPos );
virtual ~ScSolverDlg() override;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
virtual bool IsRefInputMode() const override;
virtual void SetActive() override;
virtual bool Close() override;
virtual void Close() override;
private:
VclPtr<FixedText> m_pFtFormulaCell;
VclPtr<formula::RefEdit> m_pEdFormulaCell;
VclPtr<formula::RefButton> m_pRBFormulaCell;
VclPtr<Edit> m_pEdTargetVal;
VclPtr<FixedText> m_pFtVariableCell;
VclPtr<formula::RefEdit> m_pEdVariableCell;
VclPtr<formula::RefButton> m_pRBVariableCell;
VclPtr<OKButton> m_pBtnOk;
VclPtr<CancelButton> m_pBtnCancel;
ScAddress theFormulaCell;
ScAddress theVariableCell;
OUString theTargetValStr;
ScDocument* pDoc;
const SCTAB nCurTab;
VclPtr<formula::RefEdit> pEdActive;
bool bDlgLostFocus;
const OUString errMsgInvalidVar;
const OUString errMsgInvalidForm;
const OUString errMsgNoFormula;
const OUString errMsgInvalidVal;
formula::WeldRefEdit* m_pEdActive;
std::unique_ptr<weld::Label> m_xFtFormulaCell;
std::unique_ptr<formula::WeldRefEdit> m_xEdFormulaCell;
std::unique_ptr<formula::WeldRefButton> m_xRBFormulaCell;
std::unique_ptr<weld::Entry> m_xEdTargetVal;
std::unique_ptr<weld::Label> m_xFtVariableCell;
std::unique_ptr<formula::WeldRefEdit> m_xEdVariableCell;
std::unique_ptr<formula::WeldRefButton> m_xRBVariableCell;
std::unique_ptr<weld::Button> m_xBtnOk;
std::unique_ptr<weld::Button> m_xBtnCancel;
void Init();
bool CheckTargetValue( const OUString& rStrVal );
void RaiseError( ScSolverErr eError );
DECL_LINK( BtnHdl, Button*, void );
DECL_LINK( GetFocusHdl, Control&, void );
DECL_LINK( LoseFocusHdl, Control&, void );
DECL_LINK( BtnHdl, weld::Button&, void );
DECL_LINK( GetEditFocusHdl, formula::WeldRefEdit&, void );
DECL_LINK( LoseEditFocusHdl, formula::WeldRefEdit&, void );
DECL_LINK( GetButtonFocusHdl, formula::WeldRefButton&, void );
DECL_LINK( LoseButtonFocusHdl, formula::WeldRefButton&, void );
DECL_LINK( GetFocusHdl, weld::Widget&, void );
};
#endif // INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX
......
......@@ -34,7 +34,7 @@
SFX_IMPL_CHILDWINDOW_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME)
SFX_IMPL_CHILDWINDOW_WITHID(ScNameDefDlgWrapper, FID_ADD_NAME )
SFX_IMPL_MODELESSDIALOG_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
SFX_IMPL_CHILDWINDOW_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
SFX_IMPL_MODELESSDIALOG_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER )
SFX_IMPL_MODELESSDIALOG_WITHID(ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE)
SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE )
......@@ -125,7 +125,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScNameDlgWrapper, FID_DEFINE_NAME )
IMPL_CONTROLLER_CHILD_CTOR( ScNameDefDlgWrapper, FID_ADD_NAME )
IMPL_CHILD_CTOR( ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
IMPL_CONTROLLER_CHILD_CTOR( ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
IMPL_CHILD_CTOR( ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER )
......
......@@ -249,16 +249,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
}
break;
case SID_OPENDLG_SOLVE:
{
ScViewData& rViewData = GetViewData();
ScAddress aCurPos( rViewData.GetCurX(),
rViewData.GetCurY(),
rViewData.GetTabNo());
pResult = VclPtr<ScSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
case SID_OPENDLG_OPTSOLVER:
{
ScViewData& rViewData = GetViewData();
......@@ -489,6 +479,15 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
case SID_DEFINE_COLROWNAMERANGES:
xResult.reset(new ScColRowNameRangesDlg(pB, pCW, pParent, &GetViewData()));
break;
case SID_OPENDLG_SOLVE:
{
ScViewData& rViewData = GetViewData();
ScAddress aCurPos( rViewData.GetCurX(),
rViewData.GetCurY(),
rViewData.GetTabNo());
xResult.reset(new ScSolverDlg(pB, pCW, pParent, rViewData.GetDocument(), aCurPos));
break;
}
}
if (xResult)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="GoalSeekDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="goalseekdlg|GoalSeekDialog">Goal Seek</property>
<property name="default_width">-1</property>
<property name="default_height">-1</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<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="orientation">vertical</property>
<property name="layout_style">start</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</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>
......@@ -34,10 +36,12 @@
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<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>
......@@ -59,6 +63,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
......@@ -136,11 +141,12 @@
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="foruilo-RefEdit" id="formulaedit">
<object class="GtkEntry" id="formulaedit">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -149,7 +155,7 @@
</packing>
</child>
<child>
<object class="foruilo-RefButton" id="formulabutton">
<object class="GtkButton" id="formulabutton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
......@@ -172,6 +178,7 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -185,11 +192,12 @@
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="foruilo-RefEdit" id="varedit">
<object class="GtkEntry" id="varedit">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -198,7 +206,7 @@
</packing>
</child>
<child>
<object class="foruilo-RefButton" id="varbutton">
<object class="GtkButton" id="varbutton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
......@@ -239,8 +247,8 @@
</object>
</child>
<action-widgets>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
<action-widget response="-5">ok</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
</object>
......
......@@ -92,6 +92,8 @@ sc/uiconfig/scalc/ui/fourieranalysisdialog.ui://GtkButton[@id='output-range-butt
sc/uiconfig/scalc/ui/functionpanel.ui://GtkComboBoxText[@id='category'] no-labelled-by
sc/uiconfig/scalc/ui/functionpanel.ui://GtkTreeView[@id='funclist:border'] no-labelled-by
sc/uiconfig/scalc/ui/functionpanel.ui://GtkLabel[@id='funcdesc:border'] orphan-label
sc/uiconfig/scalc/ui/goalseekdlg.ui://GtkButton[@id='formulabutton'] button-no-label
sc/uiconfig/scalc/ui/goalseekdlg.ui://GtkButton[@id='varbutton'] button-no-label
sc/uiconfig/scalc/ui/groupbydate.ui://GtkMenuButton[@id='start_date'] button-no-label
sc/uiconfig/scalc/ui/groupbydate.ui://GtkMenuButton[@id='end_date'] button-no-label
sc/uiconfig/scalc/ui/groupbynumber.ui://GtkEntry[@id='edit_by'] no-labelled-by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment