summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-29 23:54:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-31 11:30:48 +0000
commit06773ff7391c3d26c4f9d169664ee961cf104fb7 (patch)
treea848db0c36b805d9c40318aaa16110be96237e62 /svx
parent6757480434b2740622070f05fa07da33b8c28d89 (diff)
move color options .ui to right place and adapt code
Change-Id: I645775bcec9993a2d8fd4b5ea67197ad3b2a9e03
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/dlgctrl.hxx7
-rw-r--r--svx/source/dialog/dlgctrl.cxx52
2 files changed, 57 insertions, 2 deletions
diff --git a/svx/inc/svx/dlgctrl.hxx b/svx/inc/svx/dlgctrl.hxx
index 5d410985b8ab..1d22546a289f 100644
--- a/svx/inc/svx/dlgctrl.hxx
+++ b/svx/inc/svx/dlgctrl.hxx
@@ -355,7 +355,8 @@ protected:
void LocalPostPaint();
public:
- SvxPreviewBase( Window* pParent, const ResId& rResId );
+ SvxPreviewBase(Window* pParent, const ResId& rResId);
+ SvxPreviewBase(Window* pParent);
virtual ~SvxPreviewBase();
// change support
@@ -409,12 +410,14 @@ private:
SdrObject* mpRectangleObject;
public:
- SvxXRectPreview( Window* pParent, const ResId& rResId );
+ SvxXRectPreview(Window* pParent, const ResId& rResId);
+ SvxXRectPreview(Window* pParent);
virtual ~SvxXRectPreview();
void SetAttributes(const SfxItemSet& rItemSet);
virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
};
/*************************************************************************
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);