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

weld SvxMeasureDialog

Change-Id: I9fc3364d83fa5e55cee6c823f16c05934ee2dc43
Reviewed-on: https://gerrit.libreoffice.org/61053
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8dc8b229
......@@ -98,6 +98,12 @@ using ::com::sun::star::uno::Reference;
using namespace svx;
// AbstractTabDialog implementations just forwards everything to the dialog
IMPL_ABSTDLG_BASE(CuiAbstractSfxDialog_Impl)
short CuiAbstractController_Impl::Execute()
{
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(CuiVclAbstractDialog_Impl)
IMPL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl);
IMPL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl);
......@@ -361,7 +367,15 @@ void CuiAbstractTabController_Impl::SetText( const OUString& rStr )
m_xDlg->set_title(rStr);
}
const SfxItemSet* CuiAbstractController_Impl::GetOutputItemSet() const
{
return m_xDlg->GetOutputItemSet();
}
void CuiAbstractController_Impl::SetText(const OUString& rStr)
{
m_xDlg->set_title(rStr);
}
const SfxItemSet* CuiAbstractSfxDialog_Impl::GetOutputItemSet() const
{
......@@ -1343,19 +1357,18 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateEventConfigDialog( v
return VclPtr<CuiAbstractSfxDialog_Impl>::Create(pDlg);
}
VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pParent,
const SfxItemSet& rAttr,
const SdrView* pView,
sal_uInt32 nResId
)
VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog(vcl::Window* pParent,
const SfxItemSet& rAttr,
const SdrView* pView,
sal_uInt32 nResId)
{
SfxSingleTabDialog* pDlg=nullptr;
switch ( nResId )
{
case RID_SVXPAGE_MEASURE :
pDlg = VclPtr<SvxMeasureDialog>::Create( pParent, rAttr, pView );
break;
{
return VclPtr<CuiAbstractController_Impl>::Create(o3tl::make_unique<SvxMeasureDialog>(pParent ? pParent->GetFrameWeld() : nullptr, rAttr, pView));
}
case RID_SVXPAGE_CONNECTION :
pDlg = VclPtr<SvxConnectionDialog>::Create( pParent, rAttr, pView );
break;
......@@ -1372,6 +1385,7 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Wind
return nullptr;
}
VclPtr<AbstractSvxPostItDialog> AbstractDialogFactory_Impl::CreateSvxPostItDialog( weld::Window* pParent,
const SfxItemSet& rCoreSet,
bool bPrevNext )
......
......@@ -28,6 +28,7 @@
class SfxTabDialog;
class SfxModalDialog;
class SfxSingleTabDialogController;
class Dialog;
class SfxItemPool;
class FmShowColsDialog;
......@@ -113,6 +114,23 @@ class CuiAbstractSfxDialog_Impl : public SfxAbstractDialog
virtual void SetText( const OUString& rStr ) override;
};
class CuiAbstractController_Impl : public SfxAbstractDialog
{
protected:
std::unique_ptr<SfxSingleTabDialogController> m_xDlg;
public:
explicit CuiAbstractController_Impl(std::unique_ptr<SfxSingleTabDialogController> p)
: m_xDlg(std::move(p))
{
}
virtual short Execute() override;
virtual const SfxItemSet* GetOutputItemSet() const override;
//From class Window.
virtual void SetText( const OUString& rStr ) override;
};
class CuiAbstractTabDialog_Impl : public SfxAbstractTabDialog
{
DECL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl,SfxTabDialog)
......
......@@ -89,10 +89,10 @@ public:
/* Derived from SfxSingleTabDialog, in order to be able to be
informed about virtual methods by the control. */
class SvxMeasureDialog : public SfxSingleTabDialog
class SvxMeasureDialog : public SfxSingleTabDialogController
{
public:
SvxMeasureDialog(vcl::Window* pParent, const SfxItemSet& rAttr,
SvxMeasureDialog(weld::Window* pParent, const SfxItemSet& rAttr,
const SdrView* pView);
};
......
......@@ -58,17 +58,18 @@ const sal_uInt16 SvxMeasurePage::pRanges[] =
|*
\************************************************************************/
SvxMeasureDialog::SvxMeasureDialog( vcl::Window* pParent, const SfxItemSet& rInAttrs,
const SdrView* pSdrView )
: SfxSingleTabDialog(pParent, rInAttrs)
SvxMeasureDialog::SvxMeasureDialog(weld::Window* pParent, const SfxItemSet& rInAttrs,
const SdrView* pSdrView)
: SfxSingleTabDialogController(pParent, rInAttrs)
{
VclPtrInstance<SvxMeasurePage> _pPage( get_content_area(), rInAttrs );
TabPageParent pPageParent(get_content_area(), this);
VclPtrInstance<SvxMeasurePage> pPage(pPageParent, rInAttrs);
_pPage->SetView( pSdrView );
_pPage->Construct();
pPage->SetView(pSdrView);
pPage->Construct();
SetTabPage(_pPage );
SetText(CuiResId(RID_SVXSTR_DIMENSION_LINE));
SetTabPage(pPage);
m_xDialog->set_title(CuiResId(RID_SVXSTR_DIMENSION_LINE));
}
/*************************************************************************
......
......@@ -156,7 +156,7 @@
<object class="GtkCheckButton" id="TSB_BELOW_REF_EDGE">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_BELOW_REF_EDGE">Measure _below object</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">12</property>
<property name="use_underline">True</property>
......@@ -173,7 +173,7 @@
<child>
<object class="GtkSpinButton" id="MTR_LINE_DIST">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
<property name="digits">2</property>
......@@ -186,7 +186,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE_OVERHANG">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment3</property>
<property name="digits">2</property>
......@@ -199,7 +199,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE_DIST">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment4</property>
<property name="digits">2</property>
......@@ -212,7 +212,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE1_LEN">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment5</property>
<property name="digits">2</property>
......@@ -225,7 +225,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE2_LEN">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment6</property>
<property name="digits">2</property>
......@@ -238,7 +238,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_DECIMALPLACES">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment2</property>
</object>
......@@ -347,7 +347,7 @@
<object class="GtkCheckButton" id="TSB_AUTOPOSV">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_AUTOPOSV">_AutoVertical</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
......@@ -364,7 +364,7 @@
<object class="GtkCheckButton" id="TSB_AUTOPOSH">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_AUTOPOSH">A_utoHorizontal</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
......@@ -390,7 +390,7 @@
<object class="GtkCheckButton" id="TSB_PARALLEL">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_PARALLEL">_Parallel to line</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
......@@ -407,7 +407,7 @@
<object class="GtkCheckButton" id="TSB_SHOW_UNIT">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_SHOW_UNIT">Show _measurement units</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
......
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