22#include <bitmaps.hlst>
32#include <com/sun/star/lang/IllegalArgumentException.hpp>
37using namespace css::uno;
48 const css::uno::Reference<css::frame::XFrame>& rxFrame,
50:
PanelLayout(pParent,
"CellAppearancePropertyPanel",
"modules/scalc/ui/sidebarcellappearance.ui"),
52 mxTBCellBorder(m_xBuilder->weld_toolbar(
"cellbordertype")),
53 mxTBCellBackground(m_xBuilder->weld_toolbar(
"cellbackgroundcolor")),
55 mxTBLineStyle(m_xBuilder->weld_toolbar(
"borderlinestyle")),
56 mxTBLineColor(m_xBuilder->weld_toolbar(
"borderlinecolor")),
59 mbCellBorderPopoverCreated(false),
60 mbLinePopoverCreated(false),
62 maLineStyleControl(SID_FRAME_LINESTYLE, *pBindings, *this),
63 maBorderOuterControl(SID_ATTR_BORDER_OUTER, *pBindings, *this),
64 maBorderInnerControl(SID_ATTR_BORDER_INNER, *pBindings, *this),
65 maGridShowControl(FID_TAB_TOGGLE_GRID, *pBindings, *this),
66 maBorderTLBRControl(SID_ATTR_BORDER_DIAG_TLBR, *pBindings, *this),
67 maBorderBLTRControl(SID_ATTR_BORDER_DIAG_BLTR, *pBindings, *this),
70 msIMGCellBorder(RID_BMP_CELL_BORDER),
71 msIMGLineStyle1(RID_BMP_LINE_STYLE1),
72 msIMGLineStyle2(RID_BMP_LINE_STYLE2),
73 msIMGLineStyle3(RID_BMP_LINE_STYLE3),
74 msIMGLineStyle4(RID_BMP_LINE_STYLE4),
75 msIMGLineStyle5(RID_BMP_LINE_STYLE5),
76 msIMGLineStyle6(RID_BMP_LINE_STYLE6),
77 msIMGLineStyle7(RID_BMP_LINE_STYLE7),
78 msIMGLineStyle8(RID_BMP_LINE_STYLE8),
79 msIMGLineStyle9(RID_BMP_LINE_STYLE9),
85 mnDiagTLBROutWidth(0),
86 mnDiagTLBRDistance(0),
88 mnDiagBLTROutWidth(0),
89 mnDiagBLTRDistance(0),
90 mbBorderStyleAvailable(true),
101 mpBindings(pBindings)
152 if (!mbCellBorderPopoverCreated)
155 mbCellBorderPopoverCreated =
true;
157 mxCellBorderPopoverContainer->getPopover()->GrabFocus();
162 mxTBLineStyle->set_menu_item_active(
LINESTYLE, !mxTBLineStyle->get_menu_item_active(
LINESTYLE));
167 if (!mxTBLineStyle->get_menu_item_active(
LINESTYLE))
169 if (!mbLinePopoverCreated)
172 mbLinePopoverCreated =
true;
181 const css::uno::Reference<css::frame::XFrame>& rxFrame,
184 if (pParent ==
nullptr)
185 throw lang::IllegalArgumentException(
"no parent Window given to CellAppearancePropertyPanel::Create",
nullptr, 0);
187 throw lang::IllegalArgumentException(
"no XFrame given to CellAppearancePropertyPanel::Create",
nullptr, 1);
188 if (pBindings ==
nullptr)
189 throw lang::IllegalArgumentException(
"no SfxBindings given to CellAppearancePropertyPanel::Create",
nullptr, 2);
191 return std::make_unique<CellAppearancePropertyPanel>(pParent, rxFrame, pBindings);
212 case SID_FRAME_LINESTYLE:
214 if( eState == SfxItemState::DONTCARE )
221 else if(eState >= SfxItemState::DEFAULT)
235 case SID_ATTR_BORDER_OUTER:
236 if(eState >= SfxItemState::DEFAULT)
273 case SID_ATTR_BORDER_INNER:
274 if(eState >= SfxItemState::DEFAULT)
279 bool bLeft(
false), bRight(
false), bTop(
false), bBottom(
false);
284 if(!pBoxInfoItem->
IsValid( SvxBoxInfoItemValidFlags::VERT ) || pBoxInfoItem->
GetVert())
287 if(!pBoxInfoItem->
IsValid( SvxBoxInfoItemValidFlags::HORI ) || pBoxInfoItem->
GetHori())
290 if(!pBoxInfoItem->
IsValid( SvxBoxInfoItemValidFlags::LEFT ) ||
mbLeft)
293 if(!pBoxInfoItem->
IsValid( SvxBoxInfoItemValidFlags::RIGHT ) ||
mbRight)
296 if(!pBoxInfoItem->
IsValid( SvxBoxInfoItemValidFlags::TOP ) ||
mbTop)
299 if(!pBoxInfoItem->
IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) ||
mbBottom)
307 if(
mbVer ||
mbHor || bLeft || bRight || bTop || bBottom)
316 case SID_ATTR_BORDER_DIAG_TLBR:
318 if( eState == SfxItemState::DONTCARE )
323 else if(eState >= SfxItemState::DEFAULT)
342 case SID_ATTR_BORDER_DIAG_BLTR:
344 if( eState == SfxItemState::DONTCARE )
349 else if(eState >= SfxItemState::DEFAULT)
469 bool bVer,
bool bHor,
bool bTLBR,
bool bBLTR)
473 if (aBmpSize.
Width() == 43 && aBmpSize.
Height() == 43)
476 pVirDev->SetOutputSizePixel(aBmpSize);
480 Point aTL(2, 1), aTR(42,1), aBL(2, 41), aBR(42, 41), aHL(2,21), aHR(42, 21), aVT(22,1), aVB(22, 41);
482 pVirDev->DrawLine( aTL,aBL );
484 pVirDev->DrawLine( aTR,aBR );
486 pVirDev->DrawLine( aTL,aTR );
488 pVirDev->DrawLine( aBL,aBR );
490 pVirDev->DrawLine( aVT,aVB );
492 pVirDev->DrawLine( aHL,aHR );
494 pVirDev->DrawLine( aTL,aBR );
496 pVirDev->DrawLine( aBL,aTR );
constexpr OUStringLiteral LINESTYLE
constexpr OUStringLiteral SETBORDERSTYLE
static bool GetLayoutRTL()
static const AllSettings & GetSettings()
const Size & GetSizePixel() const
BitmapEx GetBitmapEx() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static const sal_Int16 ExtraThick
static const sal_Int16 Thin
static const sal_Int16 Medium
static const sal_Int16 Hairline
static const sal_Int16 Thick
bool IsValid(SvxBoxInfoItemValidFlags nValid) const
const editeng::SvxBorderLine * GetHori() const
const editeng::SvxBorderLine * GetVert() const
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
const editeng::SvxBorderLine * GetLine() const
sal_uInt16 GetDistance() const
sal_uInt16 GetOutWidth() const
sal_uInt16 GetInWidth() const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
SfxDispatcher * GetDispatcher()