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

weld ScSolverDlg

Change-Id: I35fa2f63eb47f18289892ffcf042d041752bfbd7
Reviewed-on: https://gerrit.libreoffice.org/70653
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst dd5fbb68
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDlgWrapper) DECL_WRAPPER_WITHID_CONTROLLER(ScNameDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDefDlgWrapper) DECL_WRAPPER_WITHID_CONTROLLER(ScNameDefDlgWrapper)
DECL_WRAPPER_WITHID(ScSolverDlgWrapper) DECL_WRAPPER_WITHID_CONTROLLER(ScSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper) DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScXMLSourceDlgWrapper) DECL_WRAPPER_WITHID(ScXMLSourceDlgWrapper)
DECL_WRAPPER_WITHID(ScPivotLayoutWrapper) DECL_WRAPPER_WITHID(ScPivotLayoutWrapper)
......
...@@ -33,54 +33,59 @@ enum ScSolverErr ...@@ -33,54 +33,59 @@ enum ScSolverErr
SOLVERR_INVALID_TARGETVALUE SOLVERR_INVALID_TARGETVALUE
}; };
class ScSolverDlg : public ScAnyRefDlg class ScSolverDlg : public ScAnyRefDlgController
{ {
public: public:
ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
ScDocument* pDocument, ScDocument* pDocument,
const ScAddress& aCursorPos ); const ScAddress& aCursorPos );
virtual ~ScSolverDlg() override; virtual ~ScSolverDlg() override;
virtual void dispose() override;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override; virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
virtual bool IsRefInputMode() const override; virtual bool IsRefInputMode() const override;
virtual void SetActive() override; virtual void SetActive() override;
virtual bool Close() override; virtual void Close() override;
private: private:
VclPtr<FixedText> m_pFtFormulaCell;
VclPtr<formula::RefEdit> m_pEdFormulaCell;
VclPtr<formula::RefButton> m_pRBFormulaCell;
VclPtr<Edit> m_pEdTargetVal;
VclPtr<FixedText> m_pFtVariableCell;
VclPtr<formula::RefEdit> m_pEdVariableCell;
VclPtr<formula::RefButton> m_pRBVariableCell;
VclPtr<OKButton> m_pBtnOk;
VclPtr<CancelButton> m_pBtnCancel;
ScAddress theFormulaCell; ScAddress theFormulaCell;
ScAddress theVariableCell; ScAddress theVariableCell;
OUString theTargetValStr; OUString theTargetValStr;
ScDocument* pDoc; ScDocument* pDoc;
const SCTAB nCurTab; const SCTAB nCurTab;
VclPtr<formula::RefEdit> pEdActive;
bool bDlgLostFocus; bool bDlgLostFocus;
const OUString errMsgInvalidVar; const OUString errMsgInvalidVar;
const OUString errMsgInvalidForm; const OUString errMsgInvalidForm;
const OUString errMsgNoFormula; const OUString errMsgNoFormula;
const OUString errMsgInvalidVal; const OUString errMsgInvalidVal;
formula::WeldRefEdit* m_pEdActive;
std::unique_ptr<weld::Label> m_xFtFormulaCell;
std::unique_ptr<formula::WeldRefEdit> m_xEdFormulaCell;
std::unique_ptr<formula::WeldRefButton> m_xRBFormulaCell;
std::unique_ptr<weld::Entry> m_xEdTargetVal;
std::unique_ptr<weld::Label> m_xFtVariableCell;
std::unique_ptr<formula::WeldRefEdit> m_xEdVariableCell;
std::unique_ptr<formula::WeldRefButton> m_xRBVariableCell;
std::unique_ptr<weld::Button> m_xBtnOk;
std::unique_ptr<weld::Button> m_xBtnCancel;
void Init(); void Init();
bool CheckTargetValue( const OUString& rStrVal ); bool CheckTargetValue( const OUString& rStrVal );
void RaiseError( ScSolverErr eError ); void RaiseError( ScSolverErr eError );
DECL_LINK( BtnHdl, Button*, void ); DECL_LINK( BtnHdl, weld::Button&, void );
DECL_LINK( GetFocusHdl, Control&, void ); DECL_LINK( GetEditFocusHdl, formula::WeldRefEdit&, void );
DECL_LINK( LoseFocusHdl, Control&, void ); DECL_LINK( LoseEditFocusHdl, formula::WeldRefEdit&, void );
DECL_LINK( GetButtonFocusHdl, formula::WeldRefButton&, void );
DECL_LINK( LoseButtonFocusHdl, formula::WeldRefButton&, void );
DECL_LINK( GetFocusHdl, weld::Widget&, void );
}; };
#endif // INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX #endif // INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX
......
...@@ -42,86 +42,75 @@ namespace ...@@ -42,86 +42,75 @@ namespace
} }
} }
ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
ScDocument* pDocument, ScDocument* pDocument,
const ScAddress& aCursorPos ) const ScAddress& aCursorPos )
: ScAnyRefDlg(pB, pCW, pParent, "GoalSeekDialog", "modules/scalc/ui/goalseekdlg.ui") : ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/goalseekdlg.ui", "GoalSeekDialog")
, theFormulaCell(aCursorPos) , theFormulaCell(aCursorPos)
, theVariableCell(aCursorPos) , theVariableCell(aCursorPos)
, pDoc(pDocument) , pDoc(pDocument)
, nCurTab(aCursorPos.Tab()) , nCurTab(aCursorPos.Tab())
, pEdActive(nullptr)
, bDlgLostFocus(false) , bDlgLostFocus(false)
, errMsgInvalidVar(ScResId(STR_INVALIDVAR)) , errMsgInvalidVar(ScResId(STR_INVALIDVAR))
, errMsgInvalidForm(ScResId(STR_INVALIDFORM)) , errMsgInvalidForm(ScResId(STR_INVALIDFORM))
, errMsgNoFormula(ScResId(STR_NOFORMULA)) , errMsgNoFormula(ScResId(STR_NOFORMULA))
, errMsgInvalidVal(ScResId(STR_INVALIDVAL)) , errMsgInvalidVal(ScResId(STR_INVALIDVAL))
, m_pEdActive(nullptr)
, m_xFtFormulaCell(m_xBuilder->weld_label("formulatext"))
, m_xEdFormulaCell(new formula::WeldRefEdit(m_xBuilder->weld_entry("formulaedit")))
, m_xRBFormulaCell(new formula::WeldRefButton(m_xBuilder->weld_button("formulabutton")))
, m_xEdTargetVal(m_xBuilder->weld_entry("target"))
, m_xFtVariableCell(m_xBuilder->weld_label("vartext"))
, m_xEdVariableCell(new formula::WeldRefEdit(m_xBuilder->weld_entry("varedit")))
, m_xRBVariableCell(new formula::WeldRefButton(m_xBuilder->weld_button("varbutton")))
, m_xBtnOk(m_xBuilder->weld_button("ok"))
, m_xBtnCancel(m_xBuilder->weld_button("cancel"))
{ {
get(m_pFtFormulaCell, "formulatext"); m_xEdFormulaCell->SetReferences(this, m_xFtFormulaCell.get());
get(m_pEdFormulaCell, "formulaedit"); m_xRBFormulaCell->SetReferences(this, m_xEdFormulaCell.get());
m_pEdFormulaCell->SetReferences(this, m_pFtFormulaCell); m_xEdVariableCell->SetReferences(this, m_xFtVariableCell.get());
get(m_pRBFormulaCell, "formulabutton"); m_xRBVariableCell->SetReferences(this, m_xEdVariableCell.get());
m_pRBFormulaCell->SetReferences(this, m_pEdFormulaCell);
get(m_pEdTargetVal, "target");
get(m_pFtVariableCell, "vartext");
get(m_pEdVariableCell, "varedit");
m_pEdVariableCell->SetReferences(this, m_pFtVariableCell);
get(m_pRBVariableCell, "varbutton");
m_pRBVariableCell->SetReferences(this, m_pEdVariableCell);
get(m_pBtnOk, "ok");
get(m_pBtnCancel, "cancel");
Init(); Init();
} }
ScSolverDlg::~ScSolverDlg() ScSolverDlg::~ScSolverDlg()
{ {
disposeOnce();
}
void ScSolverDlg::dispose()
{
m_pFtFormulaCell.clear();
m_pEdFormulaCell.clear();
m_pRBFormulaCell.clear();
m_pEdTargetVal.clear();
m_pFtVariableCell.clear();
m_pEdVariableCell.clear();
m_pRBVariableCell.clear();
m_pBtnOk.clear();
m_pBtnCancel.clear();
pEdActive.clear();
ScAnyRefDlg::dispose();
} }
void ScSolverDlg::Init() void ScSolverDlg::Init()
{ {
m_pBtnOk->SetClickHdl( LINK( this, ScSolverDlg, BtnHdl ) ); m_xBtnOk->connect_clicked( LINK( this, ScSolverDlg, BtnHdl ) );
m_pBtnCancel->SetClickHdl( LINK( this, ScSolverDlg, BtnHdl ) ); m_xBtnCancel->connect_clicked( LINK( this, ScSolverDlg, BtnHdl ) );
Link<Control&,void> aLink = LINK( this, ScSolverDlg, GetFocusHdl ); Link<formula::WeldRefEdit&,void> aEditLink = LINK( this, ScSolverDlg, GetEditFocusHdl );
m_pEdFormulaCell->SetGetFocusHdl( aLink ); m_xEdFormulaCell->SetGetFocusHdl( aEditLink );
m_pRBFormulaCell->SetGetFocusHdl( aLink ); m_xEdVariableCell->SetGetFocusHdl( aEditLink );
m_pEdVariableCell->SetGetFocusHdl( aLink );
m_pRBVariableCell->SetGetFocusHdl( aLink ); Link<formula::WeldRefButton&,void> aButtonLink = LINK( this, ScSolverDlg, GetButtonFocusHdl );
m_pEdTargetVal->SetGetFocusHdl( aLink ); m_xRBFormulaCell->SetGetFocusHdl( aButtonLink );
m_xRBVariableCell->SetGetFocusHdl( aButtonLink );
aLink = LINK( this, ScSolverDlg, LoseFocusHdl );
m_pEdFormulaCell->SetLoseFocusHdl ( aLink ); m_xEdTargetVal->connect_focus_in(LINK(this, ScSolverDlg, GetFocusHdl));
m_pRBFormulaCell->SetLoseFocusHdl ( aLink );
m_pEdVariableCell->SetLoseFocusHdl ( aLink ); aEditLink = LINK( this, ScSolverDlg, LoseEditFocusHdl );
m_pRBVariableCell->SetLoseFocusHdl ( aLink ); m_xEdFormulaCell->SetLoseFocusHdl ( aEditLink );
m_xEdVariableCell->SetLoseFocusHdl ( aEditLink );
aButtonLink = LINK( this, ScSolverDlg, LoseButtonFocusHdl );
m_xRBFormulaCell->SetLoseFocusHdl ( aButtonLink );
m_xRBVariableCell->SetLoseFocusHdl ( aButtonLink );
OUString aStr(theFormulaCell.Format(ScRefFlags::ADDR_ABS, nullptr, pDoc->GetAddressConvention())); OUString aStr(theFormulaCell.Format(ScRefFlags::ADDR_ABS, nullptr, pDoc->GetAddressConvention()));
m_pEdFormulaCell->SetText( aStr ); m_xEdFormulaCell->SetText( aStr );
m_pEdFormulaCell->GrabFocus(); m_xEdFormulaCell->GrabFocus();
pEdActive = m_pEdFormulaCell; m_pEdActive = m_xEdFormulaCell.get();
} }
bool ScSolverDlg::Close() void ScSolverDlg::Close()
{ {
return DoClose( ScSolverDlgWrapper::GetChildWindowId() ); DoClose( ScSolverDlgWrapper::GetChildWindowId() );
} }
void ScSolverDlg::SetActive() void ScSolverDlg::SetActive()
...@@ -129,22 +118,22 @@ void ScSolverDlg::SetActive() ...@@ -129,22 +118,22 @@ void ScSolverDlg::SetActive()
if ( bDlgLostFocus ) if ( bDlgLostFocus )
{ {
bDlgLostFocus = false; bDlgLostFocus = false;
if( pEdActive ) if( m_pEdActive )
pEdActive->GrabFocus(); m_pEdActive->GrabFocus();
} }
else else
{ {
GrabFocus(); m_xDialog->grab_focus();
} }
RefInputDone(); RefInputDone();
} }
void ScSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) void ScSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{ {
if( pEdActive ) if( m_pEdActive )
{ {
if ( rRef.aStart != rRef.aEnd ) if ( rRef.aStart != rRef.aEnd )
RefInputStart(pEdActive); RefInputStart(m_pEdActive);
ScAddress aAdr = rRef.aStart; ScAddress aAdr = rRef.aStart;
ScRefFlags nFmt = ( aAdr.Tab() == nCurTab ) ScRefFlags nFmt = ( aAdr.Tab() == nCurTab )
...@@ -152,11 +141,11 @@ void ScSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) ...@@ -152,11 +141,11 @@ void ScSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
: ScRefFlags::ADDR_ABS_3D; : ScRefFlags::ADDR_ABS_3D;
OUString aStr(aAdr.Format(nFmt, pDocP, pDocP->GetAddressConvention())); OUString aStr(aAdr.Format(nFmt, pDocP, pDocP->GetAddressConvention()));
pEdActive->SetRefString( aStr ); m_pEdActive->SetRefString( aStr );
if ( pEdActive == m_pEdFormulaCell ) if (m_pEdActive == m_xEdFormulaCell.get())
theFormulaCell = aAdr; theFormulaCell = aAdr;
else if ( pEdActive == m_pEdVariableCell ) else if (m_pEdActive == m_xEdVariableCell.get())
theVariableCell = aAdr; theVariableCell = aAdr;
} }
} }
...@@ -166,30 +155,30 @@ void ScSolverDlg::RaiseError( ScSolverErr eError ) ...@@ -166,30 +155,30 @@ void ScSolverDlg::RaiseError( ScSolverErr eError )
switch ( eError ) switch ( eError )
{ {
case SOLVERR_NOFORMULA: case SOLVERR_NOFORMULA:
lclErrorDialog(GetFrameWeld(), errMsgNoFormula, lclErrorDialog(m_xDialog.get(), errMsgNoFormula,
[this](sal_Int32 /*nResult*/) { [this](sal_Int32 /*nResult*/) {
m_pEdFormulaCell->GrabFocus(); m_xEdFormulaCell->GrabFocus();
}); });
break; break;
case SOLVERR_INVALID_FORMULA: case SOLVERR_INVALID_FORMULA:
lclErrorDialog(GetFrameWeld(), errMsgInvalidForm, lclErrorDialog(m_xDialog.get(), errMsgInvalidForm,
[this](sal_Int32 /*nResult*/) { [this](sal_Int32 /*nResult*/) {
m_pEdFormulaCell->GrabFocus(); m_xEdFormulaCell->GrabFocus();
}); });
break; break;
case SOLVERR_INVALID_VARIABLE: case SOLVERR_INVALID_VARIABLE:
lclErrorDialog(GetFrameWeld(), errMsgInvalidVar, lclErrorDialog(m_xDialog.get(), errMsgInvalidVar,
[this](sal_Int32 /*nResult*/) { [this](sal_Int32 /*nResult*/) {
m_pEdVariableCell->GrabFocus(); m_xEdVariableCell->GrabFocus();
}); });
break; break;
case SOLVERR_INVALID_TARGETVALUE: case SOLVERR_INVALID_TARGETVALUE:
lclErrorDialog(GetFrameWeld(), errMsgInvalidVal, lclErrorDialog(m_xDialog.get(), errMsgInvalidVal,
[this](sal_Int32 /*nResult*/) { [this](sal_Int32 /*nResult*/) {
m_pEdTargetVal->GrabFocus(); m_xEdTargetVal->grab_focus();
}); });
break; break;
} }
...@@ -197,7 +186,7 @@ void ScSolverDlg::RaiseError( ScSolverErr eError ) ...@@ -197,7 +186,7 @@ void ScSolverDlg::RaiseError( ScSolverErr eError )
bool ScSolverDlg::IsRefInputMode() const bool ScSolverDlg::IsRefInputMode() const
{ {
return pEdActive != nullptr; return m_pEdActive != nullptr;
} }
bool ScSolverDlg::CheckTargetValue( const OUString& rStrVal ) bool ScSolverDlg::CheckTargetValue( const OUString& rStrVal )
...@@ -210,11 +199,11 @@ bool ScSolverDlg::CheckTargetValue( const OUString& rStrVal ) ...@@ -210,11 +199,11 @@ bool ScSolverDlg::CheckTargetValue( const OUString& rStrVal )
// Handler: // Handler:
IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void ) IMPL_LINK(ScSolverDlg, BtnHdl, weld::Button&, rBtn, void)
{ {
if (pBtn == m_pBtnOk) if (&rBtn == m_xBtnOk.get())
{ {
theTargetValStr = m_pEdTargetVal->GetText(); theTargetValStr = m_xEdTargetVal->get_text();
// The following code checks: // The following code checks:
// 1. do the strings contain correct references / defined names? // 1. do the strings contain correct references / defined names?
...@@ -222,8 +211,8 @@ IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void ) ...@@ -222,8 +211,8 @@ IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void )
// 3. has a valid target value been entered? // 3. has a valid target value been entered?
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
ScRefFlags nRes1 = theFormulaCell .Parse( m_pEdFormulaCell->GetText(), pDoc, eConv ); ScRefFlags nRes1 = theFormulaCell .Parse( m_xEdFormulaCell->GetText(), pDoc, eConv );
ScRefFlags nRes2 = theVariableCell.Parse( m_pEdVariableCell->GetText(), pDoc, eConv ); ScRefFlags nRes2 = theVariableCell.Parse( m_xEdVariableCell->GetText(), pDoc, eConv );
if ( (nRes1 & ScRefFlags::VALID) == ScRefFlags::VALID ) if ( (nRes1 & ScRefFlags::VALID) == ScRefFlags::VALID )
{ {
...@@ -250,7 +239,7 @@ IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void ) ...@@ -250,7 +239,7 @@ IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void )
GetBindings().GetDispatcher()->ExecuteList(SID_SOLVE, GetBindings().GetDispatcher()->ExecuteList(SID_SOLVE,
SfxCallMode::SLOT | SfxCallMode::RECORD, SfxCallMode::SLOT | SfxCallMode::RECORD,
{ &aOutItem }); { &aOutItem });
Close(); response(RET_OK);
} }
else RaiseError( SOLVERR_NOFORMULA ); else RaiseError( SOLVERR_NOFORMULA );
} }
...@@ -260,31 +249,49 @@ IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void ) ...@@ -260,31 +249,49 @@ IMPL_LINK( ScSolverDlg, BtnHdl, Button*, pBtn, void )
} }
else RaiseError( SOLVERR_INVALID_FORMULA ); else RaiseError( SOLVERR_INVALID_FORMULA );
} }
else if (pBtn == m_pBtnCancel) else if (&rBtn == m_xBtnCancel.get())
{ {
Close(); response(RET_CANCEL);
} }
} }
IMPL_LINK( ScSolverDlg, GetFocusHdl, Control&, rCtrl, void ) IMPL_LINK(ScSolverDlg, GetEditFocusHdl, formula::WeldRefEdit&, rCtrl, void)
{
if (&rCtrl == m_xEdFormulaCell.get())
m_pEdActive = m_xEdFormulaCell.get();
else if (&rCtrl == m_xEdVariableCell.get())
m_pEdActive = m_xEdVariableCell.get();
if (m_pEdActive)
m_pEdActive->SelectAll();
}
IMPL_LINK_NOARG(ScSolverDlg, GetFocusHdl, weld::Widget&, void)
{
m_pEdActive = nullptr;
m_xEdTargetVal->select_region(0, -1);
}
IMPL_LINK(ScSolverDlg, GetButtonFocusHdl, formula::WeldRefButton&, rCtrl, void)
{ {
Edit* pEdit = nullptr; if (&rCtrl == m_xRBFormulaCell.get())
pEdActive = nullptr; m_pEdActive = m_xEdFormulaCell.get();
else if (&rCtrl == m_xRBVariableCell.get())
if( (&rCtrl == static_cast<Control*>(m_pEdFormulaCell)) || (&rCtrl == static_cast<Control*>(m_pRBFormulaCell)) ) m_pEdActive = m_xEdVariableCell.get();
pEdit = pEdActive = m_pEdFormulaCell;
else if( (&rCtrl == static_cast<Control*>(m_pEdVariableCell)) || (&rCtrl == static_cast<Control*>(m_pRBVariableCell)) ) if (m_pEdActive)
pEdit = pEdActive = m_pEdVariableCell; m_pEdActive->SelectAll();
else if( &rCtrl == static_cast<Control*>(m_pEdTargetVal) )
pEdit = m_pEdTargetVal;
if( pEdit )
pEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
} }
IMPL_LINK_NOARG(ScSolverDlg, LoseFocusHdl, Control&, void) IMPL_LINK_NOARG(ScSolverDlg, LoseEditFocusHdl, formula::WeldRefEdit&, void)
{ {
bDlgLostFocus = !IsActive(); bDlgLostFocus = !m_xDialog->has_toplevel_focus();
} }
IMPL_LINK_NOARG(ScSolverDlg, LoseButtonFocusHdl, formula::WeldRefButton&, void)
{
bDlgLostFocus = !m_xDialog->has_toplevel_focus();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
SFX_IMPL_CHILDWINDOW_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME) SFX_IMPL_CHILDWINDOW_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME)
SFX_IMPL_CHILDWINDOW_WITHID(ScNameDefDlgWrapper, FID_ADD_NAME ) SFX_IMPL_CHILDWINDOW_WITHID(ScNameDefDlgWrapper, FID_ADD_NAME )
SFX_IMPL_MODELESSDIALOG_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE ) SFX_IMPL_CHILDWINDOW_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
SFX_IMPL_MODELESSDIALOG_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) SFX_IMPL_MODELESSDIALOG_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER )
SFX_IMPL_MODELESSDIALOG_WITHID(ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE) SFX_IMPL_MODELESSDIALOG_WITHID(ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE)
SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE ) SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE )
...@@ -125,7 +125,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScNameDlgWrapper, FID_DEFINE_NAME ) ...@@ -125,7 +125,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScNameDlgWrapper, FID_DEFINE_NAME )
IMPL_CONTROLLER_CHILD_CTOR( ScNameDefDlgWrapper, FID_ADD_NAME ) IMPL_CONTROLLER_CHILD_CTOR( ScNameDefDlgWrapper, FID_ADD_NAME )
IMPL_CHILD_CTOR( ScSolverDlgWrapper, SID_OPENDLG_SOLVE ) IMPL_CONTROLLER_CHILD_CTOR( ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
IMPL_CHILD_CTOR( ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) IMPL_CHILD_CTOR( ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER )
......
...@@ -249,16 +249,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog( ...@@ -249,16 +249,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
} }
break; break;
case SID_OPENDLG_SOLVE:
{
ScViewData& rViewData = GetViewData();
ScAddress aCurPos( rViewData.GetCurX(),
rViewData.GetCurY(),
rViewData.GetTabNo());
pResult = VclPtr<ScSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
case SID_OPENDLG_OPTSOLVER: case SID_OPENDLG_OPTSOLVER:
{ {
ScViewData& rViewData = GetViewData(); ScViewData& rViewData = GetViewData();
...@@ -489,6 +479,15 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont ...@@ -489,6 +479,15 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
case SID_DEFINE_COLROWNAMERANGES: case SID_DEFINE_COLROWNAMERANGES:
xResult.reset(new ScColRowNameRangesDlg(pB, pCW, pParent, &GetViewData())); xResult.reset(new ScColRowNameRangesDlg(pB, pCW, pParent, &GetViewData()));
break; break;
case SID_OPENDLG_SOLVE:
{
ScViewData& rViewData = GetViewData();
ScAddress aCurPos( rViewData.GetCurX(),
rViewData.GetCurY(),
rViewData.GetTabNo());
xResult.reset(new ScSolverDlg(pB, pCW, pParent, rViewData.GetDocument(), aCurPos));
break;
}
} }
if (xResult) if (xResult)
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.22.1 -->
<interface domain="sc"> <interface domain="sc">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="GoalSeekDialog"> <object class="GtkDialog" id="GoalSeekDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes" context="goalseekdlg|GoalSeekDialog">Goal Seek</property> <property name="title" translatable="yes" context="goalseekdlg|GoalSeekDialog">Goal Seek</property>
<property name="default_width">-1</property>
<property name="default_height">-1</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child internal-child="action_area"> <child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1"> <object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="layout_style">end</property>
<property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="ok"> <object class="GtkButton" id="cancel">
<property name="label">gtk-ok</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -34,10 +36,12 @@ ...@@ -34,10 +36,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="cancel"> <object class="GtkButton" id="ok">
<property name="label">gtk-cancel</property> <property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -59,6 +63,7 @@ ...@@ -59,6 +63,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -136,11 +141,12 @@ ...@@ -136,11 +141,12 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="foruilo-RefEdit" id="formulaedit"> <object class="GtkEntry" id="formulaedit">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="activates_default">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -149,7 +155,7 @@ ...@@ -149,7 +155,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="foruilo-RefButton" id="formulabutton"> <object class="GtkButton" id="formulabutton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
...@@ -172,6 +178,7 @@ ...@@ -172,6 +178,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="activates_default">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
...@@ -185,11 +192,12 @@ ...@@ -185,11 +192,12 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="foruilo-RefEdit" id="varedit"> <object class="GtkEntry" id="varedit">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="activates_default">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -198,7 +206,7 @@ ...@@ -198,7 +206,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="foruilo-RefButton" id="varbutton"> <object class="GtkButton" id="varbutton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
...@@ -239,8 +247,8 @@ ...@@ -239,8 +247,8 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget> <action-widget response="-6">cancel</action-widget>
<action-widget response="-5">ok</action-widget>
<action-widget response="-11">help</action-widget> <action-widget response="-11">help</action-widget>
</action-widgets> </action-widgets>
</object> </object>
......
...@@ -92,6 +92,8 @@ sc/uiconfig/scalc/ui/fourieranalysisdialog.ui://GtkButton[@id='output-range-butt ...@@ -92,6 +92,8 @@ sc/uiconfig/scalc/ui/fourieranalysisdialog.ui://GtkButton[@id='output-range-butt
sc/uiconfig/scalc/ui/functionpanel.ui://GtkComboBoxText[@id='category'] no-labelled-by sc/uiconfig/scalc/ui/functionpanel.ui://GtkComboBoxText[@id='category'] no-labelled-by
sc/uiconfig/scalc/ui/functionpanel.ui://GtkTreeView[@id='funclist:border'] no-labelled-by sc/uiconfig/scalc/ui/functionpanel.ui://GtkTreeView[@id='funclist:border'] no-labelled-by
sc/uiconfig/scalc/ui/functionpanel.ui://GtkLabel[@id='funcdesc:border'] orphan-label sc/uiconfig/scalc/ui/functionpanel.ui://GtkLabel[@id='funcdesc:border'] orphan-label
sc/uiconfig/scalc/ui/goalseekdlg.ui://GtkButton[@id='formulabutton'] button-no-label
sc/uiconfig/scalc/ui/goalseekdlg.ui://GtkButton[@id='varbutton'] button-no-label
sc/uiconfig/scalc/ui/groupbydate.ui://GtkMenuButton[@id='start_date'] button-no-label sc/uiconfig/scalc/ui/groupbydate.ui://GtkMenuButton[@id='start_date'] button-no-label
sc/uiconfig/scalc/ui/groupbydate.ui://GtkMenuButton[@id='end_date'] button-no-label sc/uiconfig/scalc/ui/groupbydate.ui://GtkMenuButton[@id='end_date'] button-no-label
sc/uiconfig/scalc/ui/groupbynumber.ui://GtkEntry[@id='edit_by'] no-labelled-by sc/uiconfig/scalc/ui/groupbynumber.ui://GtkEntry[@id='edit_by'] no-labelled-by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment