diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-29 23:54:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-31 11:30:48 +0000 |
commit | 06773ff7391c3d26c4f9d169664ee961cf104fb7 (patch) | |
tree | a848db0c36b805d9c40318aaa16110be96237e62 /svx/source | |
parent | 6757480434b2740622070f05fa07da33b8c28d89 (diff) |
move color options .ui to right place and adapt code
Change-Id: I645775bcec9993a2d8fd4b5ea67197ad3b2a9e03
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index b6ad22a45455..ed5d5e9e9fa7 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -890,6 +890,13 @@ XOBitmap SvxBitmapCtl::GetXBitmap() return( aXOBitmap ); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorLB(Window *pParent, VclBuilder::stringmap &) +{ + ColorLB *pListBox = new ColorLB(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE); + pListBox->EnableAutoSize(true); + return pListBox; +} + // Fills the Listbox with color and strings void ColorLB::Fill( const XColorListRef &pColorTab ) @@ -1609,6 +1616,20 @@ SvxPreviewBase::SvxPreviewBase( Window* pParent, const ResId& rResId ) mpModel->GetItemPool().FreezeIdRanges(); } +SvxPreviewBase::SvxPreviewBase(Window* pParent) + : Control(pParent, WB_BORDER) + , mpModel(new SdrModel()) + , mpBufferDevice(new VirtualDevice(*this)) +{ + // Draw the control's border as a flat thin black line. + SetBorderStyle(WINDOW_BORDER_MONO); + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetMapMode(MAP_100TH_MM); + + // init model + mpModel->GetItemPool().FreezeIdRanges(); +} + SvxPreviewBase::~SvxPreviewBase() { delete mpModel; @@ -1810,6 +1831,37 @@ SvxXRectPreview::SvxXRectPreview( Window* pParent, const ResId& rResId ) mpRectangleObject->SetModel(&getModel()); } +SvxXRectPreview::SvxXRectPreview(Window* pParent) + : SvxPreviewBase(pParent) + , mpRectangleObject(0) +{ + InitSettings(true, true); + + // create RectangleObject + const Rectangle aObjectSize(Point(), GetOutputSize()); + mpRectangleObject = new SdrRectObj(aObjectSize); + mpRectangleObject->SetModel(&getModel()); +} + +void SvxXRectPreview::Resize() +{ + const Rectangle aObjectSize(Point(), GetOutputSize()); + SdrObject *pOrigObject = mpRectangleObject; + if (pOrigObject) + { + mpRectangleObject = new SdrRectObj(aObjectSize); + mpRectangleObject->SetModel(&getModel()); + SetAttributes(pOrigObject->GetMergedItemSet()); + SdrObject::Free(pOrigObject); + } + SvxPreviewBase::Resize(); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXRectPreview(Window *pParent, VclBuilder::stringmap &) +{ + return new SvxXRectPreview(pParent); +} + SvxXRectPreview::~SvxXRectPreview() { SdrObject::Free(mpRectangleObject); |