From 94c8113897d9fc7f56a43dba4cc1331d758e46a7 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 15 Jul 2013 13:37:39 +0200 Subject: [PATCH] sidebar: Get AreaPropertyPanel basically to work. Change-Id: Ib5f05346ab5b38b4f3ec30f95b2435c9231d13ab --- include/svx/dialogs.hrc | 3 - svx/source/sidebar/area/AreaPropertyPanel.cxx | 48 +-- svx/source/sidebar/area/AreaPropertyPanel.hxx | 16 +- svx/source/tbxctrls/itemwin.cxx | 10 + svx/uiconfig/ui/sidebararea.ui | 339 +++++++++--------- 5 files changed, 193 insertions(+), 223 deletions(-) diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 3f18a94aca72..2e54ba488827 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -1004,9 +1004,6 @@ // sidebar-related resources (defined in the appropriate .hrc's) #define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1240) -// sidebar-related resources (defined in the appropriate .hrc's) -#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1240) - // !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!! #define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1270) diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx index 40330ae46275..359beefc43a6 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx @@ -77,8 +77,6 @@ AreaPropertyPanel::AreaPropertyPanel( maGradientElliptical(), maGradientSquare(), maGradientRect(), - mpLbFillType(new SvxFillTypeBox(this)), - mpLbFillAttr(new SvxFillAttrBox(this)), mpStyleItem(), mpColorItem(), mpFillGradientItem(), @@ -113,11 +111,13 @@ AreaPropertyPanel::AreaPropertyPanel( mbColorAvail(true) { get(mpColorTextFT, "filllabel"); + get(mpLbFillType, "fillstyle"); + get(mpLbFillAttr, "fillattr"); get(mpTrspTextFT, "transparencylabel"); get(mpToolBoxColor, "selectcolor"); get(mpLBTransType, "transtype"); - get(mpMTRTransparent, "settransparency"); // GtkSpinButton - get(mpBTNGradient, "selectgradient"); // GtkToolbar + get(mpMTRTransparent, "settransparency"); + get(mpBTNGradient, "selectgradient"); const sal_uInt16 nIdColor = mpToolBoxColor->GetItemId(UNO_SIDEBARCOLOR); mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, nIdColor, mpToolBoxColor)), @@ -158,27 +158,6 @@ void AreaPropertyPanel::Initialize() maGradientRect = maGradientLinear; maGradientRect.SetGradientStyle(XGRAD_RECT); - Size aLogicalFillSize(MBOX_WIDTH,LISTBOX_HEIGHT); - Size aLogicalAttrSize(MBOX_WIDTH + 1,LISTBOX_HEIGHT); - - Point aPoint(SECTIONPAGE_MARGIN_HORIZONTAL,SECTIONPAGE_MARGIN_VERTICAL_TOP + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL); - Point aPoint_Picker(SECTIONPAGE_MARGIN_HORIZONTAL + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL,SECTIONPAGE_MARGIN_VERTICAL_TOP + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL); - - Size aTypeSize(LogicToPixel(aLogicalFillSize, MAP_APPFONT)); - Size aAttrSize(LogicToPixel(aLogicalAttrSize, MAP_APPFONT)); - - Point aTypePoint(LogicToPixel(aPoint, MAP_APPFONT)); - Point aAttrPoint(LogicToPixel(aPoint_Picker, MAP_APPFONT)); - - mpLbFillType->SetPosSizePixel(aTypePoint,aTypeSize); - mpLbFillAttr->SetPosSizePixel(aAttrPoint,aAttrSize); - - mpLbFillType->SetHelpId(HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES); - mpLbFillAttr->SetHelpId(HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR); - - mpLbFillType->SetQuickHelpText(msHelpFillType); - mpLbFillAttr->SetQuickHelpText(msHelpFillAttr); - mpLbFillType->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fill"))); //wj acc mpLbFillAttr->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fill"))); //wj acc @@ -195,12 +174,6 @@ void AreaPropertyPanel::Initialize() mpToolBoxColor->SetItemBits( nIdColor, mpToolBoxColor->GetItemBits( nIdColor ) | TIB_DROPDOWNONLY ); mpToolBoxColor->SetItemText(nIdColor, msHelpFillAttr); - long aHeightLBStyle = mpLbFillType->GetSizePixel().getHeight(); - long aLBPosY = mpLbFillType->GetPosPixel().getY(); - long aHeightTBAttr = mpToolBoxColor->GetSizePixel().getHeight(); - Point aPointTBAttr = mpToolBoxColor->GetPosPixel(); - aPointTBAttr.setY( aLBPosY + aHeightLBStyle / 2 - aHeightTBAttr / 2); - aLink = LINK(this, AreaPropertyPanel, ToolBoxColorDropHdl); mpToolBoxColor->SetDropdownClickHdl ( aLink ); mpToolBoxColor->SetSelectHdl ( aLink ); @@ -221,19 +194,8 @@ void AreaPropertyPanel::Initialize() mpBTNGradient->SetItemImage(nIdGradient,maImgLinear); mpBTNGradient->Hide(); - long aHeightLBTrans = mpLBTransType->GetSizePixel().getHeight(); - Point aPointLB = mpLBTransType->GetPosPixel(); - long aPosY = aPointLB.getY(); - - Point aPointMetric = mpMTRTransparent->GetPosPixel(); - Point aPointTB = mpMTRTransparent->GetPosPixel(); - long aHeightMetric = mpMTRTransparent->GetSizePixel().getHeight(); - long aHeightTool = mpBTNGradient->GetSizePixel().getHeight(); - aPointMetric.setY(aPosY+aHeightLBTrans/2-aHeightMetric/2); - aPointTB.setY(aPosY+aHeightLBTrans/2-aHeightTool/2); - aPointTB.setX(aPointTB.getX()+3); mpLbFillType->SetAccessibleRelationLabeledBy(mpColorTextFT); - mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr.get()); + mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr); mpToolBoxColor->SetAccessibleRelationLabeledBy(mpToolBoxColor); mpLBTransType->SetAccessibleRelationLabeledBy(mpTrspTextFT); mpMTRTransparent->SetAccessibleRelationLabeledBy(mpMTRTransparent); diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx index d0df11a500f7..39cbafca4546 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.hxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx @@ -99,14 +99,14 @@ private: XGradient maGradientRect; //ui controls - FixedText* mpColorTextFT; - ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; - ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; - ToolBox* mpToolBoxColor; // for new color picker - FixedText* mpTrspTextFT; - ListBox* mpLBTransType; - MetricField* mpMTRTransparent; - ToolBox* mpBTNGradient; + FixedText* mpColorTextFT; + SvxFillTypeBox* mpLbFillType; + SvxFillAttrBox* mpLbFillAttr; + ToolBox* mpToolBoxColor; // for new color picker + FixedText* mpTrspTextFT; + ListBox* mpLBTransType; + MetricField* mpMTRTransparent; + ToolBox* mpBTNGradient; ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index dbc2ede40d91..10ec85d8781b 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -609,6 +609,11 @@ SvxFillTypeBox::SvxFillTypeBox( Window* pParent, WinBits nBits ) : Show(); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFillTypeBox(Window *pParent, VclBuilder::stringmap &) +{ + return new SvxFillTypeBox(pParent); +} + // ----------------------------------------------------------------------- SvxFillTypeBox::~SvxFillTypeBox() @@ -697,6 +702,11 @@ SvxFillAttrBox::SvxFillAttrBox( Window* pParent, WinBits nBits ) : Show(); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFillAttrBox(Window *pParent, VclBuilder::stringmap &) +{ + return new SvxFillAttrBox(pParent); +} + // ----------------------------------------------------------------------- SvxFillAttrBox::~SvxFillAttrBox() diff --git a/svx/uiconfig/ui/sidebararea.ui b/svx/uiconfig/ui/sidebararea.ui index fe5c29bfb2b0..2b2e24788bd8 100644 --- a/svx/uiconfig/ui/sidebararea.ui +++ b/svx/uiconfig/ui/sidebararea.ui @@ -15,196 +15,84 @@ vertical 12 - + True False - vertical + True + 6 + 6 - + True False - vertical - - - True - False - Fill: - 0 - _Fill: - True - - - False - True - 0 - - - - - True - False - 4 - - - True - False - Select the fill type to apply. - 0 - 1 - - - False - True - 0 - - - - - True - False - - - True - False - Select the color to apply. - end - .uno:sidebarcolor - True - - - True - True - - - - - True - True - 1 - - - - - False - True - 1 - - + True + Fill: + Fill: + 0 + _Fill: + True + fillstyle - False - True - 0 + 0 + 0 + 1 + 1 - + True False - vertical + True + Select the fill type to apply. + Select the fill type to apply. + 0 + 1 + + + 0 + 1 + 1 + 1 + + + + + True + False + True - + True False - Transparency - 0 - _Transparency: - True + + + 105 + True + False + True + Select the color to apply. + Select the color to apply. + .uno:sidebarcolor + True + + + True + True + + - False + True True 0 - + True False - - - True - False - Select the type of transparence to apply. - Select the type of transparence to apply. - 0 - 1 - - None - Solid - Linear - Axial - Radial - Ellipsoid - Quadratic - Square - - - - False - True - 0 - - - - - True - False - - - True - True - Specify 0% for fully opaque through 100% for fully transparent. - Specify 0% for fully opaque through 100% for fully transparent. - end - 100 - - False - 5 - True - - - False - True - 1 - - - - - True - False - end - 13 - - - True - False - True - Specify the variation of gradient transparency. - Specify the variation of gradient transparency. - 23 - .uno:sidebargradient - True - - - True - True - - - - - False - True - 2 - - - - - False - True - 1 - - False @@ -214,11 +102,124 @@ - False - True - 1 + 1 + 1 + 1 + 1 + + + True + False + True + Transparency + Transparency + 0 + _Transparency: + True + transtype + + + 0 + 2 + 1 + 1 + + + + + True + False + True + Select the type of transparence to apply. + Select the type of transparence to apply. + 0 + 1 + + None + Solid + Linear + Axial + Radial + Ellipsoid + Quadratic + Square + + + + 0 + 3 + 1 + 1 + + + + + True + False + True + + + True + False + + + True + False + True + Specify the variation of gradient transparency. + Specify the variation of gradient transparency. + .uno:sidebargradient + True + + + True + True + + + + + False + True + 0 + + + + + True + True + True + Specify 0% for fully opaque through 100% for fully transparent. + Specify 0% for fully opaque through 100% for fully transparent. + True + 100 + + True + False + 5 + True + + + False + True + 1 + + + + + 1 + 3 + 1 + 1 + + + + + + + + False