diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-08-02 08:28:46 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-02 19:14:16 +0000 |
commit | 241c670f06047a2298b6f2b0d80f898f530a6a33 (patch) | |
tree | 7560d24e645916311777bc37c889adf32cfa2812 /svx | |
parent | f3d2b533122f918929f3ef5a77af4972582a5960 (diff) |
Convert line tab page to widget UI
Change-Id: I26ee6e0b5b6d17dfb9a65d16aaee0db1b64f5e05
Reviewed-on: https://gerrit.libreoffice.org/5244
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 104 |
1 files changed, 100 insertions, 4 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 76ba1b741635..c8d1e39eea99 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1468,6 +1468,20 @@ LineLB::LineLB(Window* pParent, WinBits aWB) // No EdgeBlending for LineStyle/Dash SetEdgeBlending(true); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLineLB(Window *pParent, VclBuilder::stringmap &rMap) +{ + bool bDropdown = VclBuilder::extractDropdown(rMap); + WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_TABSTOP; + if (bDropdown) + nWinBits |= WB_DROPDOWN; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinBits |= WB_BORDER; + LineLB *pListBox = new LineLB(pParent, nWinBits); + pListBox->EnableAutoSize(true); + return pListBox; +} + LineLB::~LineLB() { } @@ -1566,6 +1580,20 @@ LineEndLB::LineEndLB( Window* pParent, WinBits aWB ) // No EdgeBlending for LineEnds SetEdgeBlending(true); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLineEndLB(Window *pParent, VclBuilder::stringmap &rMap) +{ + bool bDropdown = VclBuilder::extractDropdown(rMap); + WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_TABSTOP; + if (bDropdown) + nWinBits |= WB_DROPDOWN; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinBits |= WB_BORDER; + LineEndLB *pListBox = new LineEndLB(pParent, nWinBits); + pListBox->EnableAutoSize(true); + return pListBox; +} + LineEndLB::~LineEndLB(void) { } @@ -1808,9 +1836,23 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId ) mpGraphic( 0L ), mbWithSymbol( sal_False ) { - const Size aOutputSize(GetOutputSize()); InitSettings( sal_True, sal_True ); + mpLineObjA = new SdrPathObj(OBJ_LINE); + mpLineObjA->SetModel(&getModel()); + + mpLineObjB = new SdrPathObj(OBJ_PLIN); + mpLineObjB->SetModel(&getModel()); + + mpLineObjC = new SdrPathObj(OBJ_PLIN); + mpLineObjC->SetModel(&getModel()); +} + +void SvxXLinePreview::Resize() +{ + SvxPreviewBase::Resize(); + + const Size aOutputSize(GetOutputSize()); const sal_Int32 nDistance(500L); const sal_Int32 nAvailableLength(aOutputSize.Width() - (4 * nDistance)); @@ -1821,6 +1863,52 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId ) basegfx::B2DPolygon aPolygonA; aPolygonA.append(aPointA1); aPolygonA.append(aPointA2); + mpLineObjA->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonA)); + + // create DrawObectB + const sal_Int32 aYPosB1((aOutputSize.Height() * 3) / 4); + const sal_Int32 aYPosB2((aOutputSize.Height() * 1) / 4); + const basegfx::B2DPoint aPointB1( aPointA2.getX() + nDistance, aYPosB1); + const basegfx::B2DPoint aPointB2( aPointB1.getX() + ((nAvailableLength * 2) / 20), aYPosB2 ); + const basegfx::B2DPoint aPointB3( aPointB2.getX() + ((nAvailableLength * 2) / 20), aYPosB1 ); + basegfx::B2DPolygon aPolygonB; + aPolygonB.append(aPointB1); + aPolygonB.append(aPointB2); + aPolygonB.append(aPointB3); + mpLineObjB->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonB)); + + // create DrawObectC + basegfx::B2DPolygon aPolygonC; + const basegfx::B2DPoint aPointC1( aPointB3.getX() + nDistance, aYPosB1); + const basegfx::B2DPoint aPointC2( aPointC1.getX() + ((nAvailableLength * 1) / 20), aYPosB2 ); + const basegfx::B2DPoint aPointC3( aPointC2.getX() + ((nAvailableLength * 1) / 20), aYPosB1 ); + aPolygonC.append(aPointC1); + aPolygonC.append(aPointC2); + aPolygonC.append(aPointC3); + mpLineObjC->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonC)); +} + +SvxXLinePreview::SvxXLinePreview( Window* pParent) +: SvxPreviewBase( pParent ), +mpLineObjA( 0L ), +mpLineObjB( 0L ), +mpLineObjC( 0L ), +mpGraphic( 0L ), +mbWithSymbol( sal_False ) +{ + const Size aOutputSize(GetOutputSize()); + InitSettings( true, true ); + + const sal_Int32 nDistance(500L); + const sal_Int32 nAvailableLength(aOutputSize.Width() - (4 * nDistance)); + + // create DrawObjectA + const sal_Int32 aYPosA(aOutputSize.Height() / 2); + const basegfx::B2DPoint aPointA1( nDistance, aYPosA); + const basegfx::B2DPoint aPointA2( aPointA1.getX() + ((nAvailableLength * 14) / 20), aYPosA ); + basegfx::B2DPolygon aPolygonA; + aPolygonA.append(aPointA1); + aPolygonA.append(aPointA2); mpLineObjA = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygonA)); mpLineObjA->SetModel(&getModel()); @@ -1848,12 +1936,20 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId ) mpLineObjC = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aPolygonC)); mpLineObjC->SetModel(&getModel()); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXLinePreview(Window *pParent, VclBuilder::stringmap &) +{ + return new SvxXLinePreview(pParent); +} + SvxXLinePreview::~SvxXLinePreview() { - SdrObject::Free( mpLineObjA ); - SdrObject::Free( mpLineObjB ); - SdrObject::Free( mpLineObjC ); + SdrObject *pFoo = mpLineObjA; + SdrObject::Free( pFoo ); + pFoo = mpLineObjB; + SdrObject::Free( pFoo ); + pFoo = mpLineObjC; + SdrObject::Free( pFoo ); } // ----------------------------------------------------------------------- |