diff options
Diffstat (limited to 'sc/source/ui/sidebar/CellLineStyleControl.cxx')
-rw-r--r-- | sc/source/ui/sidebar/CellLineStyleControl.cxx | 53 |
1 files changed, 20 insertions, 33 deletions
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx index e9e68a335a32..7f497497b789 100644 --- a/sc/source/ui/sidebar/CellLineStyleControl.cxx +++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx @@ -33,35 +33,30 @@ namespace sc { namespace sidebar { -CellLineStyleControl::CellLineStyleControl(FloatingWindow* pParent, SfxDispatcher* pDispatcher) -: Control(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE)), - mpDispatcher(pDispatcher), - mxFloatParent(pParent), - maPushButtonMoreOptions(VclPtr<PushButton>::Create(this, ScResId(PB_OPTIONS))), - maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(this, ScResId(VS_STYLE))), - mbVSfocus(true) +CellLineStylePopup::CellLineStylePopup(SfxDispatcher* pDispatcher) + : FloatingWindow(SfxGetpApp()->GetTopWindow(), "FloatingLineStyle", "modules/scalc/ui/floatinglinestyle.ui") + , mpDispatcher(pDispatcher) + , maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(get<vcl::Window>("box"))) { + get(maPushButtonMoreOptions, "more"); Initialize(); - FreeResource(); } -CellLineStyleControl::~CellLineStyleControl() +CellLineStylePopup::~CellLineStylePopup() { disposeOnce(); } -void CellLineStyleControl::dispose() +void CellLineStylePopup::dispose() { - maPushButtonMoreOptions.disposeAndClear(); + maPushButtonMoreOptions.clear(); maCellLineStyleValueSet.disposeAndClear(); - mxFloatParent.clear(); - Control::dispose(); + FloatingWindow::dispose(); } -void CellLineStyleControl::Initialize() +void CellLineStylePopup::Initialize() { - //maPushButtonMoreOptions->SetIcoPosX(2); - Link<Button*,void> aLink = LINK(this, CellLineStyleControl, PBClickHdl); + Link<Button*,void> aLink = LINK(this, CellLineStylePopup, PBClickHdl); maPushButtonMoreOptions->SetClickHdl(aLink); maCellLineStyleValueSet->SetStyle(maCellLineStyleValueSet->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT); @@ -90,20 +85,12 @@ void CellLineStyleControl::Initialize() } SetAllNoSel(); - maCellLineStyleValueSet->SetSelectHdl(LINK(this, CellLineStyleControl, VSSelectHdl)); + maCellLineStyleValueSet->SetSelectHdl(LINK(this, CellLineStylePopup, VSSelectHdl)); maCellLineStyleValueSet->StartSelection(); maCellLineStyleValueSet->Show(); } -void CellLineStyleControl::GetFocus() -{ - if (!mbVSfocus && maPushButtonMoreOptions) - maPushButtonMoreOptions->GrabFocus(); - else if (maCellLineStyleValueSet) - maCellLineStyleValueSet->GrabFocus(); -} - -void CellLineStyleControl::SetAllNoSel() +void CellLineStylePopup::SetAllNoSel() { maCellLineStyleValueSet->SelectItem(0); maCellLineStyleValueSet->SetNoSelection(); @@ -113,7 +100,7 @@ void CellLineStyleControl::SetAllNoSel() maCellLineStyleValueSet->StartSelection(); } -IMPL_LINK(CellLineStyleControl, VSSelectHdl, ValueSet*, pControl, void) +IMPL_LINK(CellLineStylePopup, VSSelectHdl, ValueSet*, pControl, void) { if(pControl == maCellLineStyleValueSet.get()) { @@ -181,23 +168,23 @@ IMPL_LINK(CellLineStyleControl, VSSelectHdl, ValueSet*, pControl, void) mpDispatcher->ExecuteList( SID_FRAME_LINESTYLE, SfxCallMode::RECORD, { &aLineItem }); SetAllNoSel(); - mxFloatParent->EndPopupMode(); + EndPopupMode(); } } -IMPL_LINK(CellLineStyleControl, PBClickHdl, Button *, pPBtn, void) +IMPL_LINK(CellLineStylePopup, PBClickHdl, Button *, pPBtn, void) { if (pPBtn == maPushButtonMoreOptions.get()) { mpDispatcher->Execute(SID_CELL_FORMAT_BORDER, SfxCallMode::ASYNCHRON); - mxFloatParent->EndPopupMode(); + EndPopupMode(); } } -void CellLineStyleControl::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis) +void CellLineStylePopup::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis) { + maCellLineStyleValueSet->GrabFocus(); SetAllNoSel(); - mbVSfocus = true; //FIXME: fully for new border line possibilities @@ -240,7 +227,7 @@ void CellLineStyleControl::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal else { maCellLineStyleValueSet->SetSelItem(0); - mbVSfocus = false; + maPushButtonMoreOptions->GrabFocus(); } maCellLineStyleValueSet->SetFormat(); maCellLineStyleValueSet->Invalidate(); |