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

weld SvxGridTabPage

Change-Id: I04c2ead288547ecd0fba22a7a95a2497ab8dc768
Reviewed-on: https://gerrit.libreoffice.org/60217
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3ad32923
......@@ -21,9 +21,7 @@
#include <sfx2/tabdlg.hxx>
#include <svl/eitem.hxx>
#include <vcl/group.hxx>
#include <vcl/fixed.hxx>
#include <vcl/field.hxx>
#include <vcl/weld.hxx>
#include <svx/svxdllapi.h>
class SvxGridTabPage;
......@@ -92,11 +90,10 @@ class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
using TabPage::DeactivatePage;
public:
SvxGridTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
SvxGridTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SvxGridTabPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet& rAttrSet );
static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet& rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) override;
virtual void Reset( const SfxItemSet* rSet ) override;
......@@ -105,38 +102,34 @@ public:
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
private:
VclPtr<CheckBox> pCbxUseGridsnap;
VclPtr<CheckBox> pCbxGridVisible;
VclPtr<MetricField> pMtrFldDrawX;
VclPtr<MetricField> pMtrFldDrawY;
VclPtr<NumericField> pNumFldDivisionX;
VclPtr<NumericField> pNumFldDivisionY;
bool bAttrModified;
VclPtr<CheckBox> pCbxSynchronize;
std::unique_ptr<weld::CheckButton> m_xCbxUseGridsnap;
std::unique_ptr<weld::CheckButton> m_xCbxGridVisible;
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDrawX;
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDrawY;
std::unique_ptr<weld::SpinButton> m_xNumFldDivisionX;
std::unique_ptr<weld::SpinButton> m_xNumFldDivisionY;
std::unique_ptr<weld::CheckButton> m_xCbxSynchronize;
protected:
//these controls are used in draw and impress
VclPtr<VclContainer> pSnapFrames;
VclPtr<CheckBox> pCbxSnapHelplines;
VclPtr<CheckBox> pCbxSnapBorder;
VclPtr<CheckBox> pCbxSnapFrame;
VclPtr<CheckBox> pCbxSnapPoints;
VclPtr<MetricField> pMtrFldSnapArea;
VclPtr<CheckBox> pCbxOrtho;
VclPtr<CheckBox> pCbxBigOrtho;
VclPtr<CheckBox> pCbxRotate;
VclPtr<MetricField> pMtrFldAngle;
VclPtr<MetricField> pMtrFldBezAngle;
std::unique_ptr<weld::Widget> m_xSnapFrames;
std::unique_ptr<weld::CheckButton> m_xCbxSnapHelplines;
std::unique_ptr<weld::CheckButton> m_xCbxSnapBorder;
std::unique_ptr<weld::CheckButton> m_xCbxSnapFrame;
std::unique_ptr<weld::CheckButton> m_xCbxSnapPoints;
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldSnapArea;
std::unique_ptr<weld::CheckButton> m_xCbxOrtho;
std::unique_ptr<weld::CheckButton> m_xCbxBigOrtho;
std::unique_ptr<weld::CheckButton> m_xCbxRotate;
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldAngle;
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldBezAngle;
DECL_LINK(ClickRotateHdl_Impl, weld::ToggleButton&, void);
private:
bool bAttrModified;
DECL_LINK( ClickRotateHdl_Impl, Button*, void );
DECL_LINK( ChangeDrawHdl_Impl, Edit&, void );
DECL_LINK( ChangeGridsnapHdl_Impl, Button*, void );
DECL_LINK( ChangeDivisionHdl_Impl, Edit&, void );
DECL_LINK(ChangeDrawHdl_Impl, weld::MetricSpinButton&, void);
DECL_LINK(ChangeGridsnapHdl_Impl, weld::ToggleButton&, void);
DECL_LINK(ChangeDivisionHdl_Impl, weld::SpinButton&, void);
};
#endif
......
......@@ -2040,7 +2040,7 @@ VclPtr<SfxTabPage> ScModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
break;
}
case SID_SC_TP_GRID:
pRet = SvxGridTabPage::Create(pParent.pParent, rSet);
pRet = SvxGridTabPage::Create(pParent, rSet);
break;
case SID_SC_TP_USERLISTS:
{
......
......@@ -46,10 +46,10 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
SdTpOptionsSnap::SdTpOptionsSnap( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :
SvxGridTabPage(pParent, rInAttrs)
SdTpOptionsSnap::SdTpOptionsSnap(TabPageParent pParent, const SfxItemSet& rInAttrs)
: SvxGridTabPage(pParent, rInAttrs)
{
pSnapFrames->Show();
m_xSnapFrames->show();
}
SdTpOptionsSnap::~SdTpOptionsSnap()
......@@ -61,16 +61,16 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs )
SvxGridTabPage::FillItemSet(rAttrs);
SdOptionsSnapItem aOptsItem;
aOptsItem.GetOptionsSnap().SetSnapHelplines( pCbxSnapHelplines->IsChecked() );
aOptsItem.GetOptionsSnap().SetSnapBorder( pCbxSnapBorder->IsChecked() );
aOptsItem.GetOptionsSnap().SetSnapFrame( pCbxSnapFrame->IsChecked() );
aOptsItem.GetOptionsSnap().SetSnapPoints( pCbxSnapPoints->IsChecked() );
aOptsItem.GetOptionsSnap().SetOrtho( pCbxOrtho->IsChecked() );
aOptsItem.GetOptionsSnap().SetBigOrtho( pCbxBigOrtho->IsChecked() );
aOptsItem.GetOptionsSnap().SetRotate( pCbxRotate->IsChecked() );
aOptsItem.GetOptionsSnap().SetSnapArea( static_cast<sal_Int16>(pMtrFldSnapArea->GetValue()) );
aOptsItem.GetOptionsSnap().SetAngle( static_cast<sal_Int16>(pMtrFldAngle->GetValue()) );
aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle( static_cast<sal_Int16>(pMtrFldBezAngle->GetValue()) );
aOptsItem.GetOptionsSnap().SetSnapHelplines( m_xCbxSnapHelplines->get_active() );
aOptsItem.GetOptionsSnap().SetSnapBorder( m_xCbxSnapBorder->get_active() );
aOptsItem.GetOptionsSnap().SetSnapFrame( m_xCbxSnapFrame->get_active() );
aOptsItem.GetOptionsSnap().SetSnapPoints( m_xCbxSnapPoints->get_active() );
aOptsItem.GetOptionsSnap().SetOrtho( m_xCbxOrtho->get_active() );
aOptsItem.GetOptionsSnap().SetBigOrtho( m_xCbxBigOrtho->get_active() );
aOptsItem.GetOptionsSnap().SetRotate( m_xCbxRotate->get_active() );
aOptsItem.GetOptionsSnap().SetSnapArea(static_cast<sal_Int16>(m_xMtrFldSnapArea->get_value(FUNIT_PIXEL)));
aOptsItem.GetOptionsSnap().SetAngle(static_cast<sal_Int16>(m_xMtrFldAngle->get_value(FUNIT_DEGREE)));
aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle(static_cast<sal_Int16>(m_xMtrFldBezAngle->get_value(FUNIT_DEGREE)));
rAttrs->Put( aOptsItem );
......@@ -86,24 +86,24 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
SdOptionsSnapItem aOptsItem( static_cast<const SdOptionsSnapItem&>( rAttrs->
Get( ATTR_OPTIONS_SNAP ) ) );
pCbxSnapHelplines->Check( aOptsItem.GetOptionsSnap().IsSnapHelplines() );
pCbxSnapBorder->Check( aOptsItem.GetOptionsSnap().IsSnapBorder() );
pCbxSnapFrame->Check( aOptsItem.GetOptionsSnap().IsSnapFrame() );
pCbxSnapPoints->Check( aOptsItem.GetOptionsSnap().IsSnapPoints() );
pCbxOrtho->Check( aOptsItem.GetOptionsSnap().IsOrtho() );
pCbxBigOrtho->Check( aOptsItem.GetOptionsSnap().IsBigOrtho() );
pCbxRotate->Check( aOptsItem.GetOptionsSnap().IsRotate() );
pMtrFldSnapArea->SetValue( aOptsItem.GetOptionsSnap().GetSnapArea() );
pMtrFldAngle->SetValue( aOptsItem.GetOptionsSnap().GetAngle() );
pMtrFldBezAngle->SetValue( aOptsItem.GetOptionsSnap().GetEliminatePolyPointLimitAngle() );
pCbxRotate->GetClickHdl().Call(nullptr);
m_xCbxSnapHelplines->set_active( aOptsItem.GetOptionsSnap().IsSnapHelplines() );
m_xCbxSnapBorder->set_active( aOptsItem.GetOptionsSnap().IsSnapBorder() );
m_xCbxSnapFrame->set_active( aOptsItem.GetOptionsSnap().IsSnapFrame() );
m_xCbxSnapPoints->set_active( aOptsItem.GetOptionsSnap().IsSnapPoints() );
m_xCbxOrtho->set_active( aOptsItem.GetOptionsSnap().IsOrtho() );
m_xCbxBigOrtho->set_active( aOptsItem.GetOptionsSnap().IsBigOrtho() );
m_xCbxRotate->set_active( aOptsItem.GetOptionsSnap().IsRotate() );
m_xMtrFldSnapArea->set_value(aOptsItem.GetOptionsSnap().GetSnapArea(), FUNIT_PIXEL);
m_xMtrFldAngle->set_value(aOptsItem.GetOptionsSnap().GetAngle(), FUNIT_DEGREE);
m_xMtrFldBezAngle->set_value(aOptsItem.GetOptionsSnap().GetEliminatePolyPointLimitAngle(), FUNIT_DEGREE);
ClickRotateHdl_Impl(*m_xCbxRotate);
}
VclPtr<SfxTabPage> SdTpOptionsSnap::Create( TabPageParent pWindow,
const SfxItemSet* rAttrs )
{
return VclPtr<SdTpOptionsSnap>::Create( pWindow.pParent, *rAttrs );
return VclPtr<SdTpOptionsSnap>::Create(pWindow, *rAttrs);
}
/*************************************************************************
......
......@@ -33,13 +33,12 @@
class SdTpOptionsSnap : public SvxGridTabPage
{
public:
SdTpOptionsSnap( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SdTpOptionsSnap() override;
SdTpOptionsSnap(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SdTpOptionsSnap() override;
static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
};
/**
......
This diff is collapsed.
This diff is collapsed.
......@@ -429,7 +429,7 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
}
case RID_SW_TP_HTML_OPTGRID_PAGE:
case RID_SVXPAGE_GRID:
pRet = SvxGridTabPage::Create(pParent.pParent, rSet);
pRet = SvxGridTabPage::Create(pParent, rSet);
break;
case RID_SW_TP_STD_FONT:
......
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