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

add a makeSwRulerValueSet for custom SwRulerValueSet widget

Change-Id: Id13086906e2f66de45356baa7593b6d0e7657714
üst c648d428
...@@ -64,8 +64,12 @@ class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet ...@@ -64,8 +64,12 @@ class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence<
com::sun::star::uno::Reference< com::sun::star::uno::Reference<
com::sun::star::container::XIndexAccess> > aOutlineSettings; com::sun::star::container::XIndexAccess> > aOutlineSettings;
void init(sal_uInt16 nType);
public: public:
SvxNumValueSet( Window* pParent, const ResId& rResId, sal_uInt16 nType ); SvxNumValueSet( Window* pParent, const ResId& rResId, sal_uInt16 nType );
SvxNumValueSet( Window* pParent, sal_uInt16 nType );
~SvxNumValueSet(); ~SvxNumValueSet();
virtual void UserDraw( const UserDrawEvent& rUDEvt ); virtual void UserDraw( const UserDrawEvent& rUDEvt );
...@@ -92,6 +96,8 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet ...@@ -92,6 +96,8 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
Timer aFormatTimer; Timer aFormatTimer;
sal_Bool bGrfNotFound; sal_Bool bGrfNotFound;
void init();
protected: protected:
DECL_LINK(FormatHdl_Impl, void *); DECL_LINK(FormatHdl_Impl, void *);
...@@ -101,7 +107,8 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet ...@@ -101,7 +107,8 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
Timer& GetFormatTimer() {return aFormatTimer;} Timer& GetFormatTimer() {return aFormatTimer;}
public: public:
SvxBmpNumValueSet( Window* pParent, const ResId& rResId); SvxBmpNumValueSet(Window* pParent, const ResId& rResId);
SvxBmpNumValueSet(Window* pParent);
~SvxBmpNumValueSet(); ~SvxBmpNumValueSet();
virtual void UserDraw( const UserDrawEvent& rUDEvt ); virtual void UserDraw( const UserDrawEvent& rUDEvt );
......
...@@ -402,15 +402,25 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) ...@@ -402,15 +402,25 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
pDev->SetLineColor(aOldColor); pDev->SetLineColor(aOldColor);
} }
SvxNumValueSet::SvxNumValueSet( Window* pParent, const ResId& rResId, sal_uInt16 nType ) : SvxNumValueSet::SvxNumValueSet( Window* pParent, const ResId& rResId, sal_uInt16 nType )
: ValueSet( pParent, rResId )
{
init(nType);
}
ValueSet( pParent, rResId ), SvxNumValueSet::SvxNumValueSet( Window* pParent, sal_uInt16 nType )
: ValueSet( pParent )
{
init(nType);
}
aLineColor ( COL_LIGHTGRAY ), void SvxNumValueSet::init(sal_uInt16 nType)
nPageType ( nType ),
bHTMLMode ( sal_False ),
pVDev ( NULL )
{ {
aLineColor = COL_LIGHTGRAY;
nPageType = nType;
bHTMLMode = sal_False;
pVDev = NULL;
SetColCount( 4 ); SetColCount( 4 );
SetLineCount( 2 ); SetLineCount( 2 );
SetStyle( GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER ); SetStyle( GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
...@@ -465,12 +475,21 @@ void SvxNumValueSet::SetOutlineNumberingSettings( ...@@ -465,12 +475,21 @@ void SvxNumValueSet::SetOutlineNumberingSettings(
} }
} }
SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId ) : SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId )
: SvxNumValueSet( pParent, rResId, NUM_PAGETYPE_BMP )
{
init();
}
SvxNumValueSet( pParent, rResId, NUM_PAGETYPE_BMP ), SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent )
bGrfNotFound( sal_False ) : SvxNumValueSet( pParent, NUM_PAGETYPE_BMP )
{
init();
}
void SvxBmpNumValueSet::init()
{ {
bGrfNotFound = sal_False;
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS); GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
SetStyle( GetStyle() | WB_VSCROLL ); SetStyle( GetStyle() | WB_VSCROLL );
SetLineCount( 3 ); SetLineCount( 3 );
...@@ -478,6 +497,7 @@ SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId ) : ...@@ -478,6 +497,7 @@ SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId ) :
aFormatTimer.SetTimeoutHdl(LINK(this, SvxBmpNumValueSet, FormatHdl_Impl)); aFormatTimer.SetTimeoutHdl(LINK(this, SvxBmpNumValueSet, FormatHdl_Impl));
} }
SvxBmpNumValueSet::~SvxBmpNumValueSet() SvxBmpNumValueSet::~SvxBmpNumValueSet()
{ {
GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS); GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
......
...@@ -25,6 +25,7 @@ class SwRulerValueSet : public SvxBmpNumValueSet ...@@ -25,6 +25,7 @@ class SwRulerValueSet : public SvxBmpNumValueSet
public: public:
SwRulerValueSet( Window* pParent, SwRulerValueSet( Window* pParent,
const ResId& rResId ); const ResId& rResId );
SwRulerValueSet( Window* pParent );
~SwRulerValueSet(); ~SwRulerValueSet();
virtual void UserDraw( const UserDrawEvent& rUDEvt ); virtual void UserDraw( const UserDrawEvent& rUDEvt );
}; };
......
...@@ -100,10 +100,21 @@ IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS) ...@@ -100,10 +100,21 @@ IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS)
return 0; return 0;
} }
SwRulerValueSet::SwRulerValueSet( Window* pParent, const ResId& rResId ) : SwRulerValueSet::SwRulerValueSet( Window* pParent, const ResId& rResId )
SvxBmpNumValueSet(pParent, rResId) : SvxBmpNumValueSet(pParent, rResId)
{ {
SetStyle( GetStyle() & ~WB_ITEMBORDER ); SetStyle(GetStyle() & ~WB_ITEMBORDER);
}
SwRulerValueSet::SwRulerValueSet(Window* pParent)
: SvxBmpNumValueSet(pParent)
{
SetStyle(GetStyle() & ~WB_ITEMBORDER);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwRulerValueSet(Window *pParent, VclBuilder::stringmap &)
{
return new SwRulerValueSet(pParent);
} }
SwRulerValueSet::~SwRulerValueSet() SwRulerValueSet::~SwRulerValueSet()
......
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