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