diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-17 16:10:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-18 16:32:55 +0200 |
commit | 228723ea962e33b472317b41f31b032421879093 (patch) | |
tree | ecf94ae37a87a8c8944fa404dbf3efb1f8511ade | |
parent | 4985446a827c53bf2f1840a279b07f065f622f0e (diff) |
weld ScOptSolverDlg
Change-Id: Ie2b43377f950cb16e143f6e9ef7081bf92277088
Reviewed-on: https://gerrit.libreoffice.org/70903
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 4 | ||||
-rw-r--r-- | include/formula/funcutl.hxx | 4 | ||||
-rw-r--r-- | include/vcl/commandinfoprovider.hxx | 5 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 1 | ||||
-rw-r--r-- | sc/qa/uitest/solver/solver.py | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/optsolver.hxx | 164 | ||||
-rw-r--r-- | sc/source/ui/inc/reffact.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/optsolver.cxx | 552 | ||||
-rw-r--r-- | sc/source/ui/view/reffact.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 15 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/solverdlg.ui | 911 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/solveroptionsdialog.ui | 1 | ||||
-rwxr-xr-x | solenv/bin/native-code.py | 1 | ||||
-rw-r--r-- | solenv/sanitizers/ui/modules/scalc.suppr | 17 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 18 | ||||
-rw-r--r-- | vcl/source/helper/commandinfoprovider.cxx | 31 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 84 |
17 files changed, 948 insertions, 868 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 797dcfc4a753..5fce152c342c 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -320,10 +320,6 @@ generic-name="Double Field" parent="GtkEntry" icon-name="widget-gtk-textentry"/> - <glade-widget-class title="Cursor Reference Edit" name="sclo-ScCursorRefEdit" - generic-name="Cursor Reference Edit" parent="foruilo-RefEdit" - icon-name="widget-gtk-textentry"/> - <glade-widget-class title="Open Document ListBox" name="dbulo-OpenDocumentListBox" generic-name="Open Document ListBox" parent="GtkComboBox" icon-name="widget-gtk-combobox"/> diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index df1d8cb25897..51e1b9dbae09 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -86,8 +86,10 @@ public: class FORMULA_DLLPUBLIC WeldRefEdit { -private: +protected: std::unique_ptr<weld::Entry> xEntry; + +private: Idle aIdle; IControlReferenceHandler* pAnyRefDlg; // parent dialog weld::Label* pLabelWidget; diff --git a/include/vcl/commandinfoprovider.hxx b/include/vcl/commandinfoprovider.hxx index 96a77cfb7520..f1254a04a14a 100644 --- a/include/vcl/commandinfoprovider.hxx +++ b/include/vcl/commandinfoprovider.hxx @@ -66,6 +66,11 @@ namespace vcl { namespace CommandInfoProvider { VCL_DLLPUBLIC OUString GetRealCommandForCommand( const OUString& rCommandName, const OUString& rsModuleName ); + VCL_DLLPUBLIC css::uno::Reference<css::graphic::XGraphic> GetXGraphicForCommand( + const OUString& rsCommandName, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + vcl::ImageType eImageType = vcl::ImageType::Small); + VCL_DLLPUBLIC Image GetImageForCommand( const OUString& rsCommandName, const css::uno::Reference<css::frame::XFrame>& rxFrame, diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d2929d69bc9a..a5b83aadbb9d 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -793,6 +793,7 @@ public: virtual void set_label(const OUString& rText) = 0; // pDevice, the image for the button, or nullptr to unset virtual void set_image(VirtualDevice* pDevice) = 0; + virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) = 0; virtual void set_from_icon_name(const OUString& rIconName) = 0; virtual OUString get_label() const = 0; virtual void set_label_line_wrap(bool wrap) = 0; diff --git a/sc/qa/uitest/solver/solver.py b/sc/qa/uitest/solver/solver.py index 1a409dca1b97..9deca217480e 100644 --- a/sc/qa/uitest/solver/solver.py +++ b/sc/qa/uitest/solver/solver.py @@ -46,7 +46,7 @@ class solver(UITestCase): xop2list.executeAction("SELECT", actionProps) xval2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"0"})) - xOKBtn = xDialog.getChild("solve") + xOKBtn = xDialog.getChild("ok") def handle_OK_dlg(dialog): #('SolverSuccessDialog', 'cancel', 'dialog-action_area1', 'dialog-vbox1', 'grid1', 'label1', 'label2', 'ok', 'result') xYesButn = dialog.getChild("ok") diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx index 21b2b5c3ba6e..9b8b78501726 100644 --- a/sc/source/ui/inc/optsolver.hxx +++ b/sc/source/ui/inc/optsolver.hxx @@ -32,17 +32,17 @@ namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } } -class ScCursorRefEdit : public formula::RefEdit +class ScCursorRefEdit : public formula::WeldRefEdit { Link<ScCursorRefEdit&,void> maCursorUpLink; Link<ScCursorRefEdit&,void> maCursorDownLink; public: - ScCursorRefEdit( vcl::Window* pParent, vcl::Window *pLabel ); + ScCursorRefEdit(std::unique_ptr<weld::Entry> xEntry); void SetCursorLinks( const Link<ScCursorRefEdit&,void>& rUp, const Link<ScCursorRefEdit&,void>& rDown ); protected: - virtual void KeyInput( const KeyEvent& rKEvt ) override; + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); }; /// The dialog's content for a row, not yet parsed @@ -88,88 +88,27 @@ public: { return maProperties; } }; -class ScOptSolverDlg : public ScAnyRefDlg +class ScOptSolverDlg : public ScAnyRefDlgController { public: - ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, - ScDocShell* pDocSh, const ScAddress& aCursorPos ); - virtual ~ScOptSolverDlg() override; - virtual void dispose() override; + ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, + ScDocShell* pDocSh, const ScAddress& aCursorPos ); + virtual ~ScOptSolverDlg() 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_pFtObjectiveCell; - VclPtr<formula::RefEdit> m_pEdObjectiveCell; - VclPtr<formula::RefButton> m_pRBObjectiveCell; - - VclPtr<RadioButton> m_pRbMax; - VclPtr<RadioButton> m_pRbMin; - VclPtr<RadioButton> m_pRbValue; - VclPtr<formula::RefEdit> m_pEdTargetValue; - VclPtr<formula::RefButton> m_pRBTargetValue; - - VclPtr<FixedText> m_pFtVariableCells; - VclPtr<formula::RefEdit> m_pEdVariableCells; - VclPtr<formula::RefButton> m_pRBVariableCells; - - VclPtr<FixedText> m_pFtCellRef; // labels are together with controls for the first row - VclPtr<ScCursorRefEdit> m_pEdLeft1; - VclPtr<formula::RefButton> m_pRBLeft1; - VclPtr<FixedText> m_pFtOperator; - VclPtr<ListBox> m_pLbOp1; - VclPtr<FixedText> m_pFtConstraint; - VclPtr<ScCursorRefEdit> m_pEdRight1; - VclPtr<formula::RefButton> m_pRBRight1; - VclPtr<PushButton> m_pBtnDel1; - - VclPtr<ScCursorRefEdit> m_pEdLeft2; - VclPtr<formula::RefButton> m_pRBLeft2; - VclPtr<ListBox> m_pLbOp2; - VclPtr<ScCursorRefEdit> m_pEdRight2; - VclPtr<formula::RefButton> m_pRBRight2; - VclPtr<PushButton> m_pBtnDel2; - - VclPtr<ScCursorRefEdit> m_pEdLeft3; - VclPtr<formula::RefButton> m_pRBLeft3; - VclPtr<ListBox> m_pLbOp3; - VclPtr<ScCursorRefEdit> m_pEdRight3; - VclPtr<formula::RefButton> m_pRBRight3; - VclPtr<PushButton> m_pBtnDel3; - - VclPtr<ScCursorRefEdit> m_pEdLeft4; - VclPtr<formula::RefButton> m_pRBLeft4; - VclPtr<ListBox> m_pLbOp4; - VclPtr<ScCursorRefEdit> m_pEdRight4; - VclPtr<formula::RefButton> m_pRBRight4; - VclPtr<PushButton> m_pBtnDel4; - - VclPtr<ScrollBar> m_pScrollBar; - - VclPtr<PushButton> m_pBtnOpt; - VclPtr<PushButton> m_pBtnCancel; - VclPtr<PushButton> m_pBtnSolve; - OUString const maInputError; OUString const maConditionError; ScDocShell* mpDocShell; ScDocument& mrDoc; const SCTAB mnCurTab; - VclPtr<formula::RefEdit> mpEdActive; bool mbDlgLostFocus; - static const sal_uInt16 EDIT_ROW_COUNT = 4; - VclPtr<ScCursorRefEdit> mpLeftEdit[EDIT_ROW_COUNT]; - VclPtr<formula::RefButton> mpLeftButton[EDIT_ROW_COUNT]; - VclPtr<ScCursorRefEdit> mpRightEdit[EDIT_ROW_COUNT]; - VclPtr<formula::RefButton> mpRightButton[EDIT_ROW_COUNT]; - VclPtr<ListBox> mpOperator[EDIT_ROW_COUNT]; - VclPtr<PushButton> mpDelButton[EDIT_ROW_COUNT]; - std::vector<ScOptConditionRow> maConditions; long nScrollPos; @@ -178,6 +117,70 @@ private: OUString maEngine; css::uno::Sequence<css::beans::PropertyValue> maProperties; + static const sal_uInt16 EDIT_ROW_COUNT = 4; + ScCursorRefEdit* mpLeftEdit[EDIT_ROW_COUNT]; + formula::WeldRefButton* mpLeftButton[EDIT_ROW_COUNT]; + ScCursorRefEdit* mpRightEdit[EDIT_ROW_COUNT]; + formula::WeldRefButton* mpRightButton[EDIT_ROW_COUNT]; + weld::ComboBox* mpOperator[EDIT_ROW_COUNT]; + weld::Button* mpDelButton[EDIT_ROW_COUNT]; + + formula::WeldRefEdit* mpEdActive; + + std::unique_ptr<weld::Label> m_xFtObjectiveCell; + std::unique_ptr<formula::WeldRefEdit> m_xEdObjectiveCell; + std::unique_ptr<formula::WeldRefButton> m_xRBObjectiveCell; + + std::unique_ptr<weld::RadioButton> m_xRbMax; + std::unique_ptr<weld::RadioButton> m_xRbMin; + std::unique_ptr<weld::RadioButton> m_xRbValue; + std::unique_ptr<formula::WeldRefEdit> m_xEdTargetValue; + std::unique_ptr<formula::WeldRefButton> m_xRBTargetValue; + + std::unique_ptr<weld::Label> m_xFtVariableCells; + std::unique_ptr<formula::WeldRefEdit> m_xEdVariableCells; + std::unique_ptr<formula::WeldRefButton> m_xRBVariableCells; + + std::unique_ptr<weld::Label> m_xFtCellRef; // labels are together with controls for the first row + std::unique_ptr<ScCursorRefEdit> m_xEdLeft1; + std::unique_ptr<formula::WeldRefButton> m_xRBLeft1; + std::unique_ptr<weld::Label> m_xFtOperator; + std::unique_ptr<weld::ComboBox> m_xLbOp1; + std::unique_ptr<weld::Label> m_xFtConstraint; + std::unique_ptr<ScCursorRefEdit> m_xEdRight1; + std::unique_ptr<formula::WeldRefButton> m_xRBRight1; + std::unique_ptr<weld::Button> m_xBtnDel1; + + std::unique_ptr<ScCursorRefEdit> m_xEdLeft2; + std::unique_ptr<formula::WeldRefButton> m_xRBLeft2; + std::unique_ptr<weld::ComboBox> m_xLbOp2; + std::unique_ptr<ScCursorRefEdit> m_xEdRight2; + std::unique_ptr<formula::WeldRefButton> m_xRBRight2; + std::unique_ptr<weld::Button> m_xBtnDel2; + + std::unique_ptr<ScCursorRefEdit> m_xEdLeft3; + std::unique_ptr<formula::WeldRefButton> m_xRBLeft3; + std::unique_ptr<weld::ComboBox> m_xLbOp3; + std::unique_ptr<ScCursorRefEdit> m_xEdRight3; + std::unique_ptr<formula::WeldRefButton> m_xRBRight3; + std::unique_ptr<weld::Button> m_xBtnDel3; + + std::unique_ptr<ScCursorRefEdit> m_xEdLeft4; + std::unique_ptr<formula::WeldRefButton> m_xRBLeft4; + std::unique_ptr<weld::ComboBox> m_xLbOp4; + std::unique_ptr<ScCursorRefEdit> m_xEdRight4; + std::unique_ptr<formula::WeldRefButton> m_xRBRight4; + std::unique_ptr<weld::Button> m_xBtnDel4; + + std::unique_ptr<weld::ScrolledWindow> m_xScrollBar; + + std::unique_ptr<weld::Button> m_xBtnOpt; + std::unique_ptr<weld::Button> m_xBtnCancel; + std::unique_ptr<weld::Button> m_xBtnSolve; + + std::unique_ptr<weld::Label> m_xResultFT; + std::unique_ptr<weld::Widget> m_xContents; + void Init(const ScAddress& rCursorPos); bool CallSolver(); void ReadConditions(); @@ -185,18 +188,21 @@ private: void EnableButtons(); bool ParseRef( ScRange& rRange, const OUString& rInput, bool bAllowRange ); bool FindTimeout( sal_Int32& rTimeout ); - void ShowError( bool bCondition, formula::RefEdit* pFocus ); - - DECL_LINK( BtnHdl, Button*, void ); - DECL_LINK( DelBtnHdl, Button*, void ); - DECL_LINK( GetFocusHdl, Control&, void ); - DECL_LINK( LoseFocusHdl, Control&, void ); - DECL_LINK( ScrollHdl, ScrollBar*, void); + void ShowError( bool bCondition, formula::WeldRefEdit* pFocus ); + + DECL_LINK( BtnHdl, weld::Button&, void ); + DECL_LINK( DelBtnHdl, weld::Button&, void ); + DECL_LINK( GetEditFocusHdl, formula::WeldRefEdit&, void ); + DECL_LINK( GetButtonFocusHdl, formula::WeldRefButton&, void ); + DECL_LINK( GetFocusHdl, weld::Widget&, void ); + DECL_LINK( LoseEditFocusHdl, formula::WeldRefEdit&, void ); + DECL_LINK( LoseButtonFocusHdl, formula::WeldRefButton&, void ); + DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void); DECL_LINK( CursorUpHdl, ScCursorRefEdit&, void ); DECL_LINK( CursorDownHdl, ScCursorRefEdit&, void ); - DECL_LINK( CondModifyHdl, Edit&, void ); - DECL_LINK( TargetModifyHdl, Edit&, void ); - DECL_LINK( SelectHdl, ListBox&, void ); + DECL_LINK( CondModifyHdl, formula::WeldRefEdit&, void ); + DECL_LINK( TargetModifyHdl, formula::WeldRefEdit&, void ); + DECL_LINK( SelectHdl, weld::ComboBox&, void ); }; class ScSolverProgressDialog : public weld::GenericDialogController diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index 45dd4f6a9db0..61ec9321a9ad 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -47,7 +47,7 @@ DECL_WRAPPER_WITHID_CONTROLLER(ScNameDlgWrapper) DECL_WRAPPER_WITHID_CONTROLLER(ScNameDefDlgWrapper) DECL_WRAPPER_WITHID_CONTROLLER(ScSolverDlgWrapper) -DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper) +DECL_WRAPPER_WITHID_CONTROLLER(ScOptSolverDlgWrapper) DECL_WRAPPER_WITHID(ScXMLSourceDlgWrapper) DECL_WRAPPER_WITHID(ScPivotLayoutWrapper) DECL_WRAPPER_WITHID_CONTROLLER(ScTabOpDlgWrapper) diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 4fd377d87b47..08a0202e2ba4 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -103,20 +103,20 @@ IMPL_LINK(ScSolverSuccessDialog, ClickHdl, weld::Button&, rBtn, void) m_xDialog->response(RET_CANCEL); } -ScCursorRefEdit::ScCursorRefEdit( vcl::Window* pParent, vcl::Window *pLabel ) - : formula::RefEdit( pParent, pLabel ) +ScCursorRefEdit::ScCursorRefEdit(std::unique_ptr<weld::Entry> xControl) + : formula::WeldRefEdit(std::move(xControl)) { + xEntry->connect_key_press(Link<const KeyEvent&, bool>()); //acknowledge we first remove the old one + xEntry->connect_key_press(LINK(this, ScCursorRefEdit, KeyInputHdl)); } -VCL_BUILDER_FACTORY_ARGS(ScCursorRefEdit, nullptr) - void ScCursorRefEdit::SetCursorLinks( const Link<ScCursorRefEdit&,void>& rUp, const Link<ScCursorRefEdit&,void>& rDown ) { maCursorUpLink = rUp; maCursorDownLink = rDown; } -void ScCursorRefEdit::KeyInput( const KeyEvent& rKEvt ) +IMPL_LINK(ScCursorRefEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool) { vcl::KeyCode aCode = rKEvt.GetKeyCode(); bool bUp = (aCode.GetCode() == KEY_UP); @@ -127,9 +127,9 @@ void ScCursorRefEdit::KeyInput( const KeyEvent& rKEvt ) maCursorUpLink.Call( *this ); else maCursorDownLink.Call( *this ); + return true; } - else - formula::RefEdit::KeyInput( rKEvt ); + return formula::WeldRefEdit::KeyInput(rKEvt); } ScOptSolverSave::ScOptSolverSave( const OUString& rObjective, bool bMax, bool bMin, bool bValue, @@ -151,243 +151,188 @@ ScOptSolverSave::ScOptSolverSave( const OUString& rObjective, bool bMax, bool bM // class ScOptSolverDlg -ScOptSolverDlg::ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, - ScDocShell* pDocSh, const ScAddress& aCursorPos ) - - : ScAnyRefDlg(pB, pCW, pParent, "SolverDialog", "modules/scalc/ui/solverdlg.ui") +ScOptSolverDlg::ScOptSolverDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, + ScDocShell* pDocSh, const ScAddress& aCursorPos) + : ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/solverdlg.ui", "SolverDialog") , maInputError(ScResId(STR_INVALIDINPUT)) , maConditionError(ScResId(STR_INVALIDCONDITION)) , mpDocShell(pDocSh) , mrDoc(pDocSh->GetDocument()) , mnCurTab(aCursorPos.Tab()) - , mpEdActive(nullptr) , mbDlgLostFocus(false) , nScrollPos(0) + , mpEdActive(nullptr) + , m_xFtObjectiveCell(m_xBuilder->weld_label("targetlabel")) + , m_xEdObjectiveCell(new formula::WeldRefEdit(m_xBuilder->weld_entry("targetedit"))) + , m_xRBObjectiveCell(new formula::WeldRefButton(m_xBuilder->weld_button("targetbutton"))) + , m_xRbMax(m_xBuilder->weld_radio_button("max")) + , m_xRbMin(m_xBuilder->weld_radio_button("min")) + , m_xRbValue(m_xBuilder->weld_radio_button("value")) + , m_xEdTargetValue(new formula::WeldRefEdit(m_xBuilder->weld_entry("valueedit"))) + , m_xRBTargetValue(new formula::WeldRefButton(m_xBuilder->weld_button("valuebutton"))) + , m_xFtVariableCells(m_xBuilder->weld_label("changelabel")) + , m_xEdVariableCells(new formula::WeldRefEdit(m_xBuilder->weld_entry("changeedit"))) + , m_xRBVariableCells(new formula::WeldRefButton(m_xBuilder->weld_button("changebutton"))) + , m_xFtCellRef(m_xBuilder->weld_label("cellreflabel")) + , m_xEdLeft1(new ScCursorRefEdit(m_xBuilder->weld_entry("ref1edit"))) + , m_xRBLeft1(new formula::WeldRefButton(m_xBuilder->weld_button("ref1button"))) + , m_xFtOperator(m_xBuilder->weld_label("oplabel")) + , m_xLbOp1(m_xBuilder->weld_combo_box("op1list")) + , m_xFtConstraint(m_xBuilder->weld_label("constraintlabel")) + , m_xEdRight1(new ScCursorRefEdit(m_xBuilder->weld_entry("val1edit"))) + , m_xRBRight1(new formula::WeldRefButton(m_xBuilder->weld_button("val1button"))) + , m_xBtnDel1(m_xBuilder->weld_button("del1")) + , m_xEdLeft2(new ScCursorRefEdit(m_xBuilder->weld_entry("ref2edit"))) + , m_xRBLeft2(new formula::WeldRefButton(m_xBuilder->weld_button("ref2button"))) + , m_xLbOp2(m_xBuilder->weld_combo_box("op2list")) + , m_xEdRight2(new ScCursorRefEdit(m_xBuilder->weld_entry("val2edit"))) + , m_xRBRight2(new formula::WeldRefButton(m_xBuilder->weld_button("val2button"))) + , m_xBtnDel2(m_xBuilder->weld_button("del2")) + , m_xEdLeft3(new ScCursorRefEdit(m_xBuilder->weld_entry("ref3edit"))) + , m_xRBLeft3(new formula::WeldRefButton(m_xBuilder->weld_button("ref3button"))) + , m_xLbOp3(m_xBuilder->weld_combo_box("op3list")) + , m_xEdRight3(new ScCursorRefEdit(m_xBuilder->weld_entry("val3edit"))) + , m_xRBRight3(new formula::WeldRefButton(m_xBuilder->weld_button("val3button"))) + , m_xBtnDel3(m_xBuilder->weld_button("del3")) + , m_xEdLeft4(new ScCursorRefEdit(m_xBuilder->weld_entry("ref4edit"))) + , m_xRBLeft4(new formula::WeldRefButton(m_xBuilder->weld_button("ref4button"))) + , m_xLbOp4(m_xBuilder->weld_combo_box("op4list")) + , m_xEdRight4(new ScCursorRefEdit(m_xBuilder->weld_entry("val4edit"))) + , m_xRBRight4(new formula::WeldRefButton(m_xBuilder->weld_button("val4button"))) + , m_xBtnDel4(m_xBuilder->weld_button("del4")) + , m_xScrollBar(m_xBuilder->weld_scrolled_window("scrollbar")) + , m_xBtnOpt(m_xBuilder->weld_button("options")) + , m_xBtnCancel(m_xBuilder->weld_button("close")) + , m_xBtnSolve(m_xBuilder->weld_button("ok")) + , m_xResultFT(m_xBuilder->weld_label("result")) + , m_xContents(m_xBuilder->weld_widget("grid")) { - get(m_pFtObjectiveCell, "targetlabel"); - get(m_pEdObjectiveCell, "targetedit"); - m_pEdObjectiveCell->SetReferences(this, m_pFtObjectiveCell); - get(m_pRBObjectiveCell, "targetbutton"); - m_pRBObjectiveCell->SetReferences(this, m_pEdObjectiveCell); - get(m_pRbMax, "max"); - get(m_pRbMin, "min"); - get(m_pRbValue, "value"); - get(m_pEdTargetValue, "valueedit"); - m_pEdTargetValue->SetReferences(this, get<FixedText>("result")); - get(m_pRBTargetValue, "valuebutton"); - m_pRBTargetValue->SetReferences(this, m_pEdTargetValue); - get(m_pFtVariableCells, "changelabel"); - get(m_pEdVariableCells, "changeedit"); - m_pEdVariableCells->SetReferences(this, m_pFtVariableCells); - get(m_pRBVariableCells, "changebutton"); - m_pRBVariableCells->SetReferences(this, m_pEdVariableCells); - get(m_pFtCellRef, "cellreflabel"); - get(m_pEdLeft1, "ref1edit"); - m_pEdLeft1->SetReferences(this, m_pFtCellRef); - get(m_pRBLeft1, "ref1button"); - m_pRBLeft1->SetReferences(this, m_pEdLeft1); - get(m_pFtOperator, "oplabel"); - get(m_pLbOp1, "op1list"); - get(m_pFtConstraint, "constraintlabel"); - get(m_pEdRight1, "val1edit"); - m_pEdRight1->SetReferences(this, m_pFtConstraint); - get(m_pRBRight1, "val1button"); - m_pRBRight1->SetReferences(this, m_pEdRight1); - get(m_pBtnDel1, "del1"); - get(m_pEdLeft2, "ref2edit"); - m_pEdLeft2->SetReferences(this, m_pFtCellRef); - get(m_pRBLeft2, "ref2button"); - m_pRBLeft2->SetReferences(this, m_pEdLeft2); - get(m_pLbOp2, "op2list"); - get(m_pEdRight2, "val2edit"); - m_pEdRight2->SetReferences(this, m_pFtConstraint); - get(m_pRBRight2, "val2button"); - m_pRBRight2->SetReferences(this, m_pEdRight2); - get(m_pBtnDel2, "del2"); - get(m_pEdLeft3, "ref3edit"); - m_pEdLeft3->SetReferences(this, m_pFtCellRef); - get(m_pRBLeft3, "ref3button"); - m_pRBLeft3->SetReferences(this, m_pEdLeft3); - get(m_pLbOp3, "op3list"); - get(m_pEdRight3, "val3edit"); - m_pEdRight3->SetReferences(this, m_pFtConstraint); - get(m_pRBRight3, "val3button"); - m_pRBRight3->SetReferences(this, m_pEdRight3); - get(m_pBtnDel3, "del3"); - get(m_pEdLeft4, "ref4edit"); - m_pEdLeft4->SetReferences(this, m_pFtCellRef); - get(m_pRBLeft4, "ref4button"); - m_pRBLeft4->SetReferences(this, m_pEdLeft4); - get(m_pLbOp4, "op4list"); - get(m_pEdRight4, "val4edit"); - m_pEdRight4->SetReferences(this, m_pFtConstraint); - get(m_pRBRight4, "val4button"); - m_pRBRight4->SetReferences(this, m_pEdRight4); - get(m_pBtnDel4, "del4"); - get(m_pScrollBar, "scrollbar"); - get(m_pBtnOpt, "options"); - get(m_pBtnCancel, "close"); - get(m_pBtnSolve, "solve"); - - mpLeftEdit[0] = m_pEdLeft1; - mpLeftButton[0] = m_pRBLeft1; - mpRightEdit[0] = m_pEdRight1; - mpRightButton[0] = m_pRBRight1; - mpOperator[0] = m_pLbOp1; - mpDelButton[0] = m_pBtnDel1; - - mpLeftEdit[1] = m_pEdLeft2; - mpLeftButton[1] = m_pRBLeft2; - mpRightEdit[1] = m_pEdRight2; - mpRightButton[1] = m_pRBRight2; - mpOperator[1] = m_pLbOp2; - mpDelButton[1] = m_pBtnDel2; - - mpLeftEdit[2] = m_pEdLeft3; - mpLeftButton[2] = m_pRBLeft3; - mpRightEdit[2] = m_pEdRight3; - mpRightButton[2] = m_pRBRight3; - mpOperator[2] = m_pLbOp3; - mpDelButton[2] = m_pBtnDel3; - - mpLeftEdit[3] = m_pEdLeft4; - mpLeftButton[3] = m_pRBLeft4; - mpRightEdit[3] = m_pEdRight4; - mpRightButton[3] = m_pRBRight4; - mpOperator[3] = m_pLbOp4; - mpDelButton[3] = m_pBtnDel4; + m_xEdObjectiveCell->SetReferences(this, m_xFtObjectiveCell.get()); + m_xRBObjectiveCell->SetReferences(this, m_xEdObjectiveCell.get()); + m_xEdTargetValue->SetReferences(this, m_xResultFT.get()); + m_xRBTargetValue->SetReferences(this, m_xEdTargetValue.get()); + m_xEdVariableCells->SetReferences(this, m_xFtVariableCells.get()); + m_xRBVariableCells->SetReferences(this, m_xEdVariableCells.get()); + m_xEdLeft1->SetReferences(this, m_xFtCellRef.get()); + m_xRBLeft1->SetReferences(this, m_xEdLeft1.get()); + m_xEdRight1->SetReferences(this, m_xFtConstraint.get()); + m_xRBRight1->SetReferences(this, m_xEdRight1.get()); + m_xEdLeft2->SetReferences(this, m_xFtCellRef.get()); + m_xRBLeft2->SetReferences(this, m_xEdLeft2.get()); + m_xEdRight2->SetReferences(this, m_xFtConstraint.get()); + m_xRBRight2->SetReferences(this, m_xEdRight2.get()); + m_xEdLeft3->SetReferences(this, m_xFtCellRef.get()); + m_xRBLeft3->SetReferences(this, m_xEdLeft3.get()); + m_xEdRight3->SetReferences(this, m_xFtConstraint.get()); + m_xRBRight3->SetReferences(this, m_xEdRight3.get()); + m_xEdLeft4->SetReferences(this, m_xFtCellRef.get()); + m_xRBLeft4->SetReferences(this, m_xEdLeft4.get()); + m_xEdRight4->SetReferences(this, m_xFtConstraint.get()); + m_xRBRight4->SetReferences(this, m_xEdRight4.get()); + + mpLeftEdit[0] = m_xEdLeft1.get(); + mpLeftButton[0] = m_xRBLeft1.get(); + mpRightEdit[0] = m_xEdRight1.get(); + mpRightButton[0] = m_xRBRight1.get(); + mpOperator[0] = m_xLbOp1.get(); + mpDelButton[0] = m_xBtnDel1.get(); + + mpLeftEdit[1] = m_xEdLeft2.get(); + mpLeftButton[1] = m_xRBLeft2.get(); + mpRightEdit[1] = m_xEdRight2.get(); + mpRightButton[1] = m_xRBRight2.get(); + mpOperator[1] = m_xLbOp2.get(); + mpDelButton[1] = m_xBtnDel2.get(); + + mpLeftEdit[2] = m_xEdLeft3.get(); + mpLeftButton[2] = m_xRBLeft3.get(); + mpRightEdit[2] = m_xEdRight3.get(); + mpRightButton[2] = m_xRBRight3.get(); + mpOperator[2] = m_xLbOp3.get(); + mpDelButton[2] = m_xBtnDel3.get(); + + mpLeftEdit[3] = m_xEdLeft4.get(); + mpLeftButton[3] = m_xRBLeft4.get(); + mpRightEdit[3] = m_xEdRight4.get(); + mpRightButton[3] = m_xRBRight4.get(); + mpOperator[3] = m_xLbOp4.get(); + mpDelButton[3] = m_xBtnDel4.get(); Init( aCursorPos ); } ScOptSolverDlg::~ScOptSolverDlg() { - disposeOnce(); -} - -void ScOptSolverDlg::dispose() -{ - m_pFtObjectiveCell.clear(); - m_pEdObjectiveCell.clear(); - m_pRBObjectiveCell.clear(); - m_pRbMax.clear(); - m_pRbMin.clear(); - m_pRbValue.clear(); - m_pEdTargetValue.clear(); - m_pRBTargetValue.clear(); - m_pFtVariableCells.clear(); - m_pEdVariableCells.clear(); - m_pRBVariableCells.clear(); - m_pFtCellRef.clear(); - m_pEdLeft1.clear(); - m_pRBLeft1.clear(); - m_pFtOperator.clear(); - m_pLbOp1.clear(); - m_pFtConstraint.clear(); - m_pEdRight1.clear(); - m_pRBRight1.clear(); - m_pBtnDel1.clear(); - m_pEdLeft2.clear(); - m_pRBLeft2.clear(); - m_pLbOp2.clear(); - m_pEdRight2.clear(); - m_pRBRight2.clear(); - m_pBtnDel2.clear(); - m_pEdLeft3.clear(); - m_pRBLeft3.clear(); - m_pLbOp3.clear(); - m_pEdRight3.clear(); - m_pRBRight3.clear(); - m_pBtnDel3.clear(); - m_pEdLeft4.clear(); - m_pRBLeft4.clear(); - m_pLbOp4.clear(); - m_pEdRight4.clear(); - m_pRBRight4.clear(); - m_pBtnDel4.clear(); - m_pScrollBar.clear(); - m_pBtnOpt.clear(); - m_pBtnCancel.clear(); - m_pBtnSolve.clear(); - mpEdActive.clear(); - for (auto& p : mpLeftButton) - p.clear(); - for (auto& p : mpRightButton) - p.clear(); - for (auto& p : mpOperator) - p.clear(); - for (auto& p : mpDelButton) - p.clear(); - ScAnyRefDlg::dispose(); } void ScOptSolverDlg::Init(const ScAddress& rCursorPos) { uno::Reference<frame::XFrame> xFrame = GetBindings().GetActiveFrame(); - Image aDelNm = vcl::CommandInfoProvider::GetImageForCommand(".uno:DeleteRows", xFrame); - - for (VclPtr<PushButton> & pButton : mpDelButton) - { - pButton->SetModeImage( aDelNm ); - } - - m_pBtnOpt->SetClickHdl( LINK( this, ScOptSolverDlg, BtnHdl ) ); - m_pBtnCancel->SetClickHdl( LINK( this, ScOptSolverDlg, BtnHdl ) ); - m_pBtnSolve->SetClickHdl( LINK( this, ScOptSolverDlg, BtnHdl ) ); - - Link<Control&,void> aLink = LINK( this, ScOptSolverDlg, GetFocusHdl ); - m_pEdObjectiveCell->SetGetFocusHdl( aLink ); - m_pRBObjectiveCell->SetGetFocusHdl( aLink ); - m_pEdTargetValue->SetGetFocusHdl( aLink ); - m_pRBTargetValue->SetGetFocusHdl( aLink ); - m_pEdVariableCells->SetGetFocusHdl( aLink ); - m_pRBVariableCells->SetGetFocusHdl( aLink ); - m_pRbValue->SetGetFocusHdl( aLink ); + auto xDelNm = vcl::CommandInfoProvider::GetXGraphicForCommand(".uno:DeleteRows", xFrame); + for (weld::Button* pButton : mpDelButton) + pButton->set_image(xDelNm); + + m_xBtnOpt->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) ); + m_xBtnCancel->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) ); + m_xBtnSolve->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) ); + + Link<formula::WeldRefEdit&,void> aEditLink = LINK( this, ScOptSolverDlg, GetEditFocusHdl ); + Link<formula::WeldRefButton&,void> aButtonLink = LINK( this, ScOptSolverDlg, GetButtonFocusHdl ); + m_xEdObjectiveCell->SetGetFocusHdl( aEditLink ); + m_xRBObjectiveCell->SetGetFocusHdl( aButtonLink ); + m_xEdTargetValue->SetGetFocusHdl( aEditLink ); + m_xRBTargetValue->SetGetFocusHdl( aButtonLink ); + m_xEdVariableCells->SetGetFocusHdl( aEditLink ); + m_xRBVariableCells->SetGetFocusHdl( aButtonLink ); + Link<weld::Widget&,void> aLink = LINK(this, ScOptSolverDlg, GetFocusHdl); + m_xRbValue->connect_focus_in(aLink); for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) { - mpLeftEdit[nRow]->SetGetFocusHdl( aLink ); - mpLeftButton[nRow]->SetGetFocusHdl( aLink ); - mpRightEdit[nRow]->SetGetFocusHdl( aLink ); - mpRightButton[nRow]->SetGetFocusHdl( aLink ); - mpOperator[nRow]->SetGetFocusHdl( aLink ); + mpLeftEdit[nRow]->SetGetFocusHdl( aEditLink ); + mpLeftButton[nRow]->SetGetFocusHdl( aButtonLink ); + mpRightEdit[nRow]->SetGetFocusHdl( aEditLink ); + mpRightButton[nRow]->SetGetFocusHdl( aButtonLink ); + mpOperator[nRow]->connect_focus_in(aLink); } - aLink = LINK( this, ScOptSolverDlg, LoseFocusHdl ); - m_pEdObjectiveCell->SetLoseFocusHdl( aLink ); - m_pRBObjectiveCell->SetLoseFocusHdl( aLink ); - m_pEdTargetValue->SetLoseFocusHdl( aLink ); - m_pRBTargetValue-> SetLoseFocusHdl( aLink ); - m_pEdVariableCells->SetLoseFocusHdl( aLink ); - m_pRBVariableCells->SetLoseFocusHdl( aLink ); + aEditLink = LINK( this, ScOptSolverDlg, LoseEditFocusHdl ); + aButtonLink = LINK( this, ScOptSolverDlg, LoseButtonFocusHdl ); + m_xEdObjectiveCell->SetLoseFocusHdl( aEditLink ); + m_xRBObjectiveCell->SetLoseFocusHdl( aButtonLink ); + m_xEdTargetValue->SetLoseFocusHdl( aEditLink ); + m_xRBTargetValue-> SetLoseFocusHdl( aButtonLink ); + m_xEdVariableCells->SetLoseFocusHdl( aEditLink ); + m_xRBVariableCells->SetLoseFocusHdl( aButtonLink ); for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) { - mpLeftEdit[nRow]->SetLoseFocusHdl( aLink ); - mpLeftButton[nRow]->SetLoseFocusHdl( aLink ); - mpRightEdit[nRow]->SetLoseFocusHdl( aLink ); - mpRightButton[nRow]->SetLoseFocusHdl( aLink ); + mpLeftEdit[nRow]->SetLoseFocusHdl( aEditLink ); + mpLeftButton[nRow]->SetLoseFocusHdl( aButtonLink ); + mpRightEdit[nRow]->SetLoseFocusHdl( aEditLink ); + mpRightButton[nRow]->SetLoseFocusHdl( aButtonLink ); } Link<ScCursorRefEdit&,void> aCursorUp = LINK( this, ScOptSolverDlg, CursorUpHdl ); Link<ScCursorRefEdit&,void> aCursorDown = LINK( this, ScOptSolverDlg, CursorDownHdl ); - Link<Edit&,void> aCondModify = LINK( this, ScOptSolverDlg, CondModifyHdl ); + Link<formula::WeldRefEdit&,void> aCondModify = LINK( this, ScOptSolverDlg, CondModifyHdl ); for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) { mpLeftEdit[nRow]->SetCursorLinks( aCursorUp, aCursorDown ); mpRightEdit[nRow]->SetCursorLinks( aCursorUp, aCursorDown ); mpLeftEdit[nRow]->SetModifyHdl( aCondModify ); mpRightEdit[nRow]->SetModifyHdl( aCondModify ); - mpDelButton[nRow]->SetClickHdl( LINK( this, ScOptSolverDlg, DelBtnHdl ) ); - mpOperator[nRow]->SetSelectHdl( LINK( this, ScOptSolverDlg, SelectHdl ) ); + mpDelButton[nRow]->connect_clicked( LINK( this, ScOptSolverDlg, DelBtnHdl ) ); + mpOperator[nRow]->connect_changed( LINK( this, ScOptSolverDlg, SelectHdl ) ); } - m_pEdTargetValue->SetModifyHdl( LINK( this, ScOptSolverDlg, TargetModifyHdl ) ); + m_xEdTargetValue->SetModifyHdl( LINK( this, ScOptSolverDlg, TargetModifyHdl ) ); - m_pScrollBar->SetEndScrollHdl( LINK( this, ScOptSolverDlg, ScrollHdl ) ); - m_pScrollBar->SetScrollHdl( LINK( this, ScOptSolverDlg, ScrollHdl ) ); + m_xScrollBar->set_user_managed_scrolling(); + Size aSize(m_xContents->get_preferred_size()); + m_xContents->set_size_request(aSize.Width(), aSize.Height()); + m_xScrollBar->connect_vadjustment_changed( LINK( this, ScOptSolverDlg, ScrollHdl ) ); - m_pScrollBar->SetPageSize( EDIT_ROW_COUNT ); - m_pScrollBar->SetVisibleSize( EDIT_ROW_COUNT ); - m_pScrollBar->SetLineSize( 1 ); + m_xScrollBar->vadjustment_set_page_increment( EDIT_ROW_COUNT ); + m_xScrollBar->vadjustment_set_page_size( EDIT_ROW_COUNT ); // Range is set in ShowConditions // get available solver implementations @@ -398,30 +343,30 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos) const ScOptSolverSave* pOldData = mpDocShell->GetSolverSaveData(); if ( pOldData ) { - m_pEdObjectiveCell->SetRefString( pOldData->GetObjective() ); - m_pRbMax->Check( pOldData->GetMax() ); - m_pRbMin->Check( pOldData->GetMin() ); - m_pRbValue->Check( pOldData->GetValue() ); - m_pEdTargetValue->SetRefString( pOldData->GetTarget() ); - m_pEdVariableCells->SetRefString( pOldData->GetVariable() ); + m_xEdObjectiveCell->SetRefString( pOldData->GetObjective() ); + m_xRbMax->set_active( pOldData->GetMax() ); + m_xRbMin->set_active( pOldData->GetMin() ); + m_xRbValue->set_active( pOldData->GetValue() ); + m_xEdTargetValue->SetRefString( pOldData->GetTarget() ); + m_xEdVariableCells->SetRefString( pOldData->GetVariable() ); maConditions = pOldData->GetConditions(); maEngine = pOldData->GetEngine(); maProperties = pOldData->GetProperties(); } else { - m_pRbMax->Check(); + m_xRbMax->set_active(true); OUString aCursorStr; if ( !mrDoc.GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) ) aCursorStr = rCursorPos.Format(ScRefFlags::ADDR_ABS, nullptr, mrDoc.GetAddressConvention()); - m_pEdObjectiveCell->SetRefString( aCursorStr ); + m_xEdObjectiveCell->SetRefString( aCursorStr ); if ( nImplCount > 0 ) maEngine = maImplNames[0]; // use first implementation } ShowConditions(); - m_pEdObjectiveCell->GrabFocus(); - mpEdActive = m_pEdObjectiveCell; + m_xEdObjectiveCell->GrabFocus(); + mpEdActive = m_xEdObjectiveCell.get(); } void ScOptSolverDlg::ReadConditions() @@ -431,7 +376,7 @@ void ScOptSolverDlg::ReadConditions() ScOptConditionRow aRowEntry; aRowEntry.aLeftStr = mpLeftEdit[nRow]->GetText(); aRowEntry.aRightStr = mpRightEdit[nRow]->GetText(); - aRowEntry.nOperator = mpOperator[nRow]->GetSelectedEntryPos(); + aRowEntry.nOperator = mpOperator[nRow]->get_active(); long nVecPos = nScrollPos + nRow; if ( nVecPos >= static_cast<long>(maConditions.size()) && !aRowEntry.IsDefault() ) @@ -460,14 +405,14 @@ void ScOptSolverDlg::ShowConditions() mpLeftEdit[nRow]->SetRefString( aRowEntry.aLeftStr ); mpRightEdit[nRow]->SetRefString( aRowEntry.aRightStr ); - mpOperator[nRow]->SelectEntryPos( aRowEntry.nOperator ); + mpOperator[nRow]->set_active( aRowEntry.nOperator ); } // allow to scroll one page behind the visible or stored rows long nVisible = nScrollPos + EDIT_ROW_COUNT; long nMax = std::max( nVisible, static_cast<long>(maConditions.size()) ); - m_pScrollBar->SetRange( Range( 0, nMax + EDIT_ROW_COUNT ) ); - m_pScrollBar->SetThumbPos( nScrollPos ); + m_xScrollBar->vadjustment_configure(nScrollPos, 0, nMax + EDIT_ROW_COUNT, 1, + EDIT_ROW_COUNT - 1, EDIT_ROW_COUNT); EnableButtons(); } @@ -477,13 +422,13 @@ void ScOptSolverDlg::EnableButtons() for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) { long nVecPos = nScrollPos + nRow; - mpDelButton[nRow]->Enable( nVecPos < static_cast<long>(maConditions.size()) ); + mpDelButton[nRow]->set_sensitive(nVecPos < static_cast<long>(maConditions.size())); } } -bool ScOptSolverDlg::Close() +void ScOptSolverDlg::Close() { - return DoClose( ScOptSolverDlgWrapper::GetChildWindowId() ); + DoClose( ScOptSolverDlgWrapper::GetChildWindowId() ); } void ScOptSolverDlg::SetActive() @@ -496,7 +441,7 @@ void ScOptSolverDlg::SetActive() } else { - GrabFocus(); + m_xDialog->grab_focus(); } RefInputDone(); } @@ -509,7 +454,7 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) RefInputStart(mpEdActive); // "target"/"value": single cell - bool bSingle = ( mpEdActive == m_pEdObjectiveCell || mpEdActive == m_pEdTargetValue ); + bool bSingle = ( mpEdActive == m_xEdObjectiveCell.get() || mpEdActive == m_xEdTargetValue.get() ); OUString aStr; ScAddress aAdr = rRef.aStart; @@ -530,7 +475,7 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) } // variable cells can be several ranges, so only the selection is replaced - if ( mpEdActive == m_pEdVariableCells ) + if ( mpEdActive == m_xEdVariableCells.get() ) { OUString aVal = mpEdActive->GetText(); Selection aSel = mpEdActive->GetSelection(); @@ -547,8 +492,8 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) EnableButtons(); // select "Value of" if a ref is input into "target" edit - if ( mpEdActive == m_pEdTargetValue ) - m_pRbValue->Check(); + if ( mpEdActive == m_xEdTargetValue.get() ) + m_xRbValue->set_active(true); } } @@ -559,11 +504,11 @@ bool ScOptSolverDlg::IsRefInputMode() const // Handler: -IMPL_LINK( ScOptSolverDlg, BtnHdl, Button*, pBtn, void ) +IMPL_LINK(ScOptSolverDlg, BtnHdl, weld::Button&, rBtn, void) { - if ( pBtn == m_pBtnSolve || pBtn == m_pBtnCancel ) + if (&rBtn == m_xBtnSolve.get() || &rBtn == m_xBtnCancel.get()) { - bool bSolve = ( pBtn == m_pBtnSolve ); + bool bSolve = ( &rBtn == m_xBtnSolve.get() ); SetDispatcherLock( false ); SwitchToDocument(); @@ -577,10 +522,10 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, Button*, pBtn, void ) // Close: write dialog settings to DocShell for subsequent calls ReadConditions(); std::unique_ptr<ScOptSolverSave> pSave( new ScOptSolverSave( - m_pEdObjectiveCell->GetText(), m_pRbMax->IsChecked(), m_pRbMin->IsChecked(), m_pRbValue->IsChecked(), - m_pEdTargetValue->GetText(), m_pEdVariableCells->GetText(), maConditions, maEngine, maProperties ) ); + m_xEdObjectiveCell->GetText(), m_xRbMax->get_active(), m_xRbMin->get_active(), m_xRbValue->get_active(), + m_xEdTargetValue->GetText(), m_xEdVariableCells->GetText(), maConditions, maEngine, maProperties ) ); mpDocShell->SetSolverSaveData( std::move(pSave) ); - Close(); + response(RET_CLOSE); } else { @@ -588,10 +533,10 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, Button*, pBtn, void ) SetDispatcherLock( true ); } } - else if ( pBtn == m_pBtnOpt ) + else if (&rBtn == m_xBtnOpt.get()) { //! move options dialog to UI lib? - ScSolverOptionsDialog aOptDlg(GetFrameWeld(), maImplNames, maDescriptions, maEngine, maProperties); + ScSolverOptionsDialog aOptDlg(m_xDialog.get(), maImplNames, maDescriptions, maEngine, maProperties); if (aOptDlg.run() == RET_OK) { maEngine = aOptDlg.GetEngine(); @@ -600,44 +545,83 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, Button*, pBtn, void ) } } -IMPL_LINK( ScOptSolverDlg, GetFocusHdl, Control&, rCtrl, void ) +IMPL_LINK( ScOptSolverDlg, GetEditFocusHdl, formula::WeldRefEdit&, rCtrl, void ) +{ + formula::WeldRefEdit* pEdit = nullptr; + mpEdActive = nullptr; + + if( &rCtrl == m_xEdObjectiveCell.get() ) + pEdit = mpEdActive = m_xEdObjectiveCell.get(); + else if( &rCtrl == m_xEdTargetValue.get() ) + pEdit = mpEdActive = m_xEdTargetValue.get(); + else if( &rCtrl == m_xEdVariableCells.get() ) + pEdit = mpEdActive = m_xEdVariableCells.get(); + for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) + { + if( &rCtrl == mpLeftEdit[nRow] ) + pEdit = mpEdActive = mpLeftEdit[nRow]; + else if( &rCtrl == mpRightEdit[nRow] ) + pEdit = mpEdActive = mpRightEdit[nRow]; + } + + if( pEdit ) + pEdit->SelectAll(); +} + +IMPL_LINK( ScOptSolverDlg, GetButtonFocusHdl, formula::WeldRefButton&, rCtrl, void ) { - Edit* pEdit = nullptr; + formula::WeldRefEdit* pEdit = nullptr; mpEdActive = nullptr; - if( &rCtrl == m_pEdObjectiveCell || &rCtrl == m_pRBObjectiveCell ) - pEdit = mpEdActive = m_pEdObjectiveCell; - else if( &rCtrl == m_pEdTargetValue || &rCtrl == m_pRBTargetValue ) - pEdit = mpEdActive = m_pEdTargetValue; - else if( &rCtrl == m_pEdVariableCells || &rCtrl == m_pRBVariableCells ) - pEdit = mpEdActive = m_pEdVariableCells; + if( &rCtrl == m_xRBObjectiveCell.get() ) + pEdit = mpEdActive = m_xEdObjectiveCell.get(); + else if( &rCtrl == m_xRBTargetValue.get() ) + pEdit = mpEdActive = m_xEdTargetValue.get(); + else if( &rCtrl == m_xRBVariableCells.get() ) + pEdit = mpEdActive = m_xEdVariableCells.get(); for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) { - if( &rCtrl == mpLeftEdit[nRow] || &rCtrl == mpLeftButton[nRow] ) - pEdit = mpEdActive = mpLeftEdit[nRow].get(); - else if( &rCtrl == mpRightEdit[nRow] || &rCtrl == mpRightButton[nRow] ) - pEdit = mpEdActive = mpRightEdit[nRow].get(); - else if( &rCtrl == mpOperator[nRow] ) // focus on "operator" list box - mpEdActive = mpRightEdit[nRow].get(); // use right edit for ref input, but don't change selection + if( &rCtrl == mpLeftButton[nRow] ) + pEdit = mpEdActive = mpLeftEdit[nRow]; + else if( &rCtrl == mpRightButton[nRow] ) + pEdit = mpEdActive = mpRightEdit[nRow]; } - if( &rCtrl == m_pRbValue ) // focus on "Value of" radio button - mpEdActive = m_pEdTargetValue; // use value edit for ref input, but don't change selection if( pEdit ) - pEdit->SetSelection( Selection( 0, SELECTION_MAX ) ); + pEdit->SelectAll(); +} + + +IMPL_LINK(ScOptSolverDlg, GetFocusHdl, weld::Widget&, rCtrl, void) +{ + if( &rCtrl == m_xRbValue.get() ) // focus on "Value of" radio button + mpEdActive = m_xEdTargetValue.get(); // use value edit for ref input, but don't change selection + else + { + for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) + { + if( &rCtrl == mpOperator[nRow] ) // focus on "operator" list box + mpEdActive = mpRightEdit[nRow]; // use right edit for ref input, but don't change selection + } + } +} + +IMPL_LINK_NOARG(ScOptSolverDlg, LoseEditFocusHdl, formula::WeldRefEdit&, void) +{ + mbDlgLostFocus = !m_xDialog->has_toplevel_focus(); } -IMPL_LINK_NOARG(ScOptSolverDlg, LoseFocusHdl, Control&, void) +IMPL_LINK_NOARG(ScOptSolverDlg, LoseButtonFocusHdl, formula::WeldRefButton&, void) { - mbDlgLostFocus = !IsActive(); + mbDlgLostFocus = !m_xDialog->has_toplevel_focus(); } -IMPL_LINK( ScOptSolverDlg, DelBtnHdl, Button*, pBtn, void ) +IMPL_LINK(ScOptSolverDlg, DelBtnHdl, weld::Button&, rBtn, void) { for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) - if( pBtn == mpDelButton[nRow] ) + if (&rBtn == mpDelButton[nRow]) { - bool bHadFocus = pBtn->HasFocus(); + bool bHadFocus = rBtn.has_focus(); ReadConditions(); long nVecPos = nScrollPos + nRow; @@ -646,47 +630,47 @@ IMPL_LINK( ScOptSolverDlg, DelBtnHdl, Button*, pBtn, void ) maConditions.erase( maConditions.begin() + nVecPos ); ShowConditions(); - if ( bHadFocus && !pBtn->IsEnabled() ) + if ( bHadFocus && !rBtn.get_sensitive() ) { // If the button is disabled, focus would normally move to the next control, // (left edit of the next row). Move it to left edit of this row instead. - mpEdActive = mpLeftEdit[nRow].get(); + mpEdActive = mpLeftEdit[nRow]; mpEdActive->GrabFocus(); } } } } -IMPL_LINK_NOARG(ScOptSolverDlg, TargetModifyHdl, Edit&, void) +IMPL_LINK_NOARG(ScOptSolverDlg, TargetModifyHdl, formula::WeldRefEdit&, void) { // modify handler for the target edit: // select "Value of" if something is input into the edit - if ( !m_pEdTargetValue->GetText().isEmpty() ) - m_pRbValue->Check(); + if ( !m_xEdTargetValue->GetText().isEmpty() ) + m_xRbValue->set_active(true); } -IMPL_LINK_NOARG(ScOptSolverDlg, CondModifyHdl, Edit&, void) +IMPL_LINK_NOARG(ScOptSolverDlg, CondModifyHdl, formula::WeldRefEdit&, void) { // modify handler for the condition edits, just to enable/disable "delete" buttons ReadConditions(); EnableButtons(); } -IMPL_LINK_NOARG(ScOptSolverDlg, SelectHdl, ListBox&, void) +IMPL_LINK_NOARG(ScOptSolverDlg, SelectHdl, weld::ComboBox&, void) { // select handler for operator list boxes, just to enable/disable "delete" buttons ReadConditions(); EnableButtons(); } -IMPL_LINK_NOARG(ScOptSolverDlg, ScrollHdl, ScrollBar*, void) +IMPL_LINK_NOARG(ScOptSolverDlg, ScrollHdl, weld::ScrolledWindow&, void) { ReadConditions(); - nScrollPos = m_pScrollBar->GetThumbPos(); + nScrollPos = m_xScrollBar->vadjustment_get_value(); ShowConditions(); if( mpEdActive ) - mpEdActive->SetSelection( Selection( 0, SELECTION_MAX ) ); + mpEdActive->SelectAll(); } IMPL_LINK( ScOptSolverDlg, CursorUpHdl, ScCursorRefEdit&, rEdit, void ) @@ -699,12 +683,12 @@ IMPL_LINK( ScOptSolverDlg, CursorUpHdl, ScCursorRefEdit&, rEdit, void ) --nScrollPos; ShowConditions(); if( mpEdActive ) - mpEdActive->SetSelection( Selection( 0, SELECTION_MAX ) ); + mpEdActive->SelectAll(); } } else { - formula::RefEdit* pFocus = nullptr; + formula::WeldRefEdit* pFocus = nullptr; for ( sal_uInt16 nRow = 1; nRow < EDIT_ROW_COUNT; ++nRow ) // second row or below: move focus { if ( &rEdit == mpLeftEdit[nRow] ) @@ -729,11 +713,11 @@ IMPL_LINK( ScOptSolverDlg, CursorDownHdl, ScCursorRefEdit&, rEdit, void ) ++nScrollPos; ShowConditions(); if( mpEdActive ) - mpEdActive->SetSelection( Selection( 0, SELECTION_MAX ) ); + mpEdActive->SelectAll(); } else { - formula::RefEdit* pFocus = nullptr; + formula::WeldRefEdit* pFocus = nullptr; for ( sal_uInt16 nRow = 0; nRow+1 < EDIT_ROW_COUNT; ++nRow ) // before last row: move focus { if ( &rEdit == mpLeftEdit[nRow] ) @@ -749,10 +733,10 @@ IMPL_LINK( ScOptSolverDlg, CursorDownHdl, ScCursorRefEdit&, rEdit, void ) } } -void ScOptSolverDlg::ShowError( bool bCondition, formula::RefEdit* pFocus ) +void ScOptSolverDlg::ShowError( bool bCondition, formula::WeldRefEdit* pFocus ) { OUString aMessage = bCondition ? maConditionError : maInputError; - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, aMessage)); xBox->run(); @@ -803,7 +787,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal { // show progress dialog - std::shared_ptr<ScSolverProgressDialog> xProgress(new ScSolverProgressDialog(GetFrameWeld())); + std::shared_ptr<ScSolverProgressDialog> xProgress(new ScSolverProgressDialog(m_xDialog.get())); sal_Int32 nTimeout = 0; if ( FindTimeout( nTimeout ) ) xProgress->SetTimeLimit( nTimeout ); @@ -822,18 +806,18 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal uno::Reference<sheet::XSpreadsheetDocument> xDocument( mpDocShell->GetModel(), uno::UNO_QUERY ); ScRange aObjRange; - if ( !ParseRef( aObjRange, m_pEdObjectiveCell->GetText(), false ) ) + if ( !ParseRef( aObjRange, m_xEdObjectiveCell->GetText(), false ) ) { - ShowError( false, m_pEdObjectiveCell ); + ShowError( false, m_xEdObjectiveCell.get() ); return false; } table::CellAddress aObjective( aObjRange.aStart.Tab(), aObjRange.aStart.Col(), aObjRange.aStart.Row() ); // "changing cells" can be several ranges ScRangeList aVarRanges; - if ( !ParseWithNames( aVarRanges, m_pEdVariableCells->GetText(), &mrDoc ) ) + if ( !ParseWithNames( aVarRanges, m_xEdVariableCells->GetText(), &mrDoc ) ) { - ShowError( false, m_pEdVariableCells ); + ShowError( false, m_xEdVariableCells.get() ); return false; } uno::Sequence<table::CellAddress> aVariables; @@ -923,8 +907,8 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal } } - bool bMaximize = m_pRbMax->IsChecked(); - if ( m_pRbValue->IsChecked() ) + bool bMaximize = m_xRbMax->get_active(); + if ( m_xRbValue->get_active() ) { // handle "value of" with an additional constraint (and then minimize) @@ -932,7 +916,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal aConstraint.Left = aObjective; aConstraint.Operator = sheet::SolverConstraintOperator_EQUAL; - OUString aValStr = m_pEdTargetValue->GetText(); + OUString aValStr = m_xEdTargetValue->GetText(); ScRange aRightRange; if ( ParseRef( aRightRange, aValStr, false ) ) aConstraint.Right <<= table::CellAddress( aRightRange.aStart.Tab(), @@ -945,7 +929,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal aConstraint.Right <<= fValue; else { - ShowError( false, m_pEdTargetValue ); + ShowError( false, m_xEdTargetValue.get() ); return false; } } @@ -1028,7 +1012,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row), static_cast<SCTAB>(aObjective.Sheet)); - ScSolverSuccessDialog aDialog(GetFrameWeld(), aResultStr); + ScSolverSuccessDialog aDialog(m_xDialog.get(), aResultStr); if (aDialog.run() == RET_OK) { // keep results and close dialog @@ -1042,7 +1026,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY ); if ( xDesc.is() ) aError = xDesc->getStatusDescription(); // error description from component - ScSolverNoSolutionDialog aDialog(GetFrameWeld(), aError); + ScSolverNoSolutionDialog aDialog(m_xDialog.get(), aError); aDialog.run(); } diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 4ccce3e9f575..88b19814d453 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -35,7 +35,7 @@ SFX_IMPL_CHILDWINDOW_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME) SFX_IMPL_CHILDWINDOW_WITHID(ScNameDefDlgWrapper, FID_ADD_NAME ) SFX_IMPL_CHILDWINDOW_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE ) -SFX_IMPL_MODELESSDIALOG_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) +SFX_IMPL_CHILDWINDOW_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) SFX_IMPL_MODELESSDIALOG_WITHID(ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE) SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE ) SFX_IMPL_CHILDWINDOW_WITHID(ScTabOpDlgWrapper, SID_OPENDLG_TABOP ) @@ -127,7 +127,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScNameDefDlgWrapper, FID_ADD_NAME ) IMPL_CONTROLLER_CHILD_CTOR( ScSolverDlgWrapper, SID_OPENDLG_SOLVE ) -IMPL_CHILD_CTOR( ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) +IMPL_CONTROLLER_CHILD_CTOR( ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) IMPL_CHILD_CTOR( ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE) diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index a13c875d776d..18fd810859e1 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -144,14 +144,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( switch( nSlotId ) { - case SID_OPENDLG_OPTSOLVER: - { - ScViewData& rViewData = GetViewData(); - ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo()); - pResult = VclPtr<ScOptSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos ); - } - break; - case SID_OPENDLG_PIVOTTABLE: { // all settings must be in pDialogDPObject @@ -484,6 +476,13 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont xResult.reset(new ScSpecialFilterDlg(pB, pCW, pParent, aArgSet)); break; } + case SID_OPENDLG_OPTSOLVER: + { + ScViewData& rViewData = GetViewData(); + ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo()); + xResult.reset(new ScOptSolverDlg(pB, pCW, pParent, rViewData.GetDocShell(), aCurPos)); + break; + } } if (xResult) diff --git a/sc/uiconfig/scalc/ui/solverdlg.ui b/sc/uiconfig/scalc/ui/solverdlg.ui index 99aba126eef4..eb8da9ea579a 100644 --- a/sc/uiconfig/scalc/ui/solverdlg.ui +++ b/sc/uiconfig/scalc/ui/solverdlg.ui @@ -2,11 +2,13 @@ <!-- 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="SolverDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="solverdlg|SolverDialog">Solver</property> + <property name="resizable">False</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child> <placeholder/> @@ -50,7 +52,7 @@ </packing> </child> <child> - <object class="GtkButton" id="solve"> + <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="solverdlg|solve">_Solve</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -102,7 +104,6 @@ <property name="hexpand">True</property> <property name="row_spacing">6</property> <property name="column_spacing">12</property> - <property name="row_homogeneous">True</property> <child> <object class="GtkLabel" id="targetlabel"> <property name="visible">True</property> @@ -122,11 +123,12 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="solverdlg|result">Optimize result to</property> <property name="xalign">0</property> - <property name="yalign">0.029999999329447746</property> + <property name="yalign">0</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> + <property name="height">3</property> </packing> </child> <child> @@ -151,7 +153,7 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">value</property> + <property name="group">max</property> <accessibility> <relation type="member-of" target="result"/> </accessibility> @@ -188,10 +190,11 @@ <property name="hexpand">True</property> <property name="spacing">6</property> <child> - <object class="foruilo-RefEdit" id="changeedit"> + <object class="GtkEntry" id="changeedit"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> <property name="width_chars">32</property> </object> <packing> @@ -201,7 +204,7 @@ </packing> </child> <child> - <object class="foruilo-RefButton" id="changebutton"> + <object class="GtkButton" id="changebutton"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -225,7 +228,7 @@ <property name="hexpand">True</property> <property name="spacing">6</property> <child> - <object class="foruilo-RefEdit" id="targetedit"> + <object class="GtkEntry" id="targetedit"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -238,7 +241,7 @@ </packing> </child> <child> - <object class="foruilo-RefButton" id="targetbutton"> + <object class="GtkButton" id="targetbutton"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -288,10 +291,11 @@ <property name="hexpand">True</property> <property name="spacing">6</property> <child> - <object class="foruilo-RefEdit" id="valueedit"> + <object class="GtkEntry" id="valueedit"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="expand">False</property> @@ -300,7 +304,7 @@ </packing> </child> <child> - <object class="foruilo-RefButton" id="valuebutton"> + <object class="GtkButton" id="valuebutton"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -324,12 +328,6 @@ <property name="top_attach">3</property> </packing> </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> </object> <packing> <property name="expand">False</property> @@ -349,440 +347,465 @@ <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="valign">start</property> <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkGrid" id="grid1"> + <object class="GtkScrolledWindow" id="scrollbar"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="valign">start</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - <child> - <object class="GtkLabel" id="cellreflabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="solverdlg|cellreflabel">_Cell reference</property> - <property name="use_underline">True</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="oplabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="solverdlg|oplabel">_Operator</property> - <property name="use_underline">True</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - </packing> - </child> + <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">always</property> + <property name="shadow_type">in</property> <child> - <object class="GtkLabel" id="constraintlabel"> + <object class="GtkViewport"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="margin_left">6</property> - <property name="label" translatable="yes" context="solverdlg|constraintlabel">V_alue</property> - <property name="use_underline">True</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">0</property> - <property name="width">4</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="ref1edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="width_chars">20</property> - <child internal-child="accessible"> - <object class="AtkObject" id="ref1edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref1edit-atkobject">Cell reference</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="ref2edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="width_chars">20</property> - <child internal-child="accessible"> - <object class="AtkObject" id="ref2edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref2edit-atkobject">Cell reference</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="ref3edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="hexpand">True</property> - <property name="width_chars">20</property> - <child internal-child="accessible"> - <object class="AtkObject" id="ref3edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref3edit-atkobject">Cell reference</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="ref4edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="width_chars">20</property> - <child internal-child="accessible"> - <object class="AtkObject" id="ref4edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref4edit-atkobject">Cell reference</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="ref1button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="ref2button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="ref3button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="ref4button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="op1list"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <items> - <item translatable="yes" context="solverdlg|op1list"><=</item> - <item translatable="yes" context="solverdlg|op1list">=</item> - <item translatable="yes" context="solverdlg|op1list">=></item> - <item translatable="yes" context="solverdlg|op1list">Integer</item> - <item translatable="yes" context="solverdlg|op1list">Binary</item> - </items> - <child internal-child="accessible"> - <object class="AtkObject" id="op1list-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op1list-atkobject">Operator</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="op2list"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <items> - <item translatable="yes" context="solverdlg|op2list"><=</item> - <item translatable="yes" context="solverdlg|op2list">=</item> - <item translatable="yes" context="solverdlg|op2list">=></item> - <item translatable="yes" context="solverdlg|op2list">Integer</item> - <item translatable="yes" context="solverdlg|op2list">Binary</item> - </items> - <child internal-child="accessible"> - <object class="AtkObject" id="op2list-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op2list-atkobject">Operator</property> + <child> + <object class="GtkGrid" id="grid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="hexpand">True</property> + <property name="border_width">3</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="cellreflabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="solverdlg|cellreflabel">_Cell reference</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="oplabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="solverdlg|oplabel">_Operator</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="constraintlabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">6</property> + <property name="label" translatable="yes" context="solverdlg|constraintlabel">V_alue</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">0</property> + <property name="width">3</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="ref1edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">20</property> + <child internal-child="accessible"> + <object class="AtkObject" id="ref1edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref1edit-atkobject">Cell reference</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="ref2edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">20</property> + <child internal-child="accessible"> + <object class="AtkObject" id="ref2edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref2edit-atkobject">Cell reference</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="ref3edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">20</property> + <child internal-child="accessible"> + <object class="AtkObject" id="ref3edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref3edit-atkobject">Cell reference</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="ref4edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">20</property> + <child internal-child="accessible"> + <object class="AtkObject" id="ref4edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref4edit-atkobject">Cell reference</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ref1button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ref2button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ref3button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ref4button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="op1list"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <items> + <item translatable="yes" context="solverdlg|op1list"><=</item> + <item translatable="yes" context="solverdlg|op1list">=</item> + <item translatable="yes" context="solverdlg|op1list">=></item> + <item translatable="yes" context="solverdlg|op1list">Integer</item> + <item translatable="yes" context="solverdlg|op1list">Binary</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="op1list-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op1list-atkobject">Operator</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="op2list"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <items> + <item translatable="yes" context="solverdlg|op2list"><=</item> + <item translatable="yes" context="solverdlg|op2list">=</item> + <item translatable="yes" context="solverdlg|op2list">=></item> + <item translatable="yes" context="solverdlg|op2list">Integer</item> + <item translatable="yes" context="solverdlg|op2list">Binary</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="op2list-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op2list-atkobject">Operator</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="op3list"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <items> + <item translatable="yes" context="solverdlg|op3list"><=</item> + <item translatable="yes" context="solverdlg|op3list">=</item> + <item translatable="yes" context="solverdlg|op3list">=></item> + <item translatable="yes" context="solverdlg|op3list">Integer</item> + <item translatable="yes" context="solverdlg|op3list">Binary</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="op3list-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op3list-atkobject">Operator</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="op4list"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <items> + <item translatable="yes" context="solverdlg|op4list"><=</item> + <item translatable="yes" context="solverdlg|op4list">=</item> + <item translatable="yes" context="solverdlg|op4list">=></item> + <item translatable="yes" context="solverdlg|op4list">Integer</item> + <item translatable="yes" context="solverdlg|op4list">Binary</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="op4list-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op4list-atkobject">Operator</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="val1edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">6</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">15</property> + <child internal-child="accessible"> + <object class="AtkObject" id="val1edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val1edit-atkobject">Value</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="val2edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">6</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">15</property> + <child internal-child="accessible"> + <object class="AtkObject" id="val2edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val2edit-atkobject">Value</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="val3edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">6</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">15</property> + <child internal-child="accessible"> + <object class="AtkObject" id="val3edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val3edit-atkobject">Value</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="val4edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">6</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="width_chars">15</property> + <child internal-child="accessible"> + <object class="AtkObject" id="val4edit-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val4edit-atkobject">Value</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkButton" id="val1button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="val2button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="val3button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="val4button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkButton" id="del2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes" context="solverdlg|del2|tooltip_text">Remove</property> + </object> + <packing> + <property name="left_attach">5</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="del1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes" context="solverdlg|del1|tooltip_text">Remove</property> + </object> + <packing> + <property name="left_attach">5</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="del3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes" context="solverdlg|del3|tooltip_text">Remove</property> + </object> + <packing> + <property name="left_attach">5</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="del4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes" context="solverdlg|del4|tooltip_text">Remove</property> + </object> + <packing> + <property name="left_attach">5</property> + <property name="top_attach">4</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> </object> </child> </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="op3list"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <items> - <item translatable="yes" context="solverdlg|op3list"><=</item> - <item translatable="yes" context="solverdlg|op3list">=</item> - <item translatable="yes" context="solverdlg|op3list">=></item> - <item translatable="yes" context="solverdlg|op3list">Integer</item> - <item translatable="yes" context="solverdlg|op3list">Binary</item> - </items> - <child internal-child="accessible"> - <object class="AtkObject" id="op3list-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op3list-atkobject">Operator</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="op4list"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <items> - <item translatable="yes" context="solverdlg|op4list"><=</item> - <item translatable="yes" context="solverdlg|op4list">=</item> - <item translatable="yes" context="solverdlg|op4list">=></item> - <item translatable="yes" context="solverdlg|op4list">Integer</item> - <item translatable="yes" context="solverdlg|op4list">Binary</item> - </items> - <child internal-child="accessible"> - <object class="AtkObject" id="op4list-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|op4list-atkobject">Operator</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="val1edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="margin_left">6</property> - <property name="hexpand">True</property> - <property name="width_chars">15</property> - <child internal-child="accessible"> - <object class="AtkObject" id="val1edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val1edit-atkobject">Value</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="val2edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="margin_left">6</property> - <property name="hexpand">True</property> - <property name="width_chars">15</property> - <child internal-child="accessible"> - <object class="AtkObject" id="val2edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val2edit-atkobject">Value</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="val3edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="margin_left">6</property> - <property name="hexpand">True</property> - <property name="width_chars">15</property> - <child internal-child="accessible"> - <object class="AtkObject" id="val3edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val3edit-atkobject">Value</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="sclo-ScCursorRefEdit" id="val4edit"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="margin_left">6</property> - <property name="hexpand">True</property> - <property name="width_chars">15</property> - <child internal-child="accessible"> - <object class="AtkObject" id="val4edit-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val4edit-atkobject">Value</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="val1button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">4</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="val2button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">4</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="val3button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">4</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="foruilo-RefButton" id="val4button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="left_attach">4</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="GtkButton" id="del2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes" context="solverdlg|del2|tooltip_text">Remove</property> - </object> - <packing> - <property name="left_attach">5</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkButton" id="del1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes" context="solverdlg|del1|tooltip_text">Remove</property> - </object> - <packing> - <property name="left_attach">5</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="del3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes" context="solverdlg|del3|tooltip_text">Remove</property> - </object> - <packing> - <property name="left_attach">5</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="GtkButton" id="del4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_text" translatable="yes" context="solverdlg|del4|tooltip_text">Remove</property> - </object> - <packing> - <property name="left_attach">5</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="GtkScrollbar" id="scrollbar"> - <property name="height_request">1</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - </object> - <packing> - <property name="left_attach">6</property> - <property name="top_attach">1</property> - <property name="height">4</property> - </packing> </child> </object> </child> @@ -815,10 +838,18 @@ </object> </child> <action-widgets> - <action-widget response="0">options</action-widget> + <action-widget response="101">options</action-widget> <action-widget response="-11">help</action-widget> - <action-widget response="0">solve</action-widget> + <action-widget response="-5">ok</action-widget> <action-widget response="-7">close</action-widget> </action-widgets> </object> + <object class="GtkSizeGroup"> + <property name="mode">vertical</property> + <widgets> + <widget name="min"/> + <widget name="max"/> + <widget name="box5"/> + </widgets> + </object> </interface> diff --git a/sc/uiconfig/scalc/ui/solveroptionsdialog.ui b/sc/uiconfig/scalc/ui/solveroptionsdialog.ui index 6a7fb3edc86a..91a48733c0f6 100644 --- a/sc/uiconfig/scalc/ui/solveroptionsdialog.ui +++ b/sc/uiconfig/scalc/ui/solveroptionsdialog.ui @@ -209,6 +209,7 @@ <object class="GtkButton" id="edit"> <property name="label" translatable="yes" context="solveroptionsdialog|edit">Edit...</property> <property name="visible">True</property> + <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="halign">start</property> diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 417dcfd57c3d..78f12deee3f7 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -468,7 +468,6 @@ custom_widgets = [ 'SameContentListBox', 'ScCondFormatList', 'ScCsvTableBox', - 'ScCursorRefEdit', 'ScDataTableView', 'ScDoubleField', 'ScPivotLayoutTreeList', diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr index 80af63f13573..1ee0fb87be99 100644 --- a/solenv/sanitizers/ui/modules/scalc.suppr +++ b/solenv/sanitizers/ui/modules/scalc.suppr @@ -243,12 +243,23 @@ sc/uiconfig/scalc/ui/simplerefdialog.ui://GtkButton[@id='assignref'] button-no-l sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='targetlabel'] orphan-label sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='result'] orphan-label sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='changelabel'] orphan-label -sc/uiconfig/scalc/ui/solverdlg.ui://foruilo-RefEdit[@id='changeedit'] no-labelled-by -sc/uiconfig/scalc/ui/solverdlg.ui://foruilo-RefEdit[@id='targetedit'] no-labelled-by -sc/uiconfig/scalc/ui/solverdlg.ui://foruilo-RefEdit[@id='valueedit'] no-labelled-by +sc/uiconfig/scalc/ui/solverdlg.ui://GtkEntry[@id='changeedit'] no-labelled-by +sc/uiconfig/scalc/ui/solverdlg.ui://GtkEntry[@id='targetedit'] no-labelled-by +sc/uiconfig/scalc/ui/solverdlg.ui://GtkEntry[@id='valueedit'] no-labelled-by sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='cellreflabel'] orphan-label sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='oplabel'] orphan-label sc/uiconfig/scalc/ui/solverdlg.ui://GtkLabel[@id='constraintlabel'] orphan-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='changebutton'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='targetbutton'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='valuebutton'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='ref1button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='ref2button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='ref3button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='ref4button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='val1button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='val2button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='val3button'] button-no-label +sc/uiconfig/scalc/ui/solverdlg.ui://GtkButton[@id='val4button'] button-no-label sc/uiconfig/scalc/ui/solverprogressdialog.ui://GtkLabel[@id='label2'] orphan-label sc/uiconfig/scalc/ui/solverprogressdialog.ui://GtkLabel[@id='progress'] orphan-label sc/uiconfig/scalc/ui/solversuccessdialog.ui://GtkLabel[@id='label1'] orphan-label diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 59a9ab3b527a..be45ec9bf0bc 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1615,16 +1615,20 @@ public: { m_xButton->SetImageAlign(ImageAlign::Left); if (pDevice) - { m_xButton->SetModeImage(createImage(*pDevice)); - } else m_xButton->SetModeImage(Image()); } + virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override + { + m_xButton->SetImageAlign(ImageAlign::Left); + m_xButton->SetModeImage(Image(rImage)); + } + virtual void set_from_icon_name(const OUString& rIconName) override { - m_xButton->SetModeImage(::Image(StockImage::Yes, rIconName)); + m_xButton->SetModeImage(Image(StockImage::Yes, rIconName)); } virtual void set_label_line_wrap(bool wrap) override @@ -1881,9 +1885,15 @@ public: m_xRadioButton->SetModeImage(Image()); } + virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override + { + m_xRadioButton->SetImageAlign(ImageAlign::Center); + m_xRadioButton->SetModeImage(Image(rImage)); + } + virtual void set_from_icon_name(const OUString& rIconName) override { - m_xRadioButton->SetModeRadioImage(::Image(StockImage::Yes, rIconName)); + m_xRadioButton->SetModeRadioImage(Image(StockImage::Yes, rIconName)); } virtual void set_inconsistent(bool /*inconsistent*/) override diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 23bd3250f888..3fd267272bfd 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -295,13 +295,12 @@ OUString GetRealCommandForCommand(const OUString& rCommandName, return GetCommandProperty("TargetURL", rCommandName, rsModuleName); } -static BitmapEx GetBitmapForCommand(const OUString& rsCommandName, - const Reference<frame::XFrame>& rxFrame, - vcl::ImageType eImageType) +Reference<graphic::XGraphic> GetXGraphicForCommand(const OUString& rsCommandName, + const Reference<frame::XFrame>& rxFrame, + vcl::ImageType eImageType) { - if (rsCommandName.isEmpty()) - return BitmapEx(); + return nullptr; sal_Int16 nImageType(ui::ImageType::COLOR_NORMAL | ui::ImageType::SIZE_DEFAULT); @@ -324,11 +323,8 @@ static BitmapEx GetBitmapForCommand(const OUString& rsCommandName, aGraphicSeq = xDocImgMgr->getImages( nImageType, aImageCmdSeq ); Reference<graphic::XGraphic> xGraphic = aGraphicSeq[0]; - const Graphic aGraphic(xGraphic); - BitmapEx aBitmap(aGraphic.GetBitmapEx()); - - if (!!aBitmap) - return aBitmap; + if (xGraphic.is()) + return xGraphic; } } catch (Exception&) @@ -348,15 +344,22 @@ static BitmapEx GetBitmapForCommand(const OUString& rsCommandName, Reference<graphic::XGraphic> xGraphic(aGraphicSeq[0]); - const Graphic aGraphic(xGraphic); - - return aGraphic.GetBitmapEx(); + return xGraphic; } catch (Exception&) { } - return BitmapEx(); + return nullptr; +} + +static BitmapEx GetBitmapForCommand(const OUString& rsCommandName, + const Reference<frame::XFrame>& rxFrame, + vcl::ImageType eImageType) +{ + const Graphic aGraphic(GetXGraphicForCommand(rsCommandName, rxFrame, eImageType)); + BitmapEx aBitmap(aGraphic.GetBitmapEx()); + return aBitmap; } Image GetImageForCommand(const OUString& rsCommandName, diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 0f09eb6e0877..e5de3dc4f2d6 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -40,6 +40,7 @@ #include <vcl/i18nhelp.hxx> #include <vcl/quickselectionengine.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/pngwrite.hxx> #include <vcl/syswin.hxx> #include <vcl/weld.hxx> #include <vcl/virdev.hxx> @@ -2099,6 +2100,17 @@ GdkPixbuf* load_icon_by_name(const OUString& rIconName) namespace { + GdkPixbuf* getPixbuf(const css::uno::Reference<css::graphic::XGraphic>& rImage) + { + Image aImage(rImage); + + std::unique_ptr<SvMemoryStream> xMemStm(new SvMemoryStream); + vcl::PNGWriter aWriter(aImage.GetBitmapEx()); + aWriter.Write(*xMemStm); + + return load_icon_from_stream(*xMemStm); + } + GdkPixbuf* getPixbuf(const VirtualDevice& rDevice) { Size aSize(rDevice.GetOutputSizePixel()); @@ -4321,8 +4333,6 @@ public: } }; -#include <vcl/pngwrite.hxx> - class GtkInstanceButton : public GtkInstanceContainer, public virtual weld::Button { private: @@ -4364,9 +4374,24 @@ public: { GdkPixbuf* pixbuf = load_icon_by_name(rIconName); if (!pixbuf) - return; - gtk_button_set_image(m_pButton, gtk_image_new_from_pixbuf(pixbuf)); - g_object_unref(pixbuf); + gtk_button_set_image(m_pButton, nullptr); + else + { + gtk_button_set_image(m_pButton, gtk_image_new_from_pixbuf(pixbuf)); + g_object_unref(pixbuf); + } + } + + virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override + { + GdkPixbuf* pixbuf = getPixbuf(rImage); + if (!pixbuf) + gtk_button_set_image(m_pButton, nullptr); + else + { + gtk_button_set_image(m_pButton, gtk_image_new_from_pixbuf(pixbuf)); + g_object_unref(pixbuf); + } } virtual OUString get_label() const override @@ -4677,6 +4702,20 @@ private: return false; } + void ensure_image_widget() + { + if (!m_pImage) + { + m_pImage = GTK_IMAGE(gtk_image_new()); + GtkStyleContext *pContext = gtk_widget_get_style_context(GTK_WIDGET(m_pMenuButton)); + gint nImageSpacing(0); + gtk_style_context_get_style(pContext, "image-spacing", &nImageSpacing, nullptr); + gtk_box_pack_start(m_pBox, GTK_WIDGET(m_pImage), false, false, nImageSpacing); + gtk_box_reorder_child(m_pBox, GTK_WIDGET(m_pImage), 0); + gtk_widget_show(GTK_WIDGET(m_pImage)); + } + } + public: GtkInstanceMenuButton(GtkMenuButton* pMenuButton, GtkInstanceBuilder* pBuilder, bool bTakeOwnership) : GtkInstanceToggleButton(GTK_TOGGLE_BUTTON(pMenuButton), pBuilder, bTakeOwnership) @@ -4720,16 +4759,7 @@ public: virtual void set_image(VirtualDevice* pDevice) override { - if (!m_pImage) - { - m_pImage = GTK_IMAGE(gtk_image_new()); - GtkStyleContext *pContext = gtk_widget_get_style_context(GTK_WIDGET(m_pMenuButton)); - gint nImageSpacing(0); - gtk_style_context_get_style(pContext, "image-spacing", &nImageSpacing, nullptr); - gtk_box_pack_start(m_pBox, GTK_WIDGET(m_pImage), false, false, nImageSpacing); - gtk_box_reorder_child(m_pBox, GTK_WIDGET(m_pImage), 0); - gtk_widget_show(GTK_WIDGET(m_pImage)); - } + ensure_image_widget(); if (pDevice) { if (gtk_check_version(3, 20, 0) == nullptr) @@ -4745,6 +4775,19 @@ public: gtk_image_set_from_surface(m_pImage, nullptr); } + virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override + { + ensure_image_widget(); + GdkPixbuf* pixbuf = getPixbuf(rImage); + if (pixbuf) + { + gtk_image_set_from_pixbuf(m_pImage, pixbuf); + g_object_unref(pixbuf); + } + else + gtk_image_set_from_surface(m_pImage, nullptr); + } + virtual void insert_item(int pos, const OUString& rId, const OUString& rStr, const OUString* pIconName, VirtualDevice* pImageSurface, bool bCheck) override { @@ -5685,17 +5728,6 @@ namespace return pixbuf; } - GdkPixbuf* getPixbuf(const css::uno::Reference<css::graphic::XGraphic>& rImage) - { - Image aImage(rImage); - - std::unique_ptr<SvMemoryStream> xMemStm(new SvMemoryStream); - vcl::PNGWriter aWriter(aImage.GetBitmapEx()); - aWriter.Write(*xMemStm); - - return load_icon_from_stream(*xMemStm); - } - void insert_row(GtkListStore* pListStore, GtkTreeIter& iter, int pos, const OUString* pId, const OUString& rText, const OUString* pIconName, const VirtualDevice* pDevice) { if (!pIconName && !pDevice) |