weld ScSolverValueDialog
Change-Id: I1c55d184052482fc472d66069ea8722cd27d1543 Reviewed-on: https://gerrit.libreoffice.org/54353 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -83,15 +83,14 @@ public:
|
||||
sal_Int32 GetValue() const;
|
||||
};
|
||||
|
||||
class ScSolverValueDialog : public ModalDialog
|
||||
class ScSolverValueDialog : public weld::GenericDialogController
|
||||
{
|
||||
VclPtr<VclFrame> m_pFrame;
|
||||
VclPtr<Edit> m_pEdValue;
|
||||
std::unique_ptr<weld::Frame> m_xFrame;
|
||||
std::unique_ptr<weld::Entry> m_xEdValue;
|
||||
|
||||
public:
|
||||
ScSolverValueDialog( vcl::Window * pParent );
|
||||
ScSolverValueDialog(weld::Window* pParent);
|
||||
virtual ~ScSolverValueDialog() override;
|
||||
virtual void dispose() override;
|
||||
|
||||
void SetOptionName( const OUString& rName );
|
||||
void SetValue( double fValue );
|
||||
|
@@ -322,12 +322,12 @@ void ScSolverOptionsDialog::EditOption()
|
||||
{
|
||||
if ( pStringItem->IsDouble() )
|
||||
{
|
||||
ScopedVclPtrInstance< ScSolverValueDialog > aValDialog( this );
|
||||
aValDialog->SetOptionName( pStringItem->GetText() );
|
||||
aValDialog->SetValue( pStringItem->GetDoubleValue() );
|
||||
if ( aValDialog->Execute() == RET_OK )
|
||||
ScSolverValueDialog aValDialog(GetFrameWeld());
|
||||
aValDialog.SetOptionName( pStringItem->GetText() );
|
||||
aValDialog.SetValue( pStringItem->GetDoubleValue() );
|
||||
if (aValDialog.run() == RET_OK)
|
||||
{
|
||||
pStringItem->SetDoubleValue( aValDialog->GetValue() );
|
||||
pStringItem->SetDoubleValue( aValDialog.GetValue() );
|
||||
m_pLbSettings->InvalidateEntry( pEntry );
|
||||
}
|
||||
}
|
||||
@@ -429,41 +429,32 @@ sal_Int32 ScSolverIntegerDialog::GetValue() const
|
||||
return static_cast<sal_Int32>(nValue);
|
||||
}
|
||||
|
||||
ScSolverValueDialog::ScSolverValueDialog( vcl::Window * pParent )
|
||||
: ModalDialog( pParent, "DoubleDialog",
|
||||
"modules/scalc/ui/doubledialog.ui" )
|
||||
ScSolverValueDialog::ScSolverValueDialog(weld::Window* pParent)
|
||||
: GenericDialogController(pParent, "modules/scalc/ui/doubledialog.ui", "DoubleDialog")
|
||||
, m_xFrame(m_xBuilder->weld_frame("frame"))
|
||||
, m_xEdValue(m_xBuilder->weld_entry("value"))
|
||||
{
|
||||
get(m_pFrame, "frame");
|
||||
get(m_pEdValue, "value");
|
||||
}
|
||||
|
||||
ScSolverValueDialog::~ScSolverValueDialog()
|
||||
{
|
||||
disposeOnce();
|
||||
}
|
||||
|
||||
void ScSolverValueDialog::dispose()
|
||||
{
|
||||
m_pFrame.clear();
|
||||
m_pEdValue.clear();
|
||||
ModalDialog::dispose();
|
||||
}
|
||||
|
||||
void ScSolverValueDialog::SetOptionName( const OUString& rName )
|
||||
{
|
||||
m_pFrame->set_label(rName);
|
||||
m_xFrame->set_label(rName);
|
||||
}
|
||||
|
||||
void ScSolverValueDialog::SetValue( double fValue )
|
||||
{
|
||||
m_pEdValue->SetText( rtl::math::doubleToUString( fValue,
|
||||
m_xEdValue->set_text( rtl::math::doubleToUString( fValue,
|
||||
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
|
||||
ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ) );
|
||||
}
|
||||
|
||||
double ScSolverValueDialog::GetValue() const
|
||||
{
|
||||
OUString aInput = m_pEdValue->GetText();
|
||||
OUString aInput = m_xEdValue->get_text();
|
||||
|
||||
rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
|
||||
sal_Int32 nParseEnd = 0;
|
||||
|
@@ -1,11 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sc">
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<object class="GtkDialog" id="DoubleDialog">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="title" translatable="yes" context="doubledialog|DoubleDialog">Edit Setting</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">0</property>
|
||||
<property name="default_height">0</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="can_focus">False</property>
|
||||
@@ -75,6 +82,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="activates_default">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -83,6 +83,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
</child>
|
||||
|
Reference in New Issue
Block a user