Kaydet (Commit) 03a59d9f authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ScInsertCellDlg

Change-Id: I91118d4c0c5e2fa17fed02377547caa65e11bfdc
Reviewed-on: https://gerrit.libreoffice.org/52824Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst dab87ec9
......@@ -443,8 +443,8 @@ public:
virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup = false ) = 0;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg( vcl::Window* pParent,
bool bDisallowCellMove ) = 0;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove) = 0;
virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent,
const OUString* pStrTitle = nullptr ) = 0;
......
......@@ -88,7 +88,12 @@ IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScInsertCellDlg_Impl);
short AbstractScInsertCellDlg_Impl::Execute()
{
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractScInsertContentsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScInsertTableDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScSelEntryDlg_Impl);
......@@ -113,6 +118,7 @@ IMPL_ABSTDLG_BASE(ScAbstractTabDialog_Impl);
AbstractScLinkedAreaDlg_Impl::~AbstractScLinkedAreaDlg_Impl()
{
}
short AbstractScLinkedAreaDlg_Impl::Execute()
{
return m_xDlg->run();
......@@ -296,7 +302,7 @@ bool AbstractScGroupDlg_Impl::GetColsChecked() const
InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const
{
return pDlg->GetInsCellCmd();
return m_xDlg->GetInsCellCmd();
}
InsertDeleteFlags AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() const
......@@ -714,11 +720,10 @@ VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDl
return VclPtr<AbstractScGroupDlg_Impl>::Create( pDlg );
}
VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( vcl::Window* pParent,
bool bDisallowCellMove )
VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove)
{
VclPtr<ScInsertCellDlg> pDlg = VclPtr<ScInsertCellDlg>::Create( pParent, bDisallowCellMove);
return VclPtr<AbstractScInsertCellDlg_Impl>::Create( pDlg );
return VclPtr<AbstractScInsertCellDlg_Impl>::Create(new ScInsertCellDlg(pParent, bDisallowCellMove));
}
VclPtr<AbstractScInsertContentsDlg> ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( vcl::Window* pParent,
......
......@@ -200,7 +200,13 @@ class AbstractScGroupDlg_Impl : public AbstractScGroupDlg
class AbstractScInsertCellDlg_Impl : public AbstractScInsertCellDlg
{
DECL_ABSTDLG_BASE( AbstractScInsertCellDlg_Impl, ScInsertCellDlg)
std::unique_ptr<ScInsertCellDlg> m_xDlg;
public:
explicit AbstractScInsertCellDlg_Impl(ScInsertCellDlg* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
virtual InsCellCmd GetInsCellCmd() const override ;
};
......@@ -449,8 +455,8 @@ public:
virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup = false) override;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg( vcl::Window* pParent,
bool bDisallowCellMove ) override;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove) override;
virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent,
const OUString* pStrTitle = nullptr ) override;
......
......@@ -20,24 +20,21 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/weld.hxx>
#include <global.hxx>
class ScInsertCellDlg : public ModalDialog
class ScInsertCellDlg : public weld::GenericDialogController
{
private:
VclPtr<RadioButton> m_pBtnCellsDown;
VclPtr<RadioButton> m_pBtnCellsRight;
VclPtr<RadioButton> m_pBtnInsRow;
VclPtr<RadioButton> m_pBtnInsCol;
std::unique_ptr<weld::RadioButton> m_xBtnCellsDown;
std::unique_ptr<weld::RadioButton> m_xBtnCellsRight;
std::unique_ptr<weld::RadioButton> m_xBtnInsRow;
std::unique_ptr<weld::RadioButton> m_xBtnInsCol;
public:
ScInsertCellDlg( vcl::Window* pParent, bool bDisallowCellMove );
ScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove);
virtual ~ScInsertCellDlg() override;
virtual void dispose() override;
InsCellCmd GetInsCellCmd() const;
};
......
......@@ -25,73 +25,76 @@
static sal_uInt8 nInsItemChecked=0;
ScInsertCellDlg::ScInsertCellDlg( vcl::Window* pParent,bool bDisallowCellMove) :
ModalDialog ( pParent, "InsertCellsDialog", "modules/scalc/ui/insertcells.ui")
ScInsertCellDlg::ScInsertCellDlg(weld::Window* pParent,bool bDisallowCellMove)
: GenericDialogController(pParent, "modules/scalc/ui/insertcells.ui", "InsertCellsDialog")
, m_xBtnCellsDown(m_xBuilder->weld_radio_button("down"))
, m_xBtnCellsRight(m_xBuilder->weld_radio_button("right"))
, m_xBtnInsRow(m_xBuilder->weld_radio_button("rows"))
, m_xBtnInsCol(m_xBuilder->weld_radio_button("cols"))
{
get(m_pBtnCellsDown, "down");
get(m_pBtnCellsRight, "right");
get(m_pBtnInsRow, "rows");
get(m_pBtnInsCol, "cols");
if (bDisallowCellMove)
{
m_pBtnCellsDown->Disable();
m_pBtnCellsRight->Disable();
m_pBtnInsRow->Check();
m_xBtnCellsDown->set_sensitive(false);
m_xBtnCellsRight->set_sensitive(false);
m_xBtnInsRow->set_active(true);
switch(nInsItemChecked)
switch (nInsItemChecked)
{
case 2: m_pBtnInsRow->Check();break;
case 3: m_pBtnInsCol->Check();break;
default:m_pBtnInsRow->Check();break;
case 2:
m_xBtnInsRow->set_active(true);
break;
case 3:
m_xBtnInsCol->set_active(true);
break;
default:
m_xBtnInsRow->set_active(true);
break;
}
}
else
{
switch(nInsItemChecked)
switch (nInsItemChecked)
{
case 0: m_pBtnCellsDown->Check();break;
case 1: m_pBtnCellsRight->Check();break;
case 2: m_pBtnInsRow->Check();break;
case 3: m_pBtnInsCol->Check();break;
case 0:
m_xBtnCellsDown->set_active(true);
break;
case 1:
m_xBtnCellsRight->set_active(true);
break;
case 2:
m_xBtnInsRow->set_active(true);
break;
case 3:
m_xBtnInsCol->set_active(true);
break;
}
}
}
ScInsertCellDlg::~ScInsertCellDlg()
{
disposeOnce();
}
void ScInsertCellDlg::dispose()
{
m_pBtnCellsDown.clear();
m_pBtnCellsRight.clear();
m_pBtnInsRow.clear();
m_pBtnInsCol.clear();
ModalDialog::dispose();
}
InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
{
InsCellCmd nReturn = INS_NONE;
if ( m_pBtnCellsDown->IsChecked() )
if (m_xBtnCellsDown->get_active())
{
nInsItemChecked=0;
nReturn = INS_CELLSDOWN;
}
else if ( m_pBtnCellsRight->IsChecked())
else if (m_xBtnCellsRight->get_active())
{
nInsItemChecked=1;
nReturn = INS_CELLSRIGHT;
}
else if ( m_pBtnInsRow->IsChecked() )
else if (m_xBtnInsRow->get_active())
{
nInsItemChecked=2;
nReturn = INS_INSROWS_BEFORE;
}
else if ( m_pBtnInsCol->IsChecked() )
else if (m_xBtnInsCol->get_active())
{
nInsItemChecked=3;
nReturn = INS_INSCOLS_BEFORE;
......
......@@ -293,7 +293,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
ScopedVclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), bTheFlag));
ScopedVclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg(pTabViewShell->GetFrameWeld(), bTheFlag));
OSL_ENSURE(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
eCmd = pDlg->GetInsCellCmd();
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.20.4 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="InsertCellsDialog">
......@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="insertcells|InsertCellsDialog">Insert Cells</property>
<property name="resizable">False</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 internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
......@@ -64,7 +67,6 @@
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
<property name="non_homogeneous">True</property>
</packing>
</child>
</object>
......@@ -104,7 +106,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">right</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -122,7 +123,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">rows</property>
<property name="group">down</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -140,7 +141,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">cols</property>
<property name="group">down</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -194,5 +195,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.0"/>
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="BookmarkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
......@@ -32,7 +32,6 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
......@@ -47,7 +46,6 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
......@@ -63,7 +61,6 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
......
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