weld SvxDistributePage

Change-Id: Iaf303e9e75f27fb84b7f58a3b653fd4058661f7f
Reviewed-on: https://gerrit.libreoffice.org/60825
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2018-09-20 16:16:05 +01:00
parent 5d80a776ca
commit 7b4bb1d190
3 changed files with 66 additions and 87 deletions

View file

@ -29,23 +29,22 @@ class SvxDistributePage : public SvxTabPage
SvxDistributeHorizontal m_eDistributeHor;
SvxDistributeVertical m_eDistributeVer;
VclPtr<RadioButton> m_pBtnHorNone;
VclPtr<RadioButton> m_pBtnHorLeft;
VclPtr<RadioButton> m_pBtnHorCenter;
VclPtr<RadioButton> m_pBtnHorDistance;
VclPtr<RadioButton> m_pBtnHorRight;
VclPtr<RadioButton> m_pBtnVerNone;
VclPtr<RadioButton> m_pBtnVerTop;
VclPtr<RadioButton> m_pBtnVerCenter;
VclPtr<RadioButton> m_pBtnVerDistance;
VclPtr<RadioButton> m_pBtnVerBottom;
std::unique_ptr<weld::RadioButton> m_xBtnHorNone;
std::unique_ptr<weld::RadioButton> m_xBtnHorLeft;
std::unique_ptr<weld::RadioButton> m_xBtnHorCenter;
std::unique_ptr<weld::RadioButton> m_xBtnHorDistance;
std::unique_ptr<weld::RadioButton> m_xBtnHorRight;
std::unique_ptr<weld::RadioButton> m_xBtnVerNone;
std::unique_ptr<weld::RadioButton> m_xBtnVerTop;
std::unique_ptr<weld::RadioButton> m_xBtnVerCenter;
std::unique_ptr<weld::RadioButton> m_xBtnVerDistance;
std::unique_ptr<weld::RadioButton> m_xBtnVerBottom;
public:
SvxDistributePage(vcl::Window* pWindow, const SfxItemSet& rInAttrs,
SvxDistributePage(TabPageParent pWindow, const SfxItemSet& rInAttrs,
SvxDistributeHorizontal eHor,
SvxDistributeVertical eVer);
virtual ~SvxDistributePage() override;
virtual void dispose() override;
virtual bool FillItemSet(SfxItemSet*) override;
virtual void Reset(const SfxItemSet*) override;

View file

@ -56,48 +56,30 @@ void SvxDistributeDialog::dispose()
|*
\************************************************************************/
SvxDistributePage::SvxDistributePage(vcl::Window* pWindow,
SvxDistributePage::SvxDistributePage(TabPageParent pWindow,
const SfxItemSet& rInAttrs, SvxDistributeHorizontal eHor,
SvxDistributeVertical eVer)
: SvxTabPage(pWindow, "DistributionPage", "cui/ui/distributionpage.ui",
: SvxTabPage(pWindow, "cui/ui/distributionpage.ui", "DistributionPage",
rInAttrs)
, m_eDistributeHor(eHor)
, m_eDistributeVer(eVer)
, m_xBtnHorNone(m_xBuilder->weld_radio_button("hornone"))
, m_xBtnHorLeft(m_xBuilder->weld_radio_button("horleft"))
, m_xBtnHorCenter(m_xBuilder->weld_radio_button("horcenter"))
, m_xBtnHorDistance(m_xBuilder->weld_radio_button("hordistance"))
, m_xBtnHorRight(m_xBuilder->weld_radio_button("horright"))
, m_xBtnVerNone(m_xBuilder->weld_radio_button("vernone"))
, m_xBtnVerTop(m_xBuilder->weld_radio_button("vertop"))
, m_xBtnVerCenter(m_xBuilder->weld_radio_button("vercenter"))
, m_xBtnVerDistance(m_xBuilder->weld_radio_button("verdistance"))
, m_xBtnVerBottom(m_xBuilder->weld_radio_button("verbottom"))
{
get(m_pBtnHorNone, "hornone");
get(m_pBtnHorLeft, "horleft");
get(m_pBtnHorCenter, "horcenter");
get(m_pBtnHorDistance, "hordistance");
get(m_pBtnHorRight, "horright");
get(m_pBtnVerNone, "vernone");
get(m_pBtnVerTop, "vertop");
get(m_pBtnVerCenter, "vercenter");
get(m_pBtnVerDistance, "verdistance");
get(m_pBtnVerBottom, "verbottom");
}
SvxDistributePage::~SvxDistributePage()
{
disposeOnce();
}
void SvxDistributePage::dispose()
{
m_pBtnHorNone.clear();
m_pBtnHorLeft.clear();
m_pBtnHorCenter.clear();
m_pBtnHorDistance.clear();
m_pBtnHorRight.clear();
m_pBtnVerNone.clear();
m_pBtnVerTop.clear();
m_pBtnVerCenter.clear();
m_pBtnVerDistance.clear();
m_pBtnVerBottom.clear();
SvxTabPage::dispose();
}
void SvxDistributePage::PointChanged(vcl::Window* /*pWindow*/, RectPoint /*eRP*/)
{
}
@ -114,34 +96,34 @@ void SvxDistributePage::PointChanged(weld::DrawingArea*, RectPoint /*eRP*/)
void SvxDistributePage::Reset(const SfxItemSet* )
{
m_pBtnHorNone->SetState(false);
m_pBtnHorLeft->SetState(false);
m_pBtnHorCenter->SetState(false);
m_pBtnHorDistance->SetState(false);
m_pBtnHorRight->SetState(false);
m_xBtnHorNone->set_active(false);
m_xBtnHorLeft->set_active(false);
m_xBtnHorCenter->set_active(false);
m_xBtnHorDistance->set_active(false);
m_xBtnHorRight->set_active(false);
switch(m_eDistributeHor)
{
case SvxDistributeHorizontal::NONE : m_pBtnHorNone->SetState(true); break;
case SvxDistributeHorizontal::Left : m_pBtnHorLeft->SetState(true); break;
case SvxDistributeHorizontal::Center : m_pBtnHorCenter->SetState(true); break;
case SvxDistributeHorizontal::Distance : m_pBtnHorDistance->SetState(true); break;
case SvxDistributeHorizontal::Right : m_pBtnHorRight->SetState(true); break;
case SvxDistributeHorizontal::NONE : m_xBtnHorNone->set_active(true); break;
case SvxDistributeHorizontal::Left : m_xBtnHorLeft->set_active(true); break;
case SvxDistributeHorizontal::Center : m_xBtnHorCenter->set_active(true); break;
case SvxDistributeHorizontal::Distance : m_xBtnHorDistance->set_active(true); break;
case SvxDistributeHorizontal::Right : m_xBtnHorRight->set_active(true); break;
}
m_pBtnVerNone->SetState(false);
m_pBtnVerTop->SetState(false);
m_pBtnVerCenter->SetState(false);
m_pBtnVerDistance->SetState(false);
m_pBtnVerBottom->SetState(false);
m_xBtnVerNone->set_active(false);
m_xBtnVerTop->set_active(false);
m_xBtnVerCenter->set_active(false);
m_xBtnVerDistance->set_active(false);
m_xBtnVerBottom->set_active(false);
switch(m_eDistributeVer)
{
case SvxDistributeVertical::NONE : m_pBtnVerNone->SetState(true); break;
case SvxDistributeVertical::Top : m_pBtnVerTop->SetState(true); break;
case SvxDistributeVertical::Center : m_pBtnVerCenter->SetState(true); break;
case SvxDistributeVertical::Distance : m_pBtnVerDistance->SetState(true); break;
case SvxDistributeVertical::Bottom : m_pBtnVerBottom->SetState(true); break;
case SvxDistributeVertical::NONE : m_xBtnVerNone->set_active(true); break;
case SvxDistributeVertical::Top : m_xBtnVerTop->set_active(true); break;
case SvxDistributeVertical::Center : m_xBtnVerCenter->set_active(true); break;
case SvxDistributeVertical::Distance : m_xBtnVerDistance->set_active(true); break;
case SvxDistributeVertical::Bottom : m_xBtnVerBottom->set_active(true); break;
}
}
@ -156,22 +138,22 @@ bool SvxDistributePage::FillItemSet( SfxItemSet* )
SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontal::NONE);
SvxDistributeVertical eDistributeVer(SvxDistributeVertical::NONE);
if(m_pBtnHorLeft->IsChecked())
if(m_xBtnHorLeft->get_active())
eDistributeHor = SvxDistributeHorizontal::Left;
else if(m_pBtnHorCenter->IsChecked())
else if(m_xBtnHorCenter->get_active())
eDistributeHor = SvxDistributeHorizontal::Center;
else if(m_pBtnHorDistance->IsChecked())
else if(m_xBtnHorDistance->get_active())
eDistributeHor = SvxDistributeHorizontal::Distance;
else if(m_pBtnHorRight->IsChecked())
else if(m_xBtnHorRight->get_active())
eDistributeHor = SvxDistributeHorizontal::Right;
if(m_pBtnVerTop->IsChecked())
if(m_xBtnVerTop->get_active())
eDistributeVer = SvxDistributeVertical::Top;
else if(m_pBtnVerCenter->IsChecked())
else if(m_xBtnVerCenter->get_active())
eDistributeVer = SvxDistributeVertical::Center;
else if(m_pBtnVerDistance->IsChecked())
else if(m_xBtnVerDistance->get_active())
eDistributeVer = SvxDistributeVertical::Distance;
else if(m_pBtnVerBottom->IsChecked())
else if(m_xBtnVerBottom->get_active())
eDistributeVer = SvxDistributeVertical::Bottom;
if(eDistributeHor != m_eDistributeHor || eDistributeVer != m_eDistributeVer)

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkGrid" id="DistributionPage">
@ -41,7 +41,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">horleft</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -57,7 +56,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">horcenter</property>
<property name="group">hornone</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -73,7 +72,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">hordistance</property>
<property name="group">hornone</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -102,7 +101,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dsth_low.png</property>
<property name="icon_name">svx/res/dsth_low.png</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -115,7 +114,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dsth_cen.png</property>
<property name="icon_name">svx/res/dsth_cen.png</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -131,7 +130,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">horright</property>
<property name="group">hornone</property>
</object>
<packing>
<property name="left_attach">3</property>
@ -144,7 +143,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dsth_dst.png</property>
<property name="icon_name">svx/res/dsth_dst.png</property>
</object>
<packing>
<property name="left_attach">3</property>
@ -157,7 +156,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dsth_hig.png</property>
<property name="icon_name">svx/res/dsth_hig.png</property>
</object>
<packing>
<property name="left_attach">4</property>
@ -215,7 +214,6 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">vertop</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -231,7 +229,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">vercenter</property>
<property name="group">vernone</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -248,7 +246,7 @@
<property name="xalign">0</property>
<property name="yalign">0.56000000238418579</property>
<property name="draw_indicator">True</property>
<property name="group">verdistance</property>
<property name="group">vernone</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -264,7 +262,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">verbottom</property>
<property name="group">vernone</property>
</object>
<packing>
<property name="left_attach">3</property>
@ -293,7 +291,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dstv_hig.png</property>
<property name="icon_name">svx/res/dstv_hig.png</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -306,7 +304,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dstv_cen.png</property>
<property name="icon_name">svx/res/dstv_cen.png</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -319,7 +317,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dstv_dst.png</property>
<property name="icon_name">svx/res/dstv_dst.png</property>
</object>
<packing>
<property name="left_attach">3</property>
@ -332,7 +330,7 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">svx/res/dstv_low.png</property>
<property name="icon_name">svx/res/dstv_low.png</property>
</object>
<packing>
<property name="left_attach">4</property>