166c1fc23SArmin Le Grand /************************************************************** 266c1fc23SArmin Le Grand * 366c1fc23SArmin Le Grand * Licensed to the Apache Software Foundation (ASF) under one 466c1fc23SArmin Le Grand * or more contributor license agreements. See the NOTICE file 566c1fc23SArmin Le Grand * distributed with this work for additional information 666c1fc23SArmin Le Grand * regarding copyright ownership. The ASF licenses this file 766c1fc23SArmin Le Grand * to you under the Apache License, Version 2.0 (the 866c1fc23SArmin Le Grand * "License"); you may not use this file except in compliance 966c1fc23SArmin Le Grand * with the License. You may obtain a copy of the License at 1066c1fc23SArmin Le Grand * 1166c1fc23SArmin Le Grand * http://www.apache.org/licenses/LICENSE-2.0 1266c1fc23SArmin Le Grand * 1366c1fc23SArmin Le Grand * Unless required by applicable law or agreed to in writing, 1466c1fc23SArmin Le Grand * software distributed under the License is distributed on an 1566c1fc23SArmin Le Grand * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1666c1fc23SArmin Le Grand * KIND, either express or implied. See the License for the 1766c1fc23SArmin Le Grand * specific language governing permissions and limitations 1866c1fc23SArmin Le Grand * under the License. 1966c1fc23SArmin Le Grand * 2066c1fc23SArmin Le Grand *************************************************************/ 2166c1fc23SArmin Le Grand 228dcb2a10SAndre Fischer #include "svx/sidebar/PopupContainer.hxx" 238dcb2a10SAndre Fischer #include "AreaTransparencyGradientControl.hxx" 248dcb2a10SAndre Fischer 2566c1fc23SArmin Le Grand #include <sfx2/sidebar/propertypanel.hrc> 2666c1fc23SArmin Le Grand #include <sfx2/sidebar/Theme.hxx> 2766c1fc23SArmin Le Grand #include <sfx2/sidebar/ControlFactory.hxx> 282bdfcea1SArmin Le Grand #include <AreaPropertyPanel.hxx> 292bdfcea1SArmin Le Grand #include <AreaPropertyPanel.hrc> 3066c1fc23SArmin Le Grand #include <svx/dialogs.hrc> 3166c1fc23SArmin Le Grand #include <svx/dialmgr.hxx> 3266c1fc23SArmin Le Grand #include <sfx2/objsh.hxx> 3366c1fc23SArmin Le Grand #include <svx/xfltrit.hxx> 3466c1fc23SArmin Le Grand #include <svx/xflftrit.hxx> 3566c1fc23SArmin Le Grand #include <svx/xtable.hxx> 3666c1fc23SArmin Le Grand #include <sfx2/dispatch.hxx> 3766c1fc23SArmin Le Grand #include <sfx2/bindings.hxx> 3866c1fc23SArmin Le Grand #include <helpid.hrc> 3966c1fc23SArmin Le Grand #include <svtools/valueset.hxx> 4066c1fc23SArmin Le Grand #include <unotools/pathoptions.hxx> 4166c1fc23SArmin Le Grand #include <svx/svxitems.hrc> 4266c1fc23SArmin Le Grand #include <vcl/toolbox.hxx> 438dcb2a10SAndre Fischer #include <svtools/toolbarmenu.hxx> 448dcb2a10SAndre Fischer #include "sidebar/ColorControl.hxx" 458dcb2a10SAndre Fischer 468dcb2a10SAndre Fischer #include <boost/bind.hpp> 4766c1fc23SArmin Le Grand 4866c1fc23SArmin Le Grand using namespace css; 4966c1fc23SArmin Le Grand using namespace cssu; 5066c1fc23SArmin Le Grand using ::sfx2::sidebar::Theme; 5166c1fc23SArmin Le Grand 5266c1fc23SArmin Le Grand #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) 5366c1fc23SArmin Le Grand 5466c1fc23SArmin Le Grand 5566c1fc23SArmin Le Grand 5666c1fc23SArmin Le Grand 578dcb2a10SAndre Fischer namespace svx { namespace sidebar { 5866c1fc23SArmin Le Grand 598dcb2a10SAndre Fischer const sal_Int32 AreaPropertyPanel::DEFAULT_CENTERX = 50; 608dcb2a10SAndre Fischer const sal_Int32 AreaPropertyPanel::DEFAULT_CENTERY = 50; 618dcb2a10SAndre Fischer const sal_Int32 AreaPropertyPanel::DEFAULT_ANGLE = 0; 628dcb2a10SAndre Fischer const sal_Int32 AreaPropertyPanel::DEFAULT_STARTVALUE = 0; 638dcb2a10SAndre Fischer const sal_Int32 AreaPropertyPanel::DEFAULT_ENDVALUE = 16777215; 648dcb2a10SAndre Fischer const sal_Int32 AreaPropertyPanel::DEFAULT_BORDER = 0; 6566c1fc23SArmin Le Grand 6666c1fc23SArmin Le Grand 6766c1fc23SArmin Le Grand AreaPropertyPanel::AreaPropertyPanel( 6866c1fc23SArmin Le Grand Window* pParent, 6966c1fc23SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 7066c1fc23SArmin Le Grand SfxBindings* pBindings) 71ee093554SAndre Fischer : Control(pParent, SVX_RES(RID_SIDEBAR_AREA_PANEL)), 72ee093554SAndre Fischer meLastXFS(-1), 73ee093554SAndre Fischer maLastColor(Color(COL_DEFAULT_SHAPE_FILLING)), 74ee093554SAndre Fischer mnLastPosGradient(0), 75ee093554SAndre Fischer mnLastPosHatch(0), 76ee093554SAndre Fischer mnLastPosBitmap(0), 77ee093554SAndre Fischer mnLastTransSolid(50), 78ee093554SAndre Fischer maGradientLinear(), 79ee093554SAndre Fischer maGradientAxial(), 80ee093554SAndre Fischer maGradientRadial(), 81ee093554SAndre Fischer maGradientElliptical(), 82ee093554SAndre Fischer maGradientSquare(), 83ee093554SAndre Fischer maGradientRect(), 84ee093554SAndre Fischer mpColorTextFT(new FixedText(this, SVX_RES(FT_COLOR_LIST))), 85ee093554SAndre Fischer mpLbFillType(new SvxFillTypeBox(this)), 86ee093554SAndre Fischer mpLbFillAttr(new SvxFillAttrBox(this)), 87ee093554SAndre Fischer mpToolBoxColorBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)), 88ee093554SAndre Fischer mpToolBoxColor(sfx2::sidebar::ControlFactory::CreateToolBox(mpToolBoxColorBackground.get(), SVX_RES(TB_COLOR))), 89ee093554SAndre Fischer mpTrspTextFT(new FixedText(this, SVX_RES(FL_TRSP_TEXT))), 90ee093554SAndre Fischer mpLBTransType(new ListBox(this, SVX_RES(LB_TRGR_TYPES))), 91ee093554SAndre Fischer mpMTRTransparent(new MetricField(this, SVX_RES(MTR_TRANSPARENT))), 92ee093554SAndre Fischer mpBTNGradientBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)), 93ee093554SAndre Fischer mpBTNGradient(sfx2::sidebar::ControlFactory::CreateToolBox(mpBTNGradientBackground.get(), SVX_RES(BTN_GRADIENT))), 94ee093554SAndre Fischer mpColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, TBI_COLOR, mpToolBoxColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)), 95ee093554SAndre Fischer mpStyleItem(), 96ee093554SAndre Fischer mpColorItem(), 97ee093554SAndre Fischer mpFillGradientItem(), 98ee093554SAndre Fischer mpHatchItem(), 99ee093554SAndre Fischer mpBitmapItem(), 100ee093554SAndre Fischer mpColorTableItem(), 101ee093554SAndre Fischer mpGradientListItem(), 102ee093554SAndre Fischer mpHatchListItem(), 103ee093554SAndre Fischer mpBitmapListItem(), 104ee093554SAndre Fischer maStyleControl(SID_ATTR_FILL_STYLE, *pBindings, *this), 105ee093554SAndre Fischer maColorControl(SID_ATTR_FILL_COLOR, *pBindings, *this), 106ee093554SAndre Fischer maGradientControl(SID_ATTR_FILL_GRADIENT, *pBindings, *this), 107ee093554SAndre Fischer maHatchControl(SID_ATTR_FILL_HATCH, *pBindings, *this), 108ee093554SAndre Fischer maBitmapControl(SID_ATTR_FILL_BITMAP, *pBindings, *this), 109ee093554SAndre Fischer maColorTableControl(SID_COLOR_TABLE, *pBindings, *this), 110ee093554SAndre Fischer maGradientListControl(SID_GRADIENT_LIST, *pBindings, *this), 111ee093554SAndre Fischer maHatchListControl(SID_HATCH_LIST, *pBindings, *this), 112ee093554SAndre Fischer maBitmapListControl(SID_BITMAP_LIST, *pBindings, *this), 113ee093554SAndre Fischer maFillTransparenceController(SID_ATTR_FILL_TRANSPARENCE, *pBindings, *this), 114ee093554SAndre Fischer maFillFloatTransparenceController(SID_ATTR_FILL_FLOATTRANSPARENCE, *pBindings, *this), 115ee093554SAndre Fischer maImgAxial(SVX_RES(IMG_AXIAL)), 116ee093554SAndre Fischer maImgElli(SVX_RES(IMG_ELLI)), 117ee093554SAndre Fischer maImgQuad(SVX_RES(IMG_QUAD)), 118ee093554SAndre Fischer maImgRadial(SVX_RES(IMG_RADIAL)), 119ee093554SAndre Fischer maImgSquare(SVX_RES(IMG_SQUARE)), 120ee093554SAndre Fischer maImgLinear(SVX_RES(IMG_LINEAR)), 121ee093554SAndre Fischer maImgColor(SVX_RES(IMG_COLOR)), 122ee093554SAndre Fischer maImgAxialH(SVX_RES(IMG_AXIAL_H)), 123ee093554SAndre Fischer maImgElliH(SVX_RES(IMG_ELLI_H)), 124ee093554SAndre Fischer maImgQuadH(SVX_RES(IMG_QUAD_H)), 125ee093554SAndre Fischer maImgRadialH(SVX_RES(IMG_RADIAL_H)), 126ee093554SAndre Fischer maImgSquareH(SVX_RES(IMG_SQUARE_H)), 127ee093554SAndre Fischer maImgLinearH(SVX_RES(IMG_LINEAR_H)), 128ee093554SAndre Fischer maImgColorH(SVX_RES(IMG_COLOR_H)), 129ee093554SAndre Fischer msHelpFillType(SVX_RES(STR_HELP_TYPE)), 130ee093554SAndre Fischer msHelpFillAttr(SVX_RES(STR_HELP_ATTR)), 131ee093554SAndre Fischer maTrGrPopup(this, ::boost::bind(&AreaPropertyPanel::CreateTransparencyGradientControl, this, _1)), 132ee093554SAndre Fischer maColorPopup(this, ::boost::bind(&AreaPropertyPanel::CreateColorPopupControl, this, _1)), 133ee093554SAndre Fischer mpFloatTransparenceItem(), 134ee093554SAndre Fischer mpTransparanceItem(), 135ee093554SAndre Fischer mxFrame(rxFrame), 136ee093554SAndre Fischer maContext(), 137ee093554SAndre Fischer mpBindings(pBindings), 138ee093554SAndre Fischer mbTBShow(true), 139ee093554SAndre Fischer mbColorAvail(true) 14066c1fc23SArmin Le Grand { 14166c1fc23SArmin Le Grand Initialize(); 14266c1fc23SArmin Le Grand FreeResource(); 14366c1fc23SArmin Le Grand } 14466c1fc23SArmin Le Grand 1458dcb2a10SAndre Fischer 14666c1fc23SArmin Le Grand 14766c1fc23SArmin Le Grand AreaPropertyPanel::~AreaPropertyPanel() 14866c1fc23SArmin Le Grand { 1498dcb2a10SAndre Fischer // Destroy the toolboxes, then their background windows. 1508dcb2a10SAndre Fischer mpToolBoxColor.reset(); 1518dcb2a10SAndre Fischer mpBTNGradient.reset(); 1528d3cb1a4SArmin Le Grand mpToolBoxColorBackground.reset(); 1538d3cb1a4SArmin Le Grand mpBTNGradientBackground.reset(); 15466c1fc23SArmin Le Grand } 15566c1fc23SArmin Le Grand 1568dcb2a10SAndre Fischer 15766c1fc23SArmin Le Grand 1586cdc6e4fSArmin Le Grand void AreaPropertyPanel::ShowMenu (void) 1596cdc6e4fSArmin Le Grand { 1606cdc6e4fSArmin Le Grand if (mpBindings != NULL) 1616cdc6e4fSArmin Le Grand { 1626cdc6e4fSArmin Le Grand SfxDispatcher* pDispatcher = mpBindings->GetDispatcher(); 1636cdc6e4fSArmin Le Grand if (pDispatcher != NULL) 1646cdc6e4fSArmin Le Grand pDispatcher->Execute(SID_ATTRIBUTES_AREA, SFX_CALLMODE_ASYNCHRON); 1656cdc6e4fSArmin Le Grand } 1666cdc6e4fSArmin Le Grand } 1676cdc6e4fSArmin Le Grand 1688dcb2a10SAndre Fischer 1696cdc6e4fSArmin Le Grand 17066c1fc23SArmin Le Grand void AreaPropertyPanel::Initialize() 17166c1fc23SArmin Le Grand { 17266c1fc23SArmin Le Grand maGradientLinear.SetXOffset(DEFAULT_CENTERX); 17366c1fc23SArmin Le Grand maGradientLinear.SetYOffset(DEFAULT_CENTERY); 17466c1fc23SArmin Le Grand maGradientLinear.SetAngle(DEFAULT_ANGLE); 17566c1fc23SArmin Le Grand maGradientLinear.SetStartColor(Color(DEFAULT_STARTVALUE)); 17666c1fc23SArmin Le Grand maGradientLinear.SetEndColor(Color(DEFAULT_ENDVALUE)); 17766c1fc23SArmin Le Grand maGradientLinear.SetBorder(DEFAULT_BORDER); 17866c1fc23SArmin Le Grand maGradientLinear.SetGradientStyle(XGRAD_LINEAR); 17966c1fc23SArmin Le Grand 18066c1fc23SArmin Le Grand maGradientAxial = maGradientLinear; 18166c1fc23SArmin Le Grand maGradientAxial.SetGradientStyle(XGRAD_AXIAL); 18266c1fc23SArmin Le Grand 18366c1fc23SArmin Le Grand maGradientRadial = maGradientLinear; 18466c1fc23SArmin Le Grand maGradientRadial.SetGradientStyle(XGRAD_RADIAL); 18566c1fc23SArmin Le Grand 18666c1fc23SArmin Le Grand maGradientElliptical = maGradientLinear; 18766c1fc23SArmin Le Grand maGradientElliptical.SetGradientStyle(XGRAD_ELLIPTICAL); 18866c1fc23SArmin Le Grand 18966c1fc23SArmin Le Grand maGradientSquare = maGradientLinear; 19066c1fc23SArmin Le Grand maGradientSquare.SetGradientStyle(XGRAD_SQUARE); 19166c1fc23SArmin Le Grand 19266c1fc23SArmin Le Grand maGradientRect = maGradientLinear; 19366c1fc23SArmin Le Grand maGradientRect.SetGradientStyle(XGRAD_RECT); 19466c1fc23SArmin Le Grand 19566c1fc23SArmin Le Grand Size aLogicalFillSize(MBOX_WIDTH,LISTBOX_HEIGHT); 19666c1fc23SArmin Le Grand Size aLogicalAttrSize(MBOX_WIDTH + 1,LISTBOX_HEIGHT); 19766c1fc23SArmin Le Grand 19866c1fc23SArmin Le Grand Point aPoint(SECTIONPAGE_MARGIN_HORIZONTAL,SECTIONPAGE_MARGIN_VERTICAL_TOP + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL); 19966c1fc23SArmin Le Grand Point aPoint_Picker(SECTIONPAGE_MARGIN_HORIZONTAL + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL,SECTIONPAGE_MARGIN_VERTICAL_TOP + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL); 20066c1fc23SArmin Le Grand 20166c1fc23SArmin Le Grand Size aTypeSize(LogicToPixel(aLogicalFillSize, MAP_APPFONT)); 20266c1fc23SArmin Le Grand Size aAttrSize(LogicToPixel(aLogicalAttrSize, MAP_APPFONT)); 20366c1fc23SArmin Le Grand 20466c1fc23SArmin Le Grand Point aTypePoint(LogicToPixel(aPoint, MAP_APPFONT)); 20566c1fc23SArmin Le Grand Point aAttrPoint(LogicToPixel(aPoint_Picker, MAP_APPFONT)); 20666c1fc23SArmin Le Grand 20766c1fc23SArmin Le Grand mpLbFillType->SetPosSizePixel(aTypePoint,aTypeSize); 20866c1fc23SArmin Le Grand mpLbFillAttr->SetPosSizePixel(aAttrPoint,aAttrSize); 20966c1fc23SArmin Le Grand 21066c1fc23SArmin Le Grand mpLbFillType->SetHelpId(HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES); 21166c1fc23SArmin Le Grand mpLbFillAttr->SetHelpId(HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR); 21266c1fc23SArmin Le Grand 21366c1fc23SArmin Le Grand mpLbFillType->SetQuickHelpText(msHelpFillType); 21466c1fc23SArmin Le Grand mpLbFillAttr->SetQuickHelpText(msHelpFillAttr); 21566c1fc23SArmin Le Grand 21666c1fc23SArmin Le Grand mpLbFillType->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fill"))); //wj acc 21766c1fc23SArmin Le Grand mpLbFillAttr->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fill"))); //wj acc 21866c1fc23SArmin Le Grand 21966c1fc23SArmin Le Grand Link aLink = LINK( this, AreaPropertyPanel, SelectFillTypeHdl ); 22066c1fc23SArmin Le Grand mpLbFillType->SetSelectHdl( aLink ); 22166c1fc23SArmin Le Grand 22266c1fc23SArmin Le Grand aLink = LINK( this, AreaPropertyPanel, SelectFillAttrHdl ); 22366c1fc23SArmin Le Grand mpLbFillAttr->SetSelectHdl( aLink ); 22466c1fc23SArmin Le Grand 22566c1fc23SArmin Le Grand //add for new color picker 22666c1fc23SArmin Le Grand mpLbFillAttr->Hide(); 22766c1fc23SArmin Le Grand mpToolBoxColor->SetItemImage(TBI_COLOR, GetDisplayBackground().GetColor().IsDark()? maImgColorH : maImgColor); 22866c1fc23SArmin Le Grand Size aTbxSize( mpToolBoxColor->CalcWindowSizePixel() ); 22966c1fc23SArmin Le Grand mpToolBoxColor->SetOutputSizePixel( aTbxSize ); 23066c1fc23SArmin Le Grand mpToolBoxColor->SetItemBits( TBI_COLOR, mpToolBoxColor->GetItemBits( TBI_COLOR ) | TIB_DROPDOWNONLY ); 23166c1fc23SArmin Le Grand mpToolBoxColor->SetBackground(Wallpaper()); 23266c1fc23SArmin Le Grand mpToolBoxColor->SetPaintTransparent(true); 23366c1fc23SArmin Le Grand mpToolBoxColor->SetQuickHelpText(TBI_COLOR, String(SVX_RES(STR_HELP_COLOR))); //wj acc 23466c1fc23SArmin Le Grand //mpToolBoxColor->SetItemText(TBI_COLOR, msHelpFillAttr); 23566c1fc23SArmin Le Grand 23666c1fc23SArmin Le Grand long aHeightLBStyle = mpLbFillType->GetSizePixel().getHeight(); 23766c1fc23SArmin Le Grand long aLBPosY = mpLbFillType->GetPosPixel().getY(); 23866c1fc23SArmin Le Grand long aHeightTBAttr = mpToolBoxColor->GetSizePixel().getHeight(); 23966c1fc23SArmin Le Grand Point aPointTBAttr = mpToolBoxColor->GetPosPixel(); 24066c1fc23SArmin Le Grand aPointTBAttr.setY( aLBPosY + aHeightLBStyle / 2 - aHeightTBAttr / 2); 24166c1fc23SArmin Le Grand mpToolBoxColor->SetPosPixel(aPointTBAttr); 24266c1fc23SArmin Le Grand 24366c1fc23SArmin Le Grand aLink = LINK(this, AreaPropertyPanel, ToolBoxColorDropHdl); 24466c1fc23SArmin Le Grand mpToolBoxColor->SetDropdownClickHdl ( aLink ); 24566c1fc23SArmin Le Grand mpToolBoxColor->SetSelectHdl ( aLink ); 24666c1fc23SArmin Le Grand 24766c1fc23SArmin Le Grand //add end 24866c1fc23SArmin Le Grand mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanel, ChangeTrgrTypeHdl_Impl)); 24966c1fc23SArmin Le Grand mpLBTransType->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Transparency"))); //wj acc 25066c1fc23SArmin Le Grand 25166c1fc23SArmin Le Grand mpMTRTransparent->SetValue( 50 ); 25266c1fc23SArmin Le Grand mpMTRTransparent->SetModifyHdl(LINK(this, AreaPropertyPanel, ModifyTransparentHdl_Impl)); 25366c1fc23SArmin Le Grand mpMTRTransparent->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Transparency"))); //wj acc 25466c1fc23SArmin Le Grand 25566c1fc23SArmin Le Grand mpBTNGradient->SetItemBits( TBI_BTX_GRADIENT, mpBTNGradient->GetItemBits( TBI_BTX_GRADIENT ) | TIB_DROPDOWNONLY ); 25666c1fc23SArmin Le Grand aLink = LINK( this, AreaPropertyPanel, ClickTrGrHdl_Impl ); 25766c1fc23SArmin Le Grand mpBTNGradient->SetDropdownClickHdl( aLink ); 25866c1fc23SArmin Le Grand mpBTNGradient->SetSelectHdl( aLink ); 25966c1fc23SArmin Le Grand aTbxSize = mpBTNGradient->CalcWindowSizePixel(); 26066c1fc23SArmin Le Grand mpBTNGradient->SetOutputSizePixel( aTbxSize ); 26166c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,maImgLinear); 26266c1fc23SArmin Le Grand mpBTNGradient->SetQuickHelpText(TBI_BTX_GRADIENT, String(SVX_RES(STR_HELP_GRADIENT))); //wj acc 26366c1fc23SArmin Le Grand mpBTNGradient->Hide(); 26466c1fc23SArmin Le Grand 26566c1fc23SArmin Le Grand long aHeightLBTrans = mpLBTransType->GetSizePixel().getHeight(); 26666c1fc23SArmin Le Grand Point aPointLB = mpLBTransType->GetPosPixel(); 26766c1fc23SArmin Le Grand long aPosY = aPointLB.getY(); 26866c1fc23SArmin Le Grand 26966c1fc23SArmin Le Grand Point aPointMetric = mpMTRTransparent->GetPosPixel(); 27066c1fc23SArmin Le Grand Point aPointTB = mpMTRTransparent->GetPosPixel(); 27166c1fc23SArmin Le Grand long aHeightMetric = mpMTRTransparent->GetSizePixel().getHeight(); 27266c1fc23SArmin Le Grand long aHeightTool = mpBTNGradient->GetSizePixel().getHeight(); 27366c1fc23SArmin Le Grand aPointMetric.setY(aPosY+aHeightLBTrans/2-aHeightMetric/2); 27466c1fc23SArmin Le Grand aPointTB.setY(aPosY+aHeightLBTrans/2-aHeightTool/2); 27566c1fc23SArmin Le Grand aPointTB.setX(aPointTB.getX()+3); 27666c1fc23SArmin Le Grand mpMTRTransparent->SetPosPixel(aPointMetric); 27766c1fc23SArmin Le Grand mpBTNGradient->SetPosPixel(aPointTB); 27866c1fc23SArmin Le Grand 27966c1fc23SArmin Le Grand mpLbFillType->SetAccessibleRelationLabeledBy(mpColorTextFT.get()); 28066c1fc23SArmin Le Grand mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr.get()); 28166c1fc23SArmin Le Grand mpToolBoxColor->SetAccessibleRelationLabeledBy(mpToolBoxColor.get()); 28266c1fc23SArmin Le Grand mpLBTransType->SetAccessibleRelationLabeledBy(mpTrspTextFT.get()); 28366c1fc23SArmin Le Grand mpMTRTransparent->SetAccessibleRelationLabeledBy(mpMTRTransparent.get()); 28466c1fc23SArmin Le Grand mpBTNGradient->SetAccessibleRelationLabeledBy(mpBTNGradient.get()); 28566c1fc23SArmin Le Grand 28666c1fc23SArmin Le Grand SetupIcons(); 28766c1fc23SArmin Le Grand } 28866c1fc23SArmin Le Grand 2898dcb2a10SAndre Fischer 29066c1fc23SArmin Le Grand 29189729eb3SArmin Le Grand IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox ) 29266c1fc23SArmin Le Grand { 29366c1fc23SArmin Le Grand XFillStyle eXFS = (XFillStyle)mpLbFillType->GetSelectEntryPos(); 29466c1fc23SArmin Le Grand 29558e893aeSArmin Le Grand if( (XFillStyle) meLastXFS != eXFS ) 29666c1fc23SArmin Le Grand { 29766c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 29866c1fc23SArmin Le Grand SfxObjectShell* pSh = SfxObjectShell::Current(); 29966c1fc23SArmin Le Grand XFillStyleItem aXFillStyleItem( eXFS ); 30066c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SFX_CALLMODE_RECORD, &aXFillStyleItem, 0L); 30166c1fc23SArmin Le Grand 30266c1fc23SArmin Le Grand switch( eXFS ) 30366c1fc23SArmin Le Grand { 30466c1fc23SArmin Le Grand case XFILL_NONE: 30566c1fc23SArmin Le Grand { 30666c1fc23SArmin Le Grand mpLbFillAttr->Show(); 30766c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 30866c1fc23SArmin Le Grand mbTBShow = false; 30966c1fc23SArmin Le Grand mpLbFillType->Selected(); 31066c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 31166c1fc23SArmin Le Grand } 31266c1fc23SArmin Le Grand break; 31366c1fc23SArmin Le Grand 31466c1fc23SArmin Le Grand case XFILL_SOLID: 31566c1fc23SArmin Le Grand { 31666c1fc23SArmin Le Grand mpLbFillAttr->Hide(); 31766c1fc23SArmin Le Grand mpToolBoxColor->Show(); 31866c1fc23SArmin Le Grand mbTBShow = true; 31966c1fc23SArmin Le Grand String aTmpStr; 32066c1fc23SArmin Le Grand Color aColor = maLastColor; 32166c1fc23SArmin Le Grand XFillColorItem aXFillColorItem( aTmpStr, aColor ); 32266c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SFX_CALLMODE_RECORD, &aXFillColorItem, 0L); 32366c1fc23SArmin Le Grand } 32466c1fc23SArmin Le Grand break; 32566c1fc23SArmin Le Grand 32666c1fc23SArmin Le Grand case XFILL_GRADIENT: 32766c1fc23SArmin Le Grand { 32866c1fc23SArmin Le Grand mpLbFillAttr->Show(); 32966c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 33066c1fc23SArmin Le Grand mbTBShow = false; 33166c1fc23SArmin Le Grand if ( pSh && pSh->GetItem( SID_GRADIENT_LIST ) ) 33266c1fc23SArmin Le Grand { 33366c1fc23SArmin Le Grand // 33466c1fc23SArmin Le Grand if(mpLbFillAttr->GetEntryCount() == 0) 33566c1fc23SArmin Le Grand { 33666c1fc23SArmin Le Grand SvxGradientListItem aItem( *(const SvxGradientListItem*)( 33766c1fc23SArmin Le Grand pSh->GetItem( SID_GRADIENT_LIST ) ) ); 33866c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 33966c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 34066c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetGradientList() ); 34166c1fc23SArmin Le Grand } 34266c1fc23SArmin Le Grand 34366c1fc23SArmin Le Grand if ( mnLastPosGradient != LISTBOX_ENTRY_NOTFOUND) 34466c1fc23SArmin Le Grand { 34566c1fc23SArmin Le Grand SvxGradientListItem aItem( *(const SvxGradientListItem*)( pSh->GetItem( SID_GRADIENT_LIST ) ) ); 34666c1fc23SArmin Le Grand if ( mnLastPosGradient < aItem.GetGradientList()->Count() ) 34766c1fc23SArmin Le Grand { 34866c1fc23SArmin Le Grand XGradient aGradient = aItem.GetGradientList()->GetGradient( mnLastPosGradient )->GetGradient(); 34966c1fc23SArmin Le Grand XFillGradientItem aXFillGradientItem( mpLbFillAttr->GetEntry(mnLastPosGradient), aGradient ); 35066c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_GRADIENT, SFX_CALLMODE_RECORD, &aXFillGradientItem, 0L); 35166c1fc23SArmin Le Grand mpLbFillAttr->SelectEntryPos(mnLastPosGradient); //add 35266c1fc23SArmin Le Grand } 35366c1fc23SArmin Le Grand } 35466c1fc23SArmin Le Grand } 35566c1fc23SArmin Le Grand else 35666c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 35766c1fc23SArmin Le Grand } 35866c1fc23SArmin Le Grand break; 35966c1fc23SArmin Le Grand 36066c1fc23SArmin Le Grand case XFILL_HATCH: 36166c1fc23SArmin Le Grand { 36266c1fc23SArmin Le Grand mpLbFillAttr->Show(); 36366c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 36466c1fc23SArmin Le Grand mbTBShow = false; 36566c1fc23SArmin Le Grand if ( pSh && pSh->GetItem( SID_HATCH_LIST ) ) 36666c1fc23SArmin Le Grand { 36766c1fc23SArmin Le Grand // 36866c1fc23SArmin Le Grand if(mpLbFillAttr->GetEntryCount() == 0) 36966c1fc23SArmin Le Grand { 37066c1fc23SArmin Le Grand SvxHatchListItem aItem( *(const SvxHatchListItem*)( 37166c1fc23SArmin Le Grand pSh->GetItem( SID_HATCH_LIST ) ) ); 37266c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 37366c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 37466c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetHatchList() ); 37566c1fc23SArmin Le Grand } 37666c1fc23SArmin Le Grand 37766c1fc23SArmin Le Grand if ( mnLastPosHatch != LISTBOX_ENTRY_NOTFOUND ) 37866c1fc23SArmin Le Grand { 37966c1fc23SArmin Le Grand SvxHatchListItem aItem( *(const SvxHatchListItem*)( pSh->GetItem( SID_HATCH_LIST ) ) ); 38066c1fc23SArmin Le Grand if ( mnLastPosHatch < aItem.GetHatchList()->Count() ) 38166c1fc23SArmin Le Grand { 38266c1fc23SArmin Le Grand XHatch aHatch = aItem.GetHatchList()->GetHatch( mnLastPosHatch )->GetHatch(); 38366c1fc23SArmin Le Grand XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch ); 38466c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_HATCH, SFX_CALLMODE_RECORD, &aXFillHatchItem, 0L); 38566c1fc23SArmin Le Grand mpLbFillAttr->SelectEntryPos(mnLastPosHatch); //add 38666c1fc23SArmin Le Grand } 38766c1fc23SArmin Le Grand } 38866c1fc23SArmin Le Grand } 38966c1fc23SArmin Le Grand else 39066c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 39166c1fc23SArmin Le Grand } 39266c1fc23SArmin Le Grand break; 39366c1fc23SArmin Le Grand 39466c1fc23SArmin Le Grand case XFILL_BITMAP: 39566c1fc23SArmin Le Grand { 39666c1fc23SArmin Le Grand mpLbFillAttr->Show(); 39766c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 39866c1fc23SArmin Le Grand mbTBShow = false; 39966c1fc23SArmin Le Grand if ( pSh && pSh->GetItem( SID_BITMAP_LIST ) ) 40066c1fc23SArmin Le Grand { 40166c1fc23SArmin Le Grand // 40266c1fc23SArmin Le Grand if(mpLbFillAttr->GetEntryCount() == 0) 40366c1fc23SArmin Le Grand { 40466c1fc23SArmin Le Grand SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( 40566c1fc23SArmin Le Grand pSh->GetItem( SID_BITMAP_LIST ) ) ); 40666c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 40766c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 40866c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetBitmapList() ); 40966c1fc23SArmin Le Grand } 41066c1fc23SArmin Le Grand 41166c1fc23SArmin Le Grand if ( mnLastPosBitmap != LISTBOX_ENTRY_NOTFOUND ) 41266c1fc23SArmin Le Grand { 41366c1fc23SArmin Le Grand SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( pSh->GetItem( SID_BITMAP_LIST ) ) ); 41466c1fc23SArmin Le Grand if ( mnLastPosBitmap < aItem.GetBitmapList()->Count() ) 41566c1fc23SArmin Le Grand { 41666c1fc23SArmin Le Grand const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap); 41766c1fc23SArmin Le Grand XFillBitmapItem aXFillBitmapItem( mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject() ); 41866c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_BITMAP, SFX_CALLMODE_RECORD, &aXFillBitmapItem, 0L); 41966c1fc23SArmin Le Grand mpLbFillAttr->SelectEntryPos(mnLastPosBitmap); //add 42066c1fc23SArmin Le Grand } 42166c1fc23SArmin Le Grand } 42266c1fc23SArmin Le Grand } 42366c1fc23SArmin Le Grand else 42466c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 42566c1fc23SArmin Le Grand } 42666c1fc23SArmin Le Grand break; 42766c1fc23SArmin Le Grand } 42858e893aeSArmin Le Grand meLastXFS = (sal_uInt16)eXFS; 42966c1fc23SArmin Le Grand if( eXFS != XFILL_NONE ) 43066c1fc23SArmin Le Grand { 43189729eb3SArmin Le Grand if ( pToolBox ) 43266c1fc23SArmin Le Grand mpLbFillType->Selected(); 43366c1fc23SArmin Le Grand } 43466c1fc23SArmin Le Grand } 43566c1fc23SArmin Le Grand return 0; 43666c1fc23SArmin Le Grand } 43766c1fc23SArmin Le Grand 4388dcb2a10SAndre Fischer 43966c1fc23SArmin Le Grand 44089729eb3SArmin Le Grand IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox ) 44166c1fc23SArmin Le Grand { 44289729eb3SArmin Le Grand XFillStyle eXFS = (XFillStyle)mpLbFillType->GetSelectEntryPos(); 44389729eb3SArmin Le Grand XFillStyleItem aXFillStyleItem( eXFS ); 44489729eb3SArmin Le Grand SfxObjectShell* pSh = SfxObjectShell::Current(); 44566c1fc23SArmin Le Grand 44689729eb3SArmin Le Grand if(pToolBox) 44766c1fc23SArmin Le Grand { 44858e893aeSArmin Le Grand if( (XFillStyle) meLastXFS != eXFS ) 44966c1fc23SArmin Le Grand { 45066c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SFX_CALLMODE_RECORD, &aXFillStyleItem, 0L); //Added 20090909 45166c1fc23SArmin Le Grand } 45266c1fc23SArmin Le Grand 45366c1fc23SArmin Le Grand switch( eXFS ) 45466c1fc23SArmin Le Grand { 45566c1fc23SArmin Le Grand case XFILL_SOLID: 45666c1fc23SArmin Le Grand //{ 45766c1fc23SArmin Le Grand // //String aTmpStr = mpLbFillAttr->GetSelectEntry(); 45866c1fc23SArmin Le Grand // //Color aColor = mpLbFillAttr->GetSelectEntryColor(); 45966c1fc23SArmin Le Grand // //if(aColor.GetColor() == 0 && aTmpStr.Equals(String::CreateFromAscii(""))) 46066c1fc23SArmin Le Grand // String aTmpStr; 46166c1fc23SArmin Le Grand // Color aColor = maLastColor; 46266c1fc23SArmin Le Grand // XFillColorItem aXFillColorItem( aTmpStr, aColor ); 46366c1fc23SArmin Le Grand // GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SFX_CALLMODE_RECORD, &aXFillColorItem, 0L); 46466c1fc23SArmin Le Grand // maLastColor = aColor; 46566c1fc23SArmin Le Grand //} 46666c1fc23SArmin Le Grand break; 46766c1fc23SArmin Le Grand 46866c1fc23SArmin Le Grand case XFILL_GRADIENT: 46966c1fc23SArmin Le Grand { 47066c1fc23SArmin Le Grand sal_uInt16 nPos = mpLbFillAttr->GetSelectEntryPos(); 47166c1fc23SArmin Le Grand if( nPos == LISTBOX_ENTRY_NOTFOUND ) 47266c1fc23SArmin Le Grand nPos = mnLastPosGradient; 47366c1fc23SArmin Le Grand 47466c1fc23SArmin Le Grand if ( nPos != LISTBOX_ENTRY_NOTFOUND && pSh && pSh->GetItem( SID_GRADIENT_LIST ) ) 47566c1fc23SArmin Le Grand { 47666c1fc23SArmin Le Grand SvxGradientListItem aItem( *(const SvxGradientListItem*)( pSh->GetItem( SID_GRADIENT_LIST ) ) ); 47766c1fc23SArmin Le Grand if ( nPos < aItem.GetGradientList()->Count() ) 47866c1fc23SArmin Le Grand { 47966c1fc23SArmin Le Grand XGradient aGradient = aItem.GetGradientList()->GetGradient( nPos )->GetGradient(); 48066c1fc23SArmin Le Grand XFillGradientItem aXFillGradientItem( mpLbFillAttr->GetSelectEntry(), aGradient ); 48166c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_GRADIENT, SFX_CALLMODE_RECORD, &aXFillGradientItem, 0L); 48266c1fc23SArmin Le Grand } 48366c1fc23SArmin Le Grand } 48466c1fc23SArmin Le Grand if(nPos != LISTBOX_ENTRY_NOTFOUND) 48566c1fc23SArmin Le Grand mnLastPosGradient = nPos; 48666c1fc23SArmin Le Grand } 48766c1fc23SArmin Le Grand break; 48866c1fc23SArmin Le Grand 48966c1fc23SArmin Le Grand case XFILL_HATCH: 49066c1fc23SArmin Le Grand { 49166c1fc23SArmin Le Grand sal_uInt16 nPos = mpLbFillAttr->GetSelectEntryPos(); 49266c1fc23SArmin Le Grand if( nPos == LISTBOX_ENTRY_NOTFOUND ) 49366c1fc23SArmin Le Grand nPos = mnLastPosHatch; 49466c1fc23SArmin Le Grand if ( nPos != LISTBOX_ENTRY_NOTFOUND && pSh && pSh->GetItem( SID_HATCH_LIST ) ) 49566c1fc23SArmin Le Grand { 49666c1fc23SArmin Le Grand SvxHatchListItem aItem( *(const SvxHatchListItem*)( pSh->GetItem( SID_HATCH_LIST ) ) ); 49766c1fc23SArmin Le Grand if ( nPos < aItem.GetHatchList()->Count() ) 49866c1fc23SArmin Le Grand { 49966c1fc23SArmin Le Grand XHatch aHatch = aItem.GetHatchList()->GetHatch( nPos )->GetHatch(); 50066c1fc23SArmin Le Grand XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch ); 50166c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_HATCH, SFX_CALLMODE_RECORD, &aXFillHatchItem, 0L); 50266c1fc23SArmin Le Grand } 50366c1fc23SArmin Le Grand } 50466c1fc23SArmin Le Grand if(nPos != LISTBOX_ENTRY_NOTFOUND) 50566c1fc23SArmin Le Grand mnLastPosHatch = nPos; 50666c1fc23SArmin Le Grand } 50766c1fc23SArmin Le Grand break; 50866c1fc23SArmin Le Grand 50966c1fc23SArmin Le Grand case XFILL_BITMAP: 51066c1fc23SArmin Le Grand { 51166c1fc23SArmin Le Grand sal_uInt16 nPos = mpLbFillAttr->GetSelectEntryPos(); 51266c1fc23SArmin Le Grand if( nPos == LISTBOX_ENTRY_NOTFOUND ) 51366c1fc23SArmin Le Grand nPos = mnLastPosBitmap; 51466c1fc23SArmin Le Grand if ( nPos != LISTBOX_ENTRY_NOTFOUND && pSh && pSh->GetItem( SID_BITMAP_LIST ) ) 51566c1fc23SArmin Le Grand { 51666c1fc23SArmin Le Grand SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( pSh->GetItem( SID_BITMAP_LIST ) ) ); 51766c1fc23SArmin Le Grand if ( nPos < aItem.GetBitmapList()->Count() ) 51866c1fc23SArmin Le Grand { 51966c1fc23SArmin Le Grand const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos); 52066c1fc23SArmin Le Grand XFillBitmapItem aXFillBitmapItem( mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject() ); 52166c1fc23SArmin Le Grand GetBindings()->GetDispatcher()->Execute(SID_ATTR_FILL_BITMAP, SFX_CALLMODE_RECORD, &aXFillBitmapItem, 0L); 52266c1fc23SArmin Le Grand } 52366c1fc23SArmin Le Grand } 52466c1fc23SArmin Le Grand if(nPos != LISTBOX_ENTRY_NOTFOUND) 52566c1fc23SArmin Le Grand mnLastPosBitmap = nPos; 52666c1fc23SArmin Le Grand } 52766c1fc23SArmin Le Grand break; 5288dcb2a10SAndre Fischer 5298dcb2a10SAndre Fischer default: 5308dcb2a10SAndre Fischer break; 53166c1fc23SArmin Le Grand } 53266c1fc23SArmin Le Grand } 53366c1fc23SArmin Le Grand return 0; 53466c1fc23SArmin Le Grand } 53566c1fc23SArmin Le Grand 5368dcb2a10SAndre Fischer 53766c1fc23SArmin Le Grand //add for color picker 53866c1fc23SArmin Le Grand 53989729eb3SArmin Le Grand IMPL_LINK(AreaPropertyPanel, ToolBoxColorDropHdl, ToolBox*, pToolBox) 54066c1fc23SArmin Le Grand { 54189729eb3SArmin Le Grand sal_uInt16 nId = pToolBox->GetCurItemId(); 54289729eb3SArmin Le Grand 54389729eb3SArmin Le Grand if(nId == TBI_COLOR) 54489729eb3SArmin Le Grand { 5458dcb2a10SAndre Fischer maColorPopup.Show(*pToolBox); 5468dcb2a10SAndre Fischer if (mpColorItem) 5478dcb2a10SAndre Fischer maColorPopup.SetCurrentColor(mpColorItem->GetColorValue(), mbColorAvail); 54866c1fc23SArmin Le Grand else 5498dcb2a10SAndre Fischer maColorPopup.SetCurrentColor(COL_WHITE, false); 55066c1fc23SArmin Le Grand } 55189729eb3SArmin Le Grand 55289729eb3SArmin Le Grand return 0; 55366c1fc23SArmin Le Grand } 55466c1fc23SArmin Le Grand 55566c1fc23SArmin Le Grand 5568dcb2a10SAndre Fischer 5578dcb2a10SAndre Fischer void AreaPropertyPanel::SetColor ( 5588dcb2a10SAndre Fischer const String& rsColorName, 5598dcb2a10SAndre Fischer const Color aColor) 56066c1fc23SArmin Le Grand { 5618dcb2a10SAndre Fischer XFillColorItem aXFillColorItem (rsColorName, aColor); 5628dcb2a10SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_FILL_COLOR, SFX_CALLMODE_RECORD, &aXFillColorItem, 0L); 5638dcb2a10SAndre Fischer maLastColor = aColor; 56466c1fc23SArmin Le Grand } 56566c1fc23SArmin Le Grand 56666c1fc23SArmin Le Grand 56766c1fc23SArmin Le Grand 5688dcb2a10SAndre Fischer 5698dcb2a10SAndre Fischer PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent) 5708dcb2a10SAndre Fischer { 5718dcb2a10SAndre Fischer return new AreaTransparencyGradientControl(pParent, *this); 57266c1fc23SArmin Le Grand } 57366c1fc23SArmin Le Grand 57466c1fc23SArmin Le Grand 57566c1fc23SArmin Le Grand 5768dcb2a10SAndre Fischer 5778dcb2a10SAndre Fischer PopupControl* AreaPropertyPanel::CreateColorPopupControl (PopupContainer* pParent) 5788dcb2a10SAndre Fischer { 5798dcb2a10SAndre Fischer return new ColorControl( 5808dcb2a10SAndre Fischer pParent, 5818dcb2a10SAndre Fischer mpBindings, 5828dcb2a10SAndre Fischer SVX_RES(RID_POPUPPANEL_AERAPAGE_COLOR), 5838dcb2a10SAndre Fischer SVX_RES(VS_COLOR), 5848dcb2a10SAndre Fischer ::boost::bind(&AreaPropertyPanel::GetLastColor, this), 5858dcb2a10SAndre Fischer ::boost::bind(&AreaPropertyPanel::SetColor, this, _1,_2), 5868dcb2a10SAndre Fischer pParent, 5878dcb2a10SAndre Fischer 0); 58866c1fc23SArmin Le Grand } 58966c1fc23SArmin Le Grand 5908dcb2a10SAndre Fischer 5918dcb2a10SAndre Fischer 59266c1fc23SArmin Le Grand 59366c1fc23SArmin Le Grand void AreaPropertyPanel::SetupIcons(void) 59466c1fc23SArmin Le Grand { 59566c1fc23SArmin Le Grand if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons)) 59666c1fc23SArmin Le Grand { 59766c1fc23SArmin Le Grand // todo 59866c1fc23SArmin Le Grand } 59966c1fc23SArmin Le Grand else 60066c1fc23SArmin Le Grand { 60166c1fc23SArmin Le Grand // todo 60266c1fc23SArmin Le Grand } 60366c1fc23SArmin Le Grand } 60466c1fc23SArmin Le Grand 6058dcb2a10SAndre Fischer 60666c1fc23SArmin Le Grand 60766c1fc23SArmin Le Grand AreaPropertyPanel* AreaPropertyPanel::Create ( 60866c1fc23SArmin Le Grand Window* pParent, 60966c1fc23SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 61066c1fc23SArmin Le Grand SfxBindings* pBindings) 61166c1fc23SArmin Le Grand { 61266c1fc23SArmin Le Grand if (pParent == NULL) 61366c1fc23SArmin Le Grand throw lang::IllegalArgumentException(A2S("no parent Window given to AreaPropertyPanel::Create"), NULL, 0); 61466c1fc23SArmin Le Grand if ( ! rxFrame.is()) 61566c1fc23SArmin Le Grand throw lang::IllegalArgumentException(A2S("no XFrame given to AreaPropertyPanel::Create"), NULL, 1); 61666c1fc23SArmin Le Grand if (pBindings == NULL) 61766c1fc23SArmin Le Grand throw lang::IllegalArgumentException(A2S("no SfxBindings given to AreaPropertyPanel::Create"), NULL, 2); 61866c1fc23SArmin Le Grand 61966c1fc23SArmin Le Grand return new AreaPropertyPanel( 62066c1fc23SArmin Le Grand pParent, 62166c1fc23SArmin Le Grand rxFrame, 62266c1fc23SArmin Le Grand pBindings); 62366c1fc23SArmin Le Grand } 62466c1fc23SArmin Le Grand 6258dcb2a10SAndre Fischer 62666c1fc23SArmin Le Grand 62766c1fc23SArmin Le Grand void AreaPropertyPanel::DataChanged( 62866c1fc23SArmin Le Grand const DataChangedEvent& rEvent) 62966c1fc23SArmin Le Grand { 63066c1fc23SArmin Le Grand (void)rEvent; 63166c1fc23SArmin Le Grand 63266c1fc23SArmin Le Grand SetupIcons(); 63366c1fc23SArmin Le Grand } 63466c1fc23SArmin Le Grand 6358dcb2a10SAndre Fischer 63666c1fc23SArmin Le Grand 63766c1fc23SArmin Le Grand void AreaPropertyPanel::HandleContextChange( 63866c1fc23SArmin Le Grand const ::sfx2::sidebar::EnumContext aContext) 63966c1fc23SArmin Le Grand { 64066c1fc23SArmin Le Grand if(maContext == aContext) 64166c1fc23SArmin Le Grand { 64266c1fc23SArmin Le Grand // Nothing to do. 64366c1fc23SArmin Le Grand return; 64466c1fc23SArmin Le Grand } 64566c1fc23SArmin Le Grand 64666c1fc23SArmin Le Grand maContext = aContext; 64766c1fc23SArmin Le Grand 64866c1fc23SArmin Le Grand 64966c1fc23SArmin Le Grand 65066c1fc23SArmin Le Grand // todo 65166c1fc23SArmin Le Grand } 65266c1fc23SArmin Le Grand 6538dcb2a10SAndre Fischer 65466c1fc23SArmin Le Grand 655d5370dc8SArmin Le Grand void AreaPropertyPanel::ImpUpdateTransparencies() 656d5370dc8SArmin Le Grand { 657d5370dc8SArmin Le Grand if(mpTransparanceItem.get() || mpFloatTransparenceItem.get()) 658d5370dc8SArmin Le Grand { 659d5370dc8SArmin Le Grand bool bZeroValue(false); 660d5370dc8SArmin Le Grand 661d5370dc8SArmin Le Grand if(mpTransparanceItem.get()) 662d5370dc8SArmin Le Grand { 663d5370dc8SArmin Le Grand const sal_uInt16 nValue(mpTransparanceItem->GetValue()); 664d5370dc8SArmin Le Grand 665d5370dc8SArmin Le Grand if(!nValue) 666d5370dc8SArmin Le Grand { 667d5370dc8SArmin Le Grand bZeroValue = true; 668d5370dc8SArmin Le Grand } 669d5370dc8SArmin Le Grand else if(nValue <= 100) 670d5370dc8SArmin Le Grand { 671d5370dc8SArmin Le Grand mpLBTransType->Enable(); 672d5370dc8SArmin Le Grand mpLBTransType->SelectEntryPos(1); 673d5370dc8SArmin Le Grand mpBTNGradient->Hide(); 674d5370dc8SArmin Le Grand mpMTRTransparent->Show(); 675d5370dc8SArmin Le Grand mpMTRTransparent->Enable(); 676d5370dc8SArmin Le Grand mpMTRTransparent->SetValue(nValue); 677d5370dc8SArmin Le Grand } 678d5370dc8SArmin Le Grand 679*eb6ac606SArmin Le Grand if(!bZeroValue) 680*eb6ac606SArmin Le Grand { 681*eb6ac606SArmin Le Grand maTrGrPopup.Hide(); 682*eb6ac606SArmin Le Grand } 683d5370dc8SArmin Le Grand } 684d5370dc8SArmin Le Grand 685d5370dc8SArmin Le Grand if(bZeroValue && mpFloatTransparenceItem.get()) 686d5370dc8SArmin Le Grand { 687d5370dc8SArmin Le Grand if(mpFloatTransparenceItem->IsEnabled()) 688d5370dc8SArmin Le Grand { 689d5370dc8SArmin Le Grand const XGradient& rGradient = mpFloatTransparenceItem->GetGradientValue(); 690d5370dc8SArmin Le Grand const bool bHighContrast(GetSettings().GetStyleSettings().GetHighContrastMode()); 691d5370dc8SArmin Le Grand sal_uInt16 nEntryPos(0); 692d5370dc8SArmin Le Grand Image* pImage = 0; 693d5370dc8SArmin Le Grand 694d5370dc8SArmin Le Grand mpLBTransType->Enable(); 695d5370dc8SArmin Le Grand mpMTRTransparent->Hide(); 696d5370dc8SArmin Le Grand mpBTNGradient->Enable(); 697d5370dc8SArmin Le Grand mpBTNGradient->Show(); 698d5370dc8SArmin Le Grand 699d5370dc8SArmin Le Grand switch(rGradient.GetGradientStyle()) 700d5370dc8SArmin Le Grand { 701d5370dc8SArmin Le Grand case XGRAD_LINEAR: 702d5370dc8SArmin Le Grand { 703d5370dc8SArmin Le Grand nEntryPos = 2; 704d5370dc8SArmin Le Grand pImage = bHighContrast ? &maImgLinearH : &maImgLinear; 705d5370dc8SArmin Le Grand break; 706d5370dc8SArmin Le Grand } 707d5370dc8SArmin Le Grand case XGRAD_AXIAL: 708d5370dc8SArmin Le Grand { 709d5370dc8SArmin Le Grand nEntryPos = 3; 710d5370dc8SArmin Le Grand pImage = bHighContrast ? &maImgAxialH : &maImgAxial; 711d5370dc8SArmin Le Grand break; 712d5370dc8SArmin Le Grand } 713d5370dc8SArmin Le Grand case XGRAD_RADIAL: 714d5370dc8SArmin Le Grand { 715d5370dc8SArmin Le Grand nEntryPos = 4; 716d5370dc8SArmin Le Grand pImage = bHighContrast ? &maImgRadialH : &maImgRadial; 717d5370dc8SArmin Le Grand break; 718d5370dc8SArmin Le Grand } 719d5370dc8SArmin Le Grand case XGRAD_ELLIPTICAL: 720d5370dc8SArmin Le Grand { 721d5370dc8SArmin Le Grand nEntryPos = 5; 722d5370dc8SArmin Le Grand pImage = bHighContrast ? &maImgElliH : &maImgElli; 723d5370dc8SArmin Le Grand break; 724d5370dc8SArmin Le Grand } 725d5370dc8SArmin Le Grand case XGRAD_SQUARE: 726d5370dc8SArmin Le Grand { 727d5370dc8SArmin Le Grand nEntryPos = 6; 728d5370dc8SArmin Le Grand pImage = bHighContrast ? &maImgQuadH : &maImgQuad; 729d5370dc8SArmin Le Grand break; 730d5370dc8SArmin Le Grand } 731d5370dc8SArmin Le Grand case XGRAD_RECT: 732d5370dc8SArmin Le Grand { 733d5370dc8SArmin Le Grand nEntryPos = 7; 734d5370dc8SArmin Le Grand pImage = bHighContrast ? &maImgSquareH : &maImgSquare; 735d5370dc8SArmin Le Grand break; 736d5370dc8SArmin Le Grand } 737d5370dc8SArmin Le Grand } 738d5370dc8SArmin Le Grand 739d5370dc8SArmin Le Grand mpLBTransType->SelectEntryPos(nEntryPos); 740d5370dc8SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT, *pImage); 741d5370dc8SArmin Le Grand bZeroValue = false; 742d5370dc8SArmin Le Grand } 743d5370dc8SArmin Le Grand else 744d5370dc8SArmin Le Grand { 745d5370dc8SArmin Le Grand bZeroValue = true; 746d5370dc8SArmin Le Grand } 747d5370dc8SArmin Le Grand } 748d5370dc8SArmin Le Grand 749d5370dc8SArmin Le Grand if(bZeroValue) 750d5370dc8SArmin Le Grand { 751d5370dc8SArmin Le Grand mpLBTransType->Enable(); 752d5370dc8SArmin Le Grand mpLBTransType->SelectEntryPos(0); 753d5370dc8SArmin Le Grand mpBTNGradient->Hide(); 754d5370dc8SArmin Le Grand mpMTRTransparent->Enable(); 755d5370dc8SArmin Le Grand mpMTRTransparent->Show(); 756d5370dc8SArmin Le Grand mpMTRTransparent->SetValue(0); 757d5370dc8SArmin Le Grand } 758d5370dc8SArmin Le Grand } 759d5370dc8SArmin Le Grand else 760d5370dc8SArmin Le Grand { 761d5370dc8SArmin Le Grand // no transparency at all 762d5370dc8SArmin Le Grand mpLBTransType->SetNoSelection(); 763d5370dc8SArmin Le Grand mpMTRTransparent->Disable(); 764d5370dc8SArmin Le Grand mpMTRTransparent->Show(); 765d5370dc8SArmin Le Grand mpBTNGradient->Disable(); 766d5370dc8SArmin Le Grand mpBTNGradient->Hide(); 767d5370dc8SArmin Le Grand } 768*eb6ac606SArmin Le Grand } 769d5370dc8SArmin Le Grand 770d5370dc8SArmin Le Grand 771d5370dc8SArmin Le Grand 77266c1fc23SArmin Le Grand void AreaPropertyPanel::NotifyItemUpdate( 77366c1fc23SArmin Le Grand sal_uInt16 nSID, 77466c1fc23SArmin Le Grand SfxItemState eState, 77566c1fc23SArmin Le Grand const SfxPoolItem* pState) 77666c1fc23SArmin Le Grand { 77766c1fc23SArmin Le Grand XFillStyle eXFS; 778d5370dc8SArmin Le Grand SfxObjectShell* pSh = SfxObjectShell::Current(); 779d5370dc8SArmin Le Grand bool bFillTransparenceChanged(false); 78066c1fc23SArmin Le Grand 781d5370dc8SArmin Le Grand if(SID_ATTR_FILL_TRANSPARENCE == nSID) 782d5370dc8SArmin Le Grand { 783d5370dc8SArmin Le Grand bFillTransparenceChanged = true; 784d5370dc8SArmin Le Grand 785d5370dc8SArmin Le Grand if(eState >= SFX_ITEM_AVAILABLE) 786d5370dc8SArmin Le Grand { 787d5370dc8SArmin Le Grand const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState); 78866c1fc23SArmin Le Grand 789d5370dc8SArmin Le Grand if(pItem && (!mpTransparanceItem || *pItem != *mpTransparanceItem)) 79066c1fc23SArmin Le Grand { 791d5370dc8SArmin Le Grand mpTransparanceItem.reset((SfxUInt16Item*)pItem->Clone()); 792d5370dc8SArmin Le Grand } 793d5370dc8SArmin Le Grand else 794d5370dc8SArmin Le Grand { 795d5370dc8SArmin Le Grand mpTransparanceItem.reset(); 796d5370dc8SArmin Le Grand } 797d5370dc8SArmin Le Grand } 798d5370dc8SArmin Le Grand else 799d5370dc8SArmin Le Grand { 800d5370dc8SArmin Le Grand mpTransparanceItem.reset(); 801d5370dc8SArmin Le Grand } 802d5370dc8SArmin Le Grand } 803d5370dc8SArmin Le Grand else if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID) 804d5370dc8SArmin Le Grand { 805d5370dc8SArmin Le Grand bFillTransparenceChanged = true; 80666c1fc23SArmin Le Grand 807d5370dc8SArmin Le Grand if(eState >= SFX_ITEM_AVAILABLE) 808d5370dc8SArmin Le Grand { 809d5370dc8SArmin Le Grand const XFillFloatTransparenceItem* pItem = dynamic_cast< const XFillFloatTransparenceItem* >(pState); 810d5370dc8SArmin Le Grand 811d5370dc8SArmin Le Grand if(pItem && (!mpFloatTransparenceItem || *pItem != *mpFloatTransparenceItem)) 812d5370dc8SArmin Le Grand { 813d5370dc8SArmin Le Grand mpFloatTransparenceItem.reset((XFillFloatTransparenceItem*)pItem->Clone()); 814d5370dc8SArmin Le Grand } 815d5370dc8SArmin Le Grand else 816d5370dc8SArmin Le Grand { 817d5370dc8SArmin Le Grand mpFloatTransparenceItem.reset(); 818d5370dc8SArmin Le Grand } 819d5370dc8SArmin Le Grand } 820d5370dc8SArmin Le Grand else 821d5370dc8SArmin Le Grand { 822d5370dc8SArmin Le Grand mpFloatTransparenceItem.reset(); 823d5370dc8SArmin Le Grand } 824d5370dc8SArmin Le Grand } 825d5370dc8SArmin Le Grand 826d5370dc8SArmin Le Grand if(bFillTransparenceChanged) 827d5370dc8SArmin Le Grand { 828d5370dc8SArmin Le Grand // update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem 829d5370dc8SArmin Le Grand ImpUpdateTransparencies(); 830d5370dc8SArmin Le Grand } 831d5370dc8SArmin Le Grand 832d5370dc8SArmin Le Grand if (nSID == SID_ATTR_FILL_STYLE ) 83366c1fc23SArmin Le Grand { 83466c1fc23SArmin Le Grand if( eState == SFX_ITEM_DISABLED ) 83566c1fc23SArmin Le Grand { 83666c1fc23SArmin Le Grand mpLbFillType->Disable(); 83766c1fc23SArmin Le Grand mpLbFillType->SetNoSelection(); 83866c1fc23SArmin Le Grand mpLbFillAttr->Show(); 83966c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 84066c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 84166c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 84266c1fc23SArmin Le Grand mbTBShow = false; 84358e893aeSArmin Le Grand meLastXFS = -1; 84466c1fc23SArmin Le Grand mpStyleItem.reset(); 84566c1fc23SArmin Le Grand } 84666c1fc23SArmin Le Grand else if( SFX_ITEM_AVAILABLE == eState ) 84766c1fc23SArmin Le Grand { 84858e893aeSArmin Le Grand mpStyleItem.reset(pState ? (XFillStyleItem*)pState->Clone() : 0); 84966c1fc23SArmin Le Grand mpLbFillType->Enable(); 85066c1fc23SArmin Le Grand 85166c1fc23SArmin Le Grand eXFS = (XFillStyle)mpStyleItem->GetValue(); 85258e893aeSArmin Le Grand meLastXFS = eXFS; 85366c1fc23SArmin Le Grand mpLbFillType->SelectEntryPos( 85466c1fc23SArmin Le Grand sal::static_int_cast< sal_uInt16 >( eXFS ) ); 85566c1fc23SArmin Le Grand //Added for select invisable 85666c1fc23SArmin Le Grand if(eXFS == XFILL_NONE) 85766c1fc23SArmin Le Grand { 85866c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 85966c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 86066c1fc23SArmin Le Grand } 86166c1fc23SArmin Le Grand //else 86266c1fc23SArmin Le Grand // mpLbFillAttr->Enable(); 86366c1fc23SArmin Le Grand Update(); 86466c1fc23SArmin Le Grand //SelectFillTypeHdl( NULL ); 86566c1fc23SArmin Le Grand } 86666c1fc23SArmin Le Grand else 86766c1fc23SArmin Le Grand { 86866c1fc23SArmin Le Grand mpLbFillType->SetNoSelection(); 86966c1fc23SArmin Le Grand mpLbFillAttr->Show(); 87066c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 87166c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 87266c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 87366c1fc23SArmin Le Grand mbTBShow = false; 87458e893aeSArmin Le Grand meLastXFS = -1; //Added 87566c1fc23SArmin Le Grand mpStyleItem.reset(); 87666c1fc23SArmin Le Grand } 87766c1fc23SArmin Le Grand } 87866c1fc23SArmin Le Grand else if(nSID == SID_ATTR_FILL_COLOR) 87966c1fc23SArmin Le Grand { 88066c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 88166c1fc23SArmin Le Grand { 88258e893aeSArmin Le Grand mpColorItem.reset(pState ? (XFillColorItem*)pState->Clone() : 0); 88366c1fc23SArmin Le Grand } 88466c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_SOLID) 88566c1fc23SArmin Le Grand { 88666c1fc23SArmin Le Grand mpLbFillAttr->Hide(); 88766c1fc23SArmin Le Grand mpToolBoxColor->Show(); 88866c1fc23SArmin Le Grand mbTBShow = true; 88966c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 89066c1fc23SArmin Le Grand { 89166c1fc23SArmin Le Grand mpToolBoxColor->Enable(); 89266c1fc23SArmin Le Grand mbColorAvail = true; // 89366c1fc23SArmin Le Grand // maLastColor = mpColorItem->GetColorValue(); 89466c1fc23SArmin Le Grand Update(); 89566c1fc23SArmin Le Grand } 89666c1fc23SArmin Le Grand else if(SFX_ITEM_DISABLED == eState ) 89766c1fc23SArmin Le Grand { 89866c1fc23SArmin Le Grand mpToolBoxColor->Disable(); 89966c1fc23SArmin Le Grand mbColorAvail = false; // 90066c1fc23SArmin Le Grand mpColorUpdater->Update(COL_WHITE); 90166c1fc23SArmin Le Grand } 90266c1fc23SArmin Le Grand else 90366c1fc23SArmin Le Grand { 90466c1fc23SArmin Le Grand mbColorAvail = false; // 90566c1fc23SArmin Le Grand mpColorUpdater->Update(COL_WHITE); 90666c1fc23SArmin Le Grand } 90766c1fc23SArmin Le Grand } 90866c1fc23SArmin Le Grand } 90966c1fc23SArmin Le Grand else if(nSID == SID_ATTR_FILL_GRADIENT) 91066c1fc23SArmin Le Grand { 91166c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 91266c1fc23SArmin Le Grand { 91358e893aeSArmin Le Grand mpFillGradientItem.reset(pState ? (XFillGradientItem*)pState->Clone() : 0); 91466c1fc23SArmin Le Grand } 91566c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_GRADIENT ) 91666c1fc23SArmin Le Grand { 91766c1fc23SArmin Le Grand mpLbFillAttr->Show(); 91866c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 91966c1fc23SArmin Le Grand mbTBShow = false; 92066c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 92166c1fc23SArmin Le Grand { 92266c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 92366c1fc23SArmin Le Grand Update(); 92466c1fc23SArmin Le Grand } 92566c1fc23SArmin Le Grand 92666c1fc23SArmin Le Grand else if(SFX_ITEM_DISABLED == eState ) 92766c1fc23SArmin Le Grand { 92866c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 92966c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 93066c1fc23SArmin Le Grand } 93166c1fc23SArmin Le Grand else 93266c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 93366c1fc23SArmin Le Grand } 93466c1fc23SArmin Le Grand } 93566c1fc23SArmin Le Grand else if(nSID == SID_ATTR_FILL_HATCH) 93666c1fc23SArmin Le Grand { 93766c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 93866c1fc23SArmin Le Grand { 93958e893aeSArmin Le Grand mpHatchItem.reset(pState ? (XFillHatchItem*)pState->Clone() : 0); 94066c1fc23SArmin Le Grand } 94166c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_HATCH ) 94266c1fc23SArmin Le Grand { 94366c1fc23SArmin Le Grand mpLbFillAttr->Show(); 94466c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 94566c1fc23SArmin Le Grand mbTBShow = false; 94666c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 94766c1fc23SArmin Le Grand { 94866c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 94966c1fc23SArmin Le Grand Update(); 95066c1fc23SArmin Le Grand } 95166c1fc23SArmin Le Grand else if(SFX_ITEM_DISABLED == eState ) 95266c1fc23SArmin Le Grand { 95366c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 95466c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 95566c1fc23SArmin Le Grand } 95666c1fc23SArmin Le Grand else 95766c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 95866c1fc23SArmin Le Grand } 95966c1fc23SArmin Le Grand } 96066c1fc23SArmin Le Grand else if(nSID == SID_ATTR_FILL_BITMAP) 96166c1fc23SArmin Le Grand { 96266c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 96366c1fc23SArmin Le Grand { 96458e893aeSArmin Le Grand mpBitmapItem.reset(pState ? (XFillBitmapItem*)pState->Clone() : 0); 96566c1fc23SArmin Le Grand } 96666c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_BITMAP ) 96766c1fc23SArmin Le Grand { 96866c1fc23SArmin Le Grand mpLbFillAttr->Show(); 96966c1fc23SArmin Le Grand mpToolBoxColor->Hide(); 97066c1fc23SArmin Le Grand mbTBShow = false; 97166c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 97266c1fc23SArmin Le Grand { 97366c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 97466c1fc23SArmin Le Grand Update(); 97566c1fc23SArmin Le Grand } 97666c1fc23SArmin Le Grand else if(SFX_ITEM_DISABLED == eState ) 97766c1fc23SArmin Le Grand { 97866c1fc23SArmin Le Grand mpLbFillAttr->Disable(); 97966c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 98066c1fc23SArmin Le Grand } 98166c1fc23SArmin Le Grand else 98266c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 98366c1fc23SArmin Le Grand } 98466c1fc23SArmin Le Grand } 98566c1fc23SArmin Le Grand else if(nSID == SID_COLOR_TABLE) 98666c1fc23SArmin Le Grand { 98766c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 98866c1fc23SArmin Le Grand { 98958e893aeSArmin Le Grand mpColorTableItem.reset(pState ? (SvxColorTableItem*)pState->Clone() : 0); 99066c1fc23SArmin Le Grand 99166c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue()== XFILL_SOLID) 99266c1fc23SArmin Le Grand { 99366c1fc23SArmin Le Grand if ( mpColorItem ) 99466c1fc23SArmin Le Grand { 99566c1fc23SArmin Le Grand String aString( mpColorItem->GetName() ); 99666c1fc23SArmin Le Grand Color aColor = mpColorItem->GetColorValue(); 99766c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 99866c1fc23SArmin Le Grand SvxColorTableItem aItem( *(const SvxColorTableItem*)( 99966c1fc23SArmin Le Grand pSh->GetItem( SID_COLOR_TABLE ) ) ); 100066c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 100166c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetColorTable() ); 100266c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aColor ); 100366c1fc23SArmin Le Grand } 100466c1fc23SArmin Le Grand else 100566c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 100666c1fc23SArmin Le Grand } 100766c1fc23SArmin Le Grand } 100866c1fc23SArmin Le Grand } 100966c1fc23SArmin Le Grand else if(nSID == SID_GRADIENT_LIST) 101066c1fc23SArmin Le Grand { 101166c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 101266c1fc23SArmin Le Grand { 101358e893aeSArmin Le Grand mpGradientListItem.reset(pState ? (SvxGradientListItem*)pState->Clone() : 0); 101466c1fc23SArmin Le Grand 101566c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_GRADIENT) 101666c1fc23SArmin Le Grand { 101766c1fc23SArmin Le Grand if ( mpFillGradientItem ) 101866c1fc23SArmin Le Grand { 101966c1fc23SArmin Le Grand String aString( mpFillGradientItem->GetName() ); 102066c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 102166c1fc23SArmin Le Grand SvxGradientListItem aItem( *(const SvxGradientListItem*)( 102266c1fc23SArmin Le Grand pSh->GetItem( SID_GRADIENT_LIST ) ) ); 102366c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 102466c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetGradientList() ); 102566c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aString ); 102666c1fc23SArmin Le Grand } 102766c1fc23SArmin Le Grand else 102866c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 102966c1fc23SArmin Le Grand } 103066c1fc23SArmin Le Grand } 103166c1fc23SArmin Le Grand } 103266c1fc23SArmin Le Grand else if(nSID == SID_HATCH_LIST) 103366c1fc23SArmin Le Grand { 103466c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 103566c1fc23SArmin Le Grand { 103658e893aeSArmin Le Grand mpHatchListItem.reset(pState ? (SvxHatchListItem*)pState->Clone() : 0); 103766c1fc23SArmin Le Grand 103866c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_HATCH ) 103966c1fc23SArmin Le Grand { 104066c1fc23SArmin Le Grand if ( mpHatchItem) 104166c1fc23SArmin Le Grand { 104266c1fc23SArmin Le Grand String aString( mpHatchItem->GetName() ); 104366c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 104466c1fc23SArmin Le Grand SvxHatchListItem aItem( *(const SvxHatchListItem*)( 104566c1fc23SArmin Le Grand pSh->GetItem( SID_HATCH_LIST ) ) ); 104666c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 104766c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetHatchList() ); 104866c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aString ); 104966c1fc23SArmin Le Grand } 105066c1fc23SArmin Le Grand else 105166c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 105266c1fc23SArmin Le Grand } 105366c1fc23SArmin Le Grand } 105466c1fc23SArmin Le Grand } 105566c1fc23SArmin Le Grand else if(nSID == SID_BITMAP_LIST) 105666c1fc23SArmin Le Grand { 105766c1fc23SArmin Le Grand if( SFX_ITEM_AVAILABLE == eState) 105866c1fc23SArmin Le Grand { 105958e893aeSArmin Le Grand mpBitmapListItem.reset(pState ? (SvxBitmapListItem*)pState->Clone() : 0); 106066c1fc23SArmin Le Grand 106166c1fc23SArmin Le Grand if( mpStyleItem && (XFillStyle)mpStyleItem->GetValue() == XFILL_BITMAP ) 106266c1fc23SArmin Le Grand { 106366c1fc23SArmin Le Grand if ( mpBitmapItem ) 106466c1fc23SArmin Le Grand { 106566c1fc23SArmin Le Grand String aString( mpBitmapItem->GetName() ); 106666c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 106766c1fc23SArmin Le Grand SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( 106866c1fc23SArmin Le Grand pSh->GetItem( SID_BITMAP_LIST ) ) ); 106966c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 107066c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetBitmapList() ); 107166c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aString ); 107266c1fc23SArmin Le Grand } 107366c1fc23SArmin Le Grand else 107466c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 107566c1fc23SArmin Le Grand } 107666c1fc23SArmin Le Grand } 107766c1fc23SArmin Le Grand } 107866c1fc23SArmin Le Grand } 107966c1fc23SArmin Le Grand 10808dcb2a10SAndre Fischer 108166c1fc23SArmin Le Grand 108266c1fc23SArmin Le Grand SfxBindings* AreaPropertyPanel::GetBindings() 108366c1fc23SArmin Le Grand { 108466c1fc23SArmin Le Grand return mpBindings; 108566c1fc23SArmin Le Grand } 108666c1fc23SArmin Le Grand 10878dcb2a10SAndre Fischer 108866c1fc23SArmin Le Grand 108958e893aeSArmin Le Grand void AreaPropertyPanel::Update() 109066c1fc23SArmin Le Grand { 109158e893aeSArmin Le Grand if ( mpStyleItem ) 109266c1fc23SArmin Le Grand { 109366c1fc23SArmin Le Grand XFillStyle eXFS = (XFillStyle)mpStyleItem->GetValue(); 109466c1fc23SArmin Le Grand SfxObjectShell* pSh = SfxObjectShell::Current(); 109566c1fc23SArmin Le Grand 109666c1fc23SArmin Le Grand switch( eXFS ) 109766c1fc23SArmin Le Grand { 109866c1fc23SArmin Le Grand case XFILL_NONE: 109966c1fc23SArmin Le Grand { 110066c1fc23SArmin Le Grand mpLbFillAttr->Show(); //wj for new color picker 110166c1fc23SArmin Le Grand mpToolBoxColor->Hide(); //wj for new color picker 110266c1fc23SArmin Le Grand mbTBShow = false; 110366c1fc23SArmin Le Grand } 110466c1fc23SArmin Le Grand break; 110566c1fc23SArmin Le Grand 110666c1fc23SArmin Le Grand case XFILL_SOLID: 110766c1fc23SArmin Le Grand { 110866c1fc23SArmin Le Grand if ( mpColorItem ) 110966c1fc23SArmin Le Grand { 111066c1fc23SArmin Le Grand mpLbFillAttr->Hide(); //wj for new color picker 111166c1fc23SArmin Le Grand mpToolBoxColor->Show(); //wj for new color picker 111266c1fc23SArmin Le Grand mbTBShow = true; 111366c1fc23SArmin Le Grand mpColorUpdater->Update(mpColorItem->GetColorValue()); 111466c1fc23SArmin Le Grand } 111566c1fc23SArmin Le Grand else 111666c1fc23SArmin Le Grand mpColorUpdater->Update(COL_WHITE); 111766c1fc23SArmin Le Grand } 111866c1fc23SArmin Le Grand break; 111966c1fc23SArmin Le Grand 112066c1fc23SArmin Le Grand case XFILL_GRADIENT: 112166c1fc23SArmin Le Grand { 112266c1fc23SArmin Le Grand mpLbFillAttr->Show(); //wj for new color picker 112366c1fc23SArmin Le Grand mpToolBoxColor->Hide(); //wj for new color picker 112466c1fc23SArmin Le Grand mbTBShow = false; 112566c1fc23SArmin Le Grand if ( pSh && pSh->GetItem( SID_GRADIENT_LIST ) ) 112666c1fc23SArmin Le Grand { 112766c1fc23SArmin Le Grand SvxGradientListItem aItem( *(const SvxGradientListItem*)( 112866c1fc23SArmin Le Grand pSh->GetItem( SID_GRADIENT_LIST ) ) ); 112966c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 113066c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 113166c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetGradientList() ); 113266c1fc23SArmin Le Grand if ( mpFillGradientItem ) 113366c1fc23SArmin Le Grand { 113466c1fc23SArmin Le Grand String aString( mpFillGradientItem->GetName() ); 113566c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aString ); 113666c1fc23SArmin Le Grand } 113766c1fc23SArmin Le Grand else 113866c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 113966c1fc23SArmin Le Grand } 114066c1fc23SArmin Le Grand else 114166c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 114266c1fc23SArmin Le Grand } 114366c1fc23SArmin Le Grand break; 114466c1fc23SArmin Le Grand 114566c1fc23SArmin Le Grand case XFILL_HATCH: 114666c1fc23SArmin Le Grand { 114766c1fc23SArmin Le Grand mpLbFillAttr->Show(); //wj for new color picker 114866c1fc23SArmin Le Grand mpToolBoxColor->Hide(); //wj for new color picker 114966c1fc23SArmin Le Grand mbTBShow = false; 115066c1fc23SArmin Le Grand if ( pSh && pSh->GetItem( SID_HATCH_LIST ) ) 115166c1fc23SArmin Le Grand { 115266c1fc23SArmin Le Grand SvxHatchListItem aItem( *(const SvxHatchListItem*)( 115366c1fc23SArmin Le Grand pSh->GetItem( SID_HATCH_LIST ) ) ); 115466c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 115566c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 115666c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetHatchList() ); 115766c1fc23SArmin Le Grand if ( mpHatchItem ) 115866c1fc23SArmin Le Grand { 115966c1fc23SArmin Le Grand String aString( mpHatchItem->GetName() ); 116066c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aString ); 116166c1fc23SArmin Le Grand } 116266c1fc23SArmin Le Grand else 116366c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 116466c1fc23SArmin Le Grand } 116566c1fc23SArmin Le Grand else 116666c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 116766c1fc23SArmin Le Grand } 116866c1fc23SArmin Le Grand break; 116966c1fc23SArmin Le Grand 117066c1fc23SArmin Le Grand case XFILL_BITMAP: 117166c1fc23SArmin Le Grand { 117266c1fc23SArmin Le Grand mpLbFillAttr->Show(); //wj for new color picker 117366c1fc23SArmin Le Grand mpToolBoxColor->Hide(); //wj for new color picker 117466c1fc23SArmin Le Grand mbTBShow = false; 117566c1fc23SArmin Le Grand //mpLbFillAttr->Fill( mpBitmapListItem->GetBitmapList() ); 117666c1fc23SArmin Le Grand if ( pSh && pSh->GetItem( SID_BITMAP_LIST ) ) 117766c1fc23SArmin Le Grand { 117866c1fc23SArmin Le Grand SvxBitmapListItem aItem( *(const SvxBitmapListItem*)( 117966c1fc23SArmin Le Grand pSh->GetItem( SID_BITMAP_LIST ) ) ); 118066c1fc23SArmin Le Grand mpLbFillAttr->Enable(); 118166c1fc23SArmin Le Grand mpLbFillAttr->Clear(); 118266c1fc23SArmin Le Grand mpLbFillAttr->Fill( aItem.GetBitmapList() ); 118366c1fc23SArmin Le Grand if ( mpBitmapItem ) 118466c1fc23SArmin Le Grand { 118566c1fc23SArmin Le Grand String aString( mpBitmapItem->GetName() ); 118666c1fc23SArmin Le Grand mpLbFillAttr->SelectEntry( aString ); 118766c1fc23SArmin Le Grand } 118866c1fc23SArmin Le Grand else 118966c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 119066c1fc23SArmin Le Grand } 119166c1fc23SArmin Le Grand else 119266c1fc23SArmin Le Grand mpLbFillAttr->SetNoSelection(); 119366c1fc23SArmin Le Grand } 119466c1fc23SArmin Le Grand break; 119566c1fc23SArmin Le Grand 119666c1fc23SArmin Le Grand default: 119766c1fc23SArmin Le Grand DBG_ERROR( "Nicht unterstuetzter Flaechentyp" ); 119866c1fc23SArmin Le Grand break; 119966c1fc23SArmin Le Grand } 120066c1fc23SArmin Le Grand } 120166c1fc23SArmin Le Grand } 120266c1fc23SArmin Le Grand 120358e893aeSArmin Le Grand 120466c1fc23SArmin Le Grand 120566c1fc23SArmin Le Grand IMPL_LINK( AreaPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG ) 120666c1fc23SArmin Le Grand { 120766c1fc23SArmin Le Grand return 0; 120866c1fc23SArmin Le Grand } 120966c1fc23SArmin Le Grand 12108dcb2a10SAndre Fischer 121166c1fc23SArmin Le Grand 121289729eb3SArmin Le Grand IMPL_LINK( AreaPropertyPanel, ClickTrGrHdl_Impl, ToolBox*, pToolBox ) 121366c1fc23SArmin Le Grand { 12148dcb2a10SAndre Fischer maTrGrPopup.Rearrange(mpFloatTransparenceItem.get()); 121566c1fc23SArmin Le Grand 12168dcb2a10SAndre Fischer OSL_ASSERT(pToolBox->GetCurItemId() == TBI_BTX_GRADIENT); 121766c1fc23SArmin Le Grand 12188dcb2a10SAndre Fischer maTrGrPopup.Show(*pToolBox); 121966c1fc23SArmin Le Grand 122089729eb3SArmin Le Grand return (0L); 122166c1fc23SArmin Le Grand } 122266c1fc23SArmin Le Grand 12238dcb2a10SAndre Fischer 122466c1fc23SArmin Le Grand 122566c1fc23SArmin Le Grand IMPL_LINK(AreaPropertyPanel, ChangeTrgrTypeHdl_Impl, void *, EMPTYARG) 122666c1fc23SArmin Le Grand { 122766c1fc23SArmin Le Grand sal_uInt16 nSelectType = mpLBTransType->GetSelectEntryPos(); 122866c1fc23SArmin Le Grand bool bGradient = false; 122966c1fc23SArmin Le Grand sal_uInt16 nTrans = 0; 123066c1fc23SArmin Le Grand 123166c1fc23SArmin Le Grand if (nSelectType == 0) 123266c1fc23SArmin Le Grand { 123366c1fc23SArmin Le Grand mpBTNGradient->Hide(); 123466c1fc23SArmin Le Grand mpMTRTransparent->Show(); 123566c1fc23SArmin Le Grand mpMTRTransparent->Enable(); 123666c1fc23SArmin Le Grand mpMTRTransparent->SetValue(0); 123766c1fc23SArmin Le Grand } 123866c1fc23SArmin Le Grand else if (nSelectType == 1) 123966c1fc23SArmin Le Grand { 124066c1fc23SArmin Le Grand mpBTNGradient->Hide(); 124166c1fc23SArmin Le Grand mpMTRTransparent->Show(); 124266c1fc23SArmin Le Grand nTrans = mnLastTransSolid; 124366c1fc23SArmin Le Grand mpMTRTransparent->SetValue(nTrans); 124466c1fc23SArmin Le Grand mpLBTransType->SelectEntryPos(1);// for multi-selected, choose solid no selection 124566c1fc23SArmin Le Grand mpMTRTransparent->Enable(); 124666c1fc23SArmin Le Grand } 124766c1fc23SArmin Le Grand else 124866c1fc23SArmin Le Grand { 124966c1fc23SArmin Le Grand mpBTNGradient->Show(); 125066c1fc23SArmin Le Grand //for beta1 125166c1fc23SArmin Le Grand switch ( nSelectType ) 125266c1fc23SArmin Le Grand { 125366c1fc23SArmin Le Grand case 2: 125466c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,GetSettings().GetStyleSettings().GetHighContrastMode()? maImgLinearH : maImgLinear); // high contrast 125566c1fc23SArmin Le Grand break; 125666c1fc23SArmin Le Grand case 3: 125766c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,GetSettings().GetStyleSettings().GetHighContrastMode()? maImgAxialH : maImgAxial); 125866c1fc23SArmin Le Grand break; 125966c1fc23SArmin Le Grand case 4: 126066c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,GetSettings().GetStyleSettings().GetHighContrastMode()? maImgRadialH : maImgRadial); 126166c1fc23SArmin Le Grand break; 126266c1fc23SArmin Le Grand case 5: 126366c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,GetSettings().GetStyleSettings().GetHighContrastMode()? maImgElliH : maImgElli ); 126466c1fc23SArmin Le Grand break; 126566c1fc23SArmin Le Grand case 6: 126666c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,GetSettings().GetStyleSettings().GetHighContrastMode()? maImgQuadH : maImgQuad ); 126766c1fc23SArmin Le Grand break; 126866c1fc23SArmin Le Grand case 7: 126966c1fc23SArmin Le Grand mpBTNGradient->SetItemImage(TBI_BTX_GRADIENT,GetSettings().GetStyleSettings().GetHighContrastMode()? maImgSquareH : maImgSquare); 127066c1fc23SArmin Le Grand break; 127166c1fc23SArmin Le Grand } 127266c1fc23SArmin Le Grand //end of new code 127366c1fc23SArmin Le Grand mpMTRTransparent->Hide(); 127466c1fc23SArmin Le Grand mpBTNGradient->Enable(); 127566c1fc23SArmin Le Grand bGradient = true; 127666c1fc23SArmin Le Grand } 127766c1fc23SArmin Le Grand 127866c1fc23SArmin Le Grand XFillTransparenceItem aLinearItem(nTrans); 1279d5370dc8SArmin Le Grand GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SFX_CALLMODE_RECORD, &aLinearItem, 0L ); 128066c1fc23SArmin Le Grand 128166c1fc23SArmin Le Grand if (nSelectType > 1) nSelectType = nSelectType-2; 128266c1fc23SArmin Le Grand 128366c1fc23SArmin Le Grand XGradient aTmpGradient; 128466c1fc23SArmin Le Grand 128566c1fc23SArmin Le Grand switch(nSelectType) 128666c1fc23SArmin Le Grand { 128766c1fc23SArmin Le Grand case XGRAD_LINEAR: 128866c1fc23SArmin Le Grand aTmpGradient = maGradientLinear; 128966c1fc23SArmin Le Grand break; 129066c1fc23SArmin Le Grand case XGRAD_AXIAL: 129166c1fc23SArmin Le Grand aTmpGradient = maGradientAxial; 129266c1fc23SArmin Le Grand break; 129366c1fc23SArmin Le Grand case XGRAD_RADIAL: 129466c1fc23SArmin Le Grand aTmpGradient = maGradientRadial; 129566c1fc23SArmin Le Grand break; 129666c1fc23SArmin Le Grand case XGRAD_ELLIPTICAL: 129766c1fc23SArmin Le Grand aTmpGradient = maGradientElliptical; 129866c1fc23SArmin Le Grand break; 129966c1fc23SArmin Le Grand case XGRAD_SQUARE: 130066c1fc23SArmin Le Grand aTmpGradient = maGradientSquare; 130166c1fc23SArmin Le Grand break; 130266c1fc23SArmin Le Grand case XGRAD_RECT: 130366c1fc23SArmin Le Grand aTmpGradient = maGradientRect; 130466c1fc23SArmin Le Grand break; 130566c1fc23SArmin Le Grand } 130666c1fc23SArmin Le Grand SfxItemPool* pPool = NULL; 130766c1fc23SArmin Le Grand bool bEnable = false; 130866c1fc23SArmin Le Grand if (bGradient) bEnable = true; 130966c1fc23SArmin Le Grand XFillFloatTransparenceItem aGradientItem(pPool,aTmpGradient, bEnable ); 131066c1fc23SArmin Le Grand 1311d5370dc8SArmin Le Grand GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_FLOATTRANSPARENCE, SFX_CALLMODE_RECORD, &aGradientItem, 0L ); 131266c1fc23SArmin Le Grand 131366c1fc23SArmin Le Grand return( 0L ); 131466c1fc23SArmin Le Grand } 131566c1fc23SArmin Le Grand 13168dcb2a10SAndre Fischer 131766c1fc23SArmin Le Grand 131866c1fc23SArmin Le Grand IMPL_LINK(AreaPropertyPanel, ModifyTransparentHdl_Impl, void*, EMPTYARG) 131966c1fc23SArmin Le Grand { 132066c1fc23SArmin Le Grand sal_uInt16 nTrans = (sal_uInt16)mpMTRTransparent->GetValue(); 132166c1fc23SArmin Le Grand mnLastTransSolid = nTrans; 132266c1fc23SArmin Le Grand sal_uInt16 nSelectType = mpLBTransType->GetSelectEntryPos(); 132366c1fc23SArmin Le Grand if (nTrans != 0 && nSelectType == 0) 132466c1fc23SArmin Le Grand mpLBTransType->SelectEntryPos(1); 132566c1fc23SArmin Le Grand XFillTransparenceItem aLinearItem(nTrans); 1326d5370dc8SArmin Le Grand GetBindings()->GetDispatcher()->Execute( SID_ATTR_FILL_TRANSPARENCE, SFX_CALLMODE_RECORD, &aLinearItem, 0L ); 132766c1fc23SArmin Le Grand 132866c1fc23SArmin Le Grand return 0L; 132966c1fc23SArmin Le Grand } 133066c1fc23SArmin Le Grand 133166c1fc23SArmin Le Grand 13328dcb2a10SAndre Fischer Color AreaPropertyPanel::GetLastColor (void) const 13338dcb2a10SAndre Fischer { 13348dcb2a10SAndre Fischer return maLastColor; 13358dcb2a10SAndre Fischer } 13368dcb2a10SAndre Fischer 13378dcb2a10SAndre Fischer 13388dcb2a10SAndre Fischer 13398dcb2a10SAndre Fischer 13408dcb2a10SAndre Fischer XGradient AreaPropertyPanel::GetGradient (const XGradientStyle eStyle) const 13418dcb2a10SAndre Fischer { 13428dcb2a10SAndre Fischer switch (eStyle) 13438dcb2a10SAndre Fischer { 13448dcb2a10SAndre Fischer default: 13458dcb2a10SAndre Fischer case XGRAD_LINEAR: 13468dcb2a10SAndre Fischer return maGradientLinear; 13478dcb2a10SAndre Fischer case XGRAD_AXIAL: 13488dcb2a10SAndre Fischer return maGradientAxial; 13498dcb2a10SAndre Fischer case XGRAD_RADIAL: 13508dcb2a10SAndre Fischer return maGradientRadial; 13518dcb2a10SAndre Fischer case XGRAD_ELLIPTICAL: 13528dcb2a10SAndre Fischer return maGradientElliptical; 13538dcb2a10SAndre Fischer case XGRAD_SQUARE: 13548dcb2a10SAndre Fischer return maGradientSquare; 13558dcb2a10SAndre Fischer case XGRAD_RECT: 13568dcb2a10SAndre Fischer return maGradientRect; 13578dcb2a10SAndre Fischer } 13588dcb2a10SAndre Fischer } 13598dcb2a10SAndre Fischer 13608dcb2a10SAndre Fischer 13618dcb2a10SAndre Fischer 13628dcb2a10SAndre Fischer 13638dcb2a10SAndre Fischer void AreaPropertyPanel::SetGradient (const XGradient& rGradient) 13648dcb2a10SAndre Fischer { 13658dcb2a10SAndre Fischer switch (rGradient.GetGradientStyle()) 13668dcb2a10SAndre Fischer { 13678dcb2a10SAndre Fischer case XGRAD_LINEAR: 13688dcb2a10SAndre Fischer maGradientLinear = rGradient; 13698dcb2a10SAndre Fischer break; 13708dcb2a10SAndre Fischer case XGRAD_AXIAL: 13718dcb2a10SAndre Fischer maGradientAxial = rGradient; 13728dcb2a10SAndre Fischer break; 13738dcb2a10SAndre Fischer case XGRAD_RADIAL: 13748dcb2a10SAndre Fischer maGradientRadial = rGradient; 13758dcb2a10SAndre Fischer break; 13768dcb2a10SAndre Fischer case XGRAD_ELLIPTICAL: 13778dcb2a10SAndre Fischer maGradientElliptical = rGradient; 13788dcb2a10SAndre Fischer break; 13798dcb2a10SAndre Fischer case XGRAD_SQUARE: 13808dcb2a10SAndre Fischer maGradientSquare = rGradient; 13818dcb2a10SAndre Fischer break; 13828dcb2a10SAndre Fischer case XGRAD_RECT: 13838dcb2a10SAndre Fischer maGradientRect = rGradient; 13848dcb2a10SAndre Fischer break; 13858dcb2a10SAndre Fischer } 13868dcb2a10SAndre Fischer } 13878dcb2a10SAndre Fischer 13888dcb2a10SAndre Fischer 13898dcb2a10SAndre Fischer 13908dcb2a10SAndre Fischer 13918dcb2a10SAndre Fischer sal_Int32 AreaPropertyPanel::GetSelectedTransparencyTypeIndex (void) const 13928dcb2a10SAndre Fischer { 13938dcb2a10SAndre Fischer return mpLBTransType->GetSelectEntryPos(); 13948dcb2a10SAndre Fischer } 139566c1fc23SArmin Le Grand 13968dcb2a10SAndre Fischer } } // end of namespace svx::sidebar 1397