summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-13 20:38:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-14 15:02:52 +0200
commit41e5d31b19188318ce035a3da918de52569e3030 (patch)
tree33cf31f29b74042e7d97cc833a7b646f44cceeb3 /chart2
parentc3c02d012006f38519a4eeb64f306d7f3a4edbaa (diff)
weld PolarOptionsTabPage
Change-Id: I7e0c9bcd940a5f1816e3e18077be4373644ce760 Reviewed-on: https://gerrit.libreoffice.org/61748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx57
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hxx20
-rw-r--r--chart2/uiconfig/ui/tp_PolarOptions.ui20
3 files changed, 52 insertions, 45 deletions
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index e756d7a2edc1..a33bbcfa17ca 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -29,20 +29,16 @@
namespace chart
{
-PolarOptionsTabPage::PolarOptionsTabPage( vcl::Window* pWindow,const SfxItemSet& rInAttrs ) :
- SfxTabPage( pWindow
- ,"tp_PolarOptions"
- ,"modules/schart/ui/tp_PolarOptions.ui"
- ,&rInAttrs)
+PolarOptionsTabPage::PolarOptionsTabPage(TabPageParent pWindow, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pWindow, "modules/schart/ui/tp_PolarOptions.ui", "tp_PolarOptions", &rInAttrs)
+ , m_xCB_Clockwise(m_xBuilder->weld_check_button("CB_CLOCKWISE"))
+ , m_xFL_StartingAngle(m_xBuilder->weld_frame("frameANGLE"))
+ , m_xNF_StartingAngle(m_xBuilder->weld_spin_button("NF_STARTING_ANGLE"))
+ , m_xFL_PlotOptions(m_xBuilder->weld_frame("framePLOT_OPTIONS"))
+ , m_xCB_IncludeHiddenCells(m_xBuilder->weld_check_button("CB_INCLUDE_HIDDEN_CELLS_POLAR"))
+ , m_xAngleDial(new weld::CustomWeld(*m_xBuilder, "CT_ANGLE_DIAL", m_aAngleDial))
{
- get(m_pCB_Clockwise, "CB_CLOCKWISE");
- get(m_pFL_StartingAngle, "frameANGLE");
- get(m_pAngleDial, "CT_ANGLE_DIAL");
- get(m_pNF_StartingAngle, "NF_STARTING_ANGLE");
- get(m_pFL_PlotOptions, "framePLOT_OPTIONS");
- get(m_pCB_IncludeHiddenCells, "CB_INCLUDE_HIDDEN_CELLS_POLAR");
-
- m_pAngleDial->SetLinkedField( m_pNF_StartingAngle );
+ m_aAngleDial.SetLinkedField(m_xNF_StartingAngle.get());
}
PolarOptionsTabPage::~PolarOptionsTabPage()
@@ -52,33 +48,28 @@ PolarOptionsTabPage::~PolarOptionsTabPage()
void PolarOptionsTabPage::dispose()
{
- m_pCB_Clockwise.clear();
- m_pFL_StartingAngle.clear();
- m_pAngleDial.clear();
- m_pNF_StartingAngle.clear();
- m_pFL_PlotOptions.clear();
- m_pCB_IncludeHiddenCells.clear();
+ m_xAngleDial.reset();
SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> PolarOptionsTabPage::Create( TabPageParent pWindow,const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> PolarOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
- return VclPtr<PolarOptionsTabPage>::Create( pWindow.pParent, *rOutAttrs );
+ return VclPtr<PolarOptionsTabPage>::Create(pParent, *rOutAttrs);
}
bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
{
- if( m_pAngleDial->IsVisible() )
+ if (m_xAngleDial->get_visible())
{
rOutAttrs->Put(SfxInt32Item(SCHATTR_STARTING_ANGLE,
- static_cast< sal_Int32 >(m_pAngleDial->GetRotation()/100)));
+ static_cast< sal_Int32 >(m_aAngleDial.GetRotation()/100)));
}
- if( m_pCB_Clockwise->IsVisible() )
- rOutAttrs->Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_pCB_Clockwise->IsChecked()));
+ if( m_xCB_Clockwise->get_visible() )
+ rOutAttrs->Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_xCB_Clockwise->get_active()));
- if (m_pCB_IncludeHiddenCells->IsVisible())
- rOutAttrs->Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_pCB_IncludeHiddenCells->IsChecked()));
+ if (m_xCB_IncludeHiddenCells->get_visible())
+ rOutAttrs->Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_xCB_IncludeHiddenCells->get_active()));
return true;
}
@@ -90,29 +81,29 @@ void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET)
{
long nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
- m_pAngleDial->SetRotation( nTmp*100 );
+ m_aAngleDial.SetRotation( nTmp*100 );
}
else
{
- m_pFL_StartingAngle->Show(false);
+ m_xFL_StartingAngle->show(false);
}
if (rInAttrs->GetItemState(SCHATTR_CLOCKWISE, true, &pPoolItem) == SfxItemState::SET)
{
bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
- m_pCB_Clockwise->Check(bCheck);
+ m_xCB_Clockwise->set_active(bCheck);
}
else
{
- m_pCB_Clockwise->Show(false);
+ m_xCB_Clockwise->show(false);
}
if (rInAttrs->GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, true, &pPoolItem) == SfxItemState::SET)
{
bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
- m_pCB_IncludeHiddenCells->Check(bVal);
+ m_xCB_IncludeHiddenCells->set_active(bVal);
}
else
{
- m_pFL_PlotOptions->Show(false);
+ m_xFL_PlotOptions->show(false);
}
}
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index 7e7907c8fb8e..56cd4005417f 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -20,10 +20,9 @@
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_POLAROPTIONS_HXX
#include <sfx2/tabdlg.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
#include <svx/dialcontrol.hxx>
+#include <vcl/customweld.hxx>
+#include <vcl/weld.hxx>
namespace chart
{
@@ -32,7 +31,7 @@ class PolarOptionsTabPage : public SfxTabPage
{
public:
- PolarOptionsTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ PolarOptionsTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~PolarOptionsTabPage() override;
virtual void dispose() override;
@@ -41,12 +40,13 @@ public:
virtual void Reset(const SfxItemSet* rInAttrs) override;
private:
- VclPtr<CheckBox> m_pCB_Clockwise;
- VclPtr<VclFrame> m_pFL_StartingAngle;
- VclPtr<svx::DialControl> m_pAngleDial;
- VclPtr<NumericField> m_pNF_StartingAngle;
- VclPtr<VclFrame> m_pFL_PlotOptions;
- VclPtr<CheckBox> m_pCB_IncludeHiddenCells;
+ svx::SvxDialControl m_aAngleDial;
+ std::unique_ptr<weld::CheckButton> m_xCB_Clockwise;
+ std::unique_ptr<weld::Frame> m_xFL_StartingAngle;
+ std::unique_ptr<weld::SpinButton> m_xNF_StartingAngle;
+ std::unique_ptr<weld::Frame> m_xFL_PlotOptions;
+ std::unique_ptr<weld::CheckButton> m_xCB_IncludeHiddenCells;
+ std::unique_ptr<weld::CustomWeld> m_xAngleDial;
};
} //namespace chart
diff --git a/chart2/uiconfig/ui/tp_PolarOptions.ui b/chart2/uiconfig/ui/tp_PolarOptions.ui
index 21c834cbe1d6..d99089e8e824 100644
--- a/chart2/uiconfig/ui/tp_PolarOptions.ui
+++ b/chart2/uiconfig/ui/tp_PolarOptions.ui
@@ -75,9 +75,25 @@
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
- <object class="svxlo-DialControl" id="CT_ANGLE_DIAL">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="CT_ANGLE_DIAL">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>