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

weld SvxZoomDialog

Change-Id: I9d68fdcc9dc27a5aa4f6ec78542ce7822259233e
Reviewed-on: https://gerrit.libreoffice.org/52157Tested-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 1fe4a1a7
This diff is collapsed.
......@@ -104,7 +104,12 @@ IMPL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractHyphenWordDialog_Impl)
IMPL_ABSTDLG_BASE(AbstractThesaurusDialog_Impl)
IMPL_ABSTDLG_BASE(AbstractSvxZoomDialog_Impl)
short AbstractSvxZoomDialog_Impl::Execute()
{
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractTitleDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractScriptSelectorDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractGalleryIdDialog_Impl);
......@@ -406,17 +411,17 @@ void AbstractFmShowColsDialog_Impl::SetColumns(const ::Reference< css::containe
void AbstractSvxZoomDialog_Impl::SetLimits( sal_uInt16 nMin, sal_uInt16 nMax )
{
pDlg->SetLimits( nMin, nMax );
m_xDlg->SetLimits( nMin, nMax );
}
void AbstractSvxZoomDialog_Impl::HideButton( ZoomButtonId nBtnId )
{
pDlg->HideButton( nBtnId );
m_xDlg->HideButton( nBtnId );
}
const SfxItemSet* AbstractSvxZoomDialog_Impl::GetOutputItemSet() const
{
return pDlg->GetOutputItemSet();
return m_xDlg->GetOutputItemSet();
}
void AbstractSpellDialog_Impl::Invalidate()
......@@ -953,11 +958,9 @@ VclPtr<AbstractFmShowColsDialog> AbstractDialogFactory_Impl::CreateFmShowColsDia
return VclPtr<AbstractFmShowColsDialog_Impl>::Create( pDlg );
}
VclPtr<AbstractSvxZoomDialog> AbstractDialogFactory_Impl::CreateSvxZoomDialog( vcl::Window* pParent,
const SfxItemSet& rCoreSet)
VclPtr<AbstractSvxZoomDialog> AbstractDialogFactory_Impl::CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet)
{
VclPtrInstance<SvxZoomDialog> pDlg( pParent, rCoreSet);
return VclPtr<AbstractSvxZoomDialog_Impl>::Create( pDlg );
return VclPtr<AbstractSvxZoomDialog_Impl>::Create(new SvxZoomDialog(pParent, rCoreSet));
}
VclPtr<AbstractSpellDialog> AbstractDialogFactory_Impl::CreateSvxSpellDialog(
......
......@@ -187,11 +187,17 @@ class AbstractFmShowColsDialog_Impl : public AbstractFmShowColsDialog
class SvxZoomDialog;
class AbstractSvxZoomDialog_Impl : public AbstractSvxZoomDialog
{
DECL_ABSTDLG_BASE(AbstractSvxZoomDialog_Impl,SvxZoomDialog)
virtual void SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) override;
virtual void HideButton( ZoomButtonId nBtnId ) override;
protected:
std::unique_ptr<SvxZoomDialog> m_xDlg;
public:
explicit AbstractSvxZoomDialog_Impl(SvxZoomDialog* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
virtual void SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) override;
virtual void HideButton( ZoomButtonId nBtnId ) override;
virtual const SfxItemSet* GetOutputItemSet() const override ;
};
namespace svx{ class SpellDialog;}
......@@ -547,8 +553,7 @@ public:
SvxSpellWrapper* pWrapper ) override;
virtual VclPtr<AbstractFmShowColsDialog> CreateFmShowColsDialog() override;
virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog( vcl::Window* pParent,
const SfxItemSet& rCoreSet) override;
virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) override;
// add for SvxBorderBackgroundDlg
virtual VclPtr<SfxAbstractTabDialog> CreateSvxBorderBackgroundDlg(
vcl::Window* pParent,
......
......@@ -22,44 +22,38 @@
#include <memory>
#include <sfx2/basedlgs.hxx>
#include <svx/zoom_def.hxx>
#include <vcl/button.hxx>
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
#include <vcl/weld.hxx>
class SvxZoomDialog : public SfxModalDialog
class SvxZoomDialog : public weld::GenericDialogController
{
private:
VclPtr<RadioButton> m_pOptimalBtn;
VclPtr<RadioButton> m_pWholePageBtn;
VclPtr<RadioButton> m_pPageWidthBtn;
VclPtr<RadioButton> m_p100Btn;
VclPtr<RadioButton> m_pUserBtn;
VclPtr<MetricField> m_pUserEdit;
const SfxItemSet& m_rSet;
std::unique_ptr<SfxItemSet> m_pOutSet;
bool m_bModified;
VclPtr<VclContainer> m_pViewFrame;
VclPtr<RadioButton> m_pAutomaticBtn;
VclPtr<RadioButton> m_pSingleBtn;
VclPtr<RadioButton> m_pColumnsBtn;
VclPtr<NumericField> m_pColumnsEdit;
VclPtr<CheckBox> m_pBookModeChk;
std::unique_ptr<weld::RadioButton> m_xOptimalBtn;
std::unique_ptr<weld::RadioButton> m_xWholePageBtn;
std::unique_ptr<weld::RadioButton> m_xPageWidthBtn;
std::unique_ptr<weld::RadioButton> m_x100Btn;
std::unique_ptr<weld::RadioButton> m_xUserBtn;
std::unique_ptr<weld::MetricSpinButton> m_xUserEdit;
std::unique_ptr<weld::Widget> m_xViewFrame;
std::unique_ptr<weld::RadioButton> m_xAutomaticBtn;
std::unique_ptr<weld::RadioButton> m_xSingleBtn;
std::unique_ptr<weld::RadioButton> m_xColumnsBtn;
std::unique_ptr<weld::SpinButton> m_xColumnsEdit;
std::unique_ptr<weld::CheckButton> m_xBookModeChk;
std::unique_ptr<weld::Button> m_xOKBtn;
VclPtr<OKButton> m_pOKBtn;
const SfxItemSet& mrSet;
std::unique_ptr<SfxItemSet> mpOutSet;
bool mbModified;
DECL_LINK(UserHdl, Button*, void);
DECL_LINK(SpinHdl, Edit&, void);
DECL_LINK(ViewLayoutUserHdl, Button*, void);
DECL_LINK(ViewLayoutSpinHdl, Edit&, void);
DECL_LINK(ViewLayoutCheckHdl, Button*, void);
DECL_LINK(OKHdl, Button*, void);
DECL_LINK(UserHdl, weld::ToggleButton&, void);
DECL_LINK(SpinHdl, weld::MetricSpinButton&, void);
DECL_LINK(ViewLayoutUserHdl, weld::ToggleButton&, void);
DECL_LINK(ViewLayoutSpinHdl, weld::SpinButton&, void);
DECL_LINK(ViewLayoutCheckHdl, weld::ToggleButton&, void);
DECL_LINK(OKHdl, weld::Button&, void);
public:
SvxZoomDialog(vcl::Window* pParent, const SfxItemSet& rCoreSet);
virtual ~SvxZoomDialog() override;
virtual void dispose() override;
SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet);
const SfxItemSet* GetOutputItemSet() const;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.20.4 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
......@@ -8,11 +8,19 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkDialog" id="ZoomDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="zoomdialog|ZoomDialog">Zoom &amp; View Layout</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">
......@@ -28,6 +36,7 @@
<property name="label">gtk-ok</property>
<property name="visible">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="use_stock">True</property>
......@@ -107,7 +116,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">fitwandh</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -122,9 +130,8 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">fitw</property>
<property name="group">optimal</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -139,9 +146,8 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">100pc</property>
<property name="group">optimal</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -156,9 +162,8 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">variable</property>
<property name="group">optimal</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -178,11 +183,10 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">optimal</property>
<accessibility>
<relation type="label-for" target="zoomsb:0%"/>
<relation type="label-for" target="zoomsb"/>
</accessibility>
</object>
<packing>
......@@ -192,15 +196,16 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="zoomsb:0%">
<object class="GtkSpinButton" id="zoomsb">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment2</property>
<accessibility>
<relation type="labelled-by" target="variable"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="zoomsb:0%-atkobject">
<object class="AtkObject" id="zoomsb-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="zoomdialog|zoomsb-atkobject">Variable</property>
</object>
</child>
......@@ -264,9 +269,7 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">singlepage</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -281,9 +284,8 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">columns</property>
<property name="group">automatic</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -303,7 +305,6 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">automatic</property>
<accessibility>
......@@ -321,7 +322,7 @@
<object class="GtkSpinButton" id="columnssb">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
<accessibility>
<relation type="labelled-by" target="columns"/>
......@@ -407,5 +408,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
......@@ -345,8 +345,7 @@ public:
virtual VclPtr<AbstractFmShowColsDialog> CreateFmShowColsDialog() = 0;
virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog( vcl::Window* pParent,
const SfxItemSet& rCoreSet )=0;
virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) = 0;
virtual VclPtr<AbstractSpellDialog> CreateSvxSpellDialog(vcl::Window* pParent,
SfxBindings* pBindings,
......
......@@ -724,7 +724,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetDialogParent(), aSet));
vcl::Window* pWin = GetDialogParent();
pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(pWin ? pWin->GetFrameWeld() : nullptr, aSet));
OSL_ENSURE(pDlg, "Dialog creation failed!");
}
if (pDlg)
......
......@@ -1709,7 +1709,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
ScopedVclPtr<AbstractSvxZoomDialog> xDlg(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet));
ScopedVclPtr<AbstractSvxZoomDialog> xDlg(pFact->CreateSvxZoomDialog(GetViewFrame()->GetWindow().GetFrameWeld(), aSet));
assert(xDlg);
xDlg->SetLimits( MINZOOM, MAXZOOM );
if (xDlg->Execute() != RET_CANCEL)
......
......@@ -772,7 +772,7 @@ void SwPagePreview::Execute( SfxRequest &rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet));
pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetViewFrame()->GetWindow().GetFrameWeld(), aCoreSet));
OSL_ENSURE(pDlg, "Dialog creation failed!");
}
......
......@@ -1660,7 +1660,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet));
pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetViewFrame()->GetWindow().GetFrameWeld(), aCoreSet));
OSL_ENSURE(pDlg, "Zooming fail!");
if (pDlg)
{
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<!-- Generated with glade 3.20.4 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
......@@ -485,4 +485,10 @@
<placeholder/>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
<widget name="colspin"/>
<widget name="rowspin"/>
</widgets>
</object>
</interface>
......@@ -2916,7 +2916,7 @@ public:
virtual void enable_notify_events() override
{
GtkInstanceEntry::disable_notify_events();
GtkInstanceEntry::enable_notify_events();
g_signal_handler_unblock(m_pButton, m_nValueChangedSignalId);
}
......
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