1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #include "precompiled_sc.hxx"
23 
24 #include <sfx2/sidebar/propertypanel.hrc>
25 #include <sfx2/sidebar/Theme.hxx>
26 #include <sfx2/sidebar/ControlFactory.hxx>
27 #include <CellAppearancePropertyPanel.hxx>
28 #include <CellAppearancePropertyPanel.hrc>
29 //#include "propertypanel.hrc"
30 //#include "scresid.hxx"
31 //#include <sfx2/bindings.hxx>
32 //#include <sfx2/dispatch.hxx>
33 //#include <svx/dlgutil.hxx>
34 //#include <svx/colritem.hxx>
35 //#include <svx/brshitem.hxx>
36 //#include <vcl/window.hxx>
37 //#include <sfx2/objsh.hxx>
38 //#include <svx/xtable.hxx>
39 //#include <svx/drawitem.hxx>
40 //#include <svx/bolnitem.hxx>
41 //#include <unotools/pathoptions.hxx>
42 //#include <svtools/button.hxx>
43 //#include <svx/svxitems.hrc>
44 //#include <com/sun/star/table/BorderLine.hpp>
45 //#include <svx/boxitem.hxx>
46 //#include <svl/poolitem.hxx>
47 //#include <svx/numvset.hxx>
48 //#include <vcl/i18nhelp.hxx>
49 #include "sc.hrc"
50 #include "scresid.hxx"
51 #include <sfx2/bindings.hxx>
52 #include <sfx2/dispatch.hxx>
53 #include <vcl/fixed.hxx>
54 #include <svx/tbxcolorupdate.hxx>
55 //#include <vcl/toolbox.hxx>
56 #include <svl/eitem.hxx>
57 #include <editeng/bolnitem.hxx>
58 #include <editeng/boxitem.hxx>
59 #include <editeng/colritem.hxx>
60 #include <vcl/svapp.hxx>
61 #include <svx/sidebar/ColorControl.hxx>
62 #include <boost/bind.hpp>
63 #include <svx/sidebar/PopupContainer.hxx>
64 //#include <vcl/bmpacc.hxx>
65 //#include <i18npool/mslangid.hxx>
66 #include <CellLineStyleControl.hxx>
67 #include <CellLineStylePopup.hxx>
68 #include <CellBorderUpdater.hxx>
69 #include <CellBorderStyleControl.hxx>
70 #include <CellBorderStylePopup.hxx>
71 
72 using namespace css;
73 using namespace cssu;
74 
75 #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
76 
77 //////////////////////////////////////////////////////////////////////////////
78 // namespace open
79 
80 namespace sc { namespace sidebar {
81 
82 //////////////////////////////////////////////////////////////////////////////
83 
84 svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateFillColorPopupControl(svx::sidebar::PopupContainer* pParent)
85 {
86     const ScResId aResId(VS_NOFILLCOLOR);
87 
88     return new svx::sidebar::ColorControl(
89         pParent,
90         mpBindings,
91         ScResId(RID_POPUPPANEL_CELLAPPEARANCE_FILLCOLOR),
92         ScResId(VS_FILLCOLOR),
93         ::boost::bind(&CellAppearancePropertyPanel::GetLastFillColor, this),
94         ::boost::bind(&CellAppearancePropertyPanel::SetFillColor, this, _1, _2),
95         pParent,
96         &aResId);
97 }
98 
99 Color CellAppearancePropertyPanel::GetLastFillColor(void) const
100 {
101     return maBackColor;
102 }
103 
104 void CellAppearancePropertyPanel::SetFillColor(
105     const String& /*rsColorName*/,
106     const Color aColor)
107 {
108     const SvxColorItem aColorItem(aColor, SID_BACKGROUND_COLOR);
109     mpBindings->GetDispatcher()->Execute(SID_BACKGROUND_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L);
110     maBackColor = aColor;
111 }
112 
113 //////////////////////////////////////////////////////////////////////////////
114 
115 svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent)
116 {
117     return new svx::sidebar::ColorControl(
118         pParent,
119         mpBindings,
120         ScResId(RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR),
121         ScResId(VS_LINECOLOR),
122         ::boost::bind(&CellAppearancePropertyPanel::GetLastLineColor, this),
123         ::boost::bind(&CellAppearancePropertyPanel::SetLineColor, this, _1, _2),
124         pParent,
125         0);
126 }
127 
128 Color CellAppearancePropertyPanel::GetLastLineColor(void) const
129 {
130     return maLineColor;
131 }
132 
133 void CellAppearancePropertyPanel::SetLineColor(
134     const String& /*rsColorName*/,
135     const Color aColor)
136 {
137     const SvxColorItem aColorItem(aColor, SID_FRAME_LINECOLOR);
138     mpBindings->GetDispatcher()->Execute(SID_FRAME_LINECOLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L);
139     maLineColor = aColor;
140 }
141 
142 //////////////////////////////////////////////////////////////////////////////
143 
144 svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent)
145 {
146     return new CellLineStyleControl(pParent, *this);
147 }
148 
149 void CellAppearancePropertyPanel::EndCellLineStylePopupMode(void)
150 {
151     if(mpCellLineStylePopup.get())
152     {
153         mpCellLineStylePopup->Hide();
154     }
155 }
156 
157 //////////////////////////////////////////////////////////////////////////////
158 
159 svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent)
160 {
161     return new CellBorderStyleControl(pParent, *this);
162 }
163 
164 void CellAppearancePropertyPanel::EndCellBorderStylePopupMode(void)
165 {
166     if(mpCellBorderStylePopup.get())
167     {
168         mpCellBorderStylePopup->Hide();
169     }
170 }
171 
172 //////////////////////////////////////////////////////////////////////////////
173 
174 CellAppearancePropertyPanel::CellAppearancePropertyPanel(
175     Window* pParent,
176     const cssu::Reference<css::frame::XFrame>& rxFrame,
177     SfxBindings* pBindings)
178 :   Control(
179         pParent,
180         ScResId(RID_PROPERTYPANEL_SC_APPEAR)),
181 
182     mpFTFillColor(new FixedText(this, ScResId(FT_BK_COLOR))),
183     mpTBFillColorBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
184     mpTBFillColor(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBFillColorBackground.get(), ScResId(TB_BK_COLOR))),
185     mpFillColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_BRUSH, TBI_BK_COLOR, mpTBFillColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)),
186 
187     mpFTCellBorder(new FixedText(this, ScResId(FT_BORDER))),
188     mpTBCellBorderBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
189     mpTBCellBorder(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBCellBorderBackground.get(), ScResId(TB_APP_BORDER))),
190     mpCellBorderUpdater(new CellBorderUpdater(TBI_BORDER, *mpTBCellBorder)),
191 
192     mpTBLineStyleBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
193     mpTBLineStyle(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBLineStyleBackground.get(), ScResId(TB_BORDER_LINE_STYLE))),
194 
195     mpTBLineColorBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
196     mpTBLineColor(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBLineColorBackground.get(), ScResId(TB_BORDER_LINE_COLOR))),
197     mpLineColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_FRAME_LINECOLOR, TBI_LINE_COLOR, mpTBLineColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)),
198 
199     mpCBXShowGrid(new CheckBox(this, ScResId(CBX_SHOW_GRID))),
200 
201     maBackColorControl(SID_BACKGROUND_COLOR, *pBindings, *this),
202     maLineColorControl(SID_FRAME_LINECOLOR, *pBindings, *this),
203     maLineStyleControl(SID_FRAME_LINESTYLE, *pBindings, *this),
204     maBorderOuterControl(SID_ATTR_BORDER_OUTER, *pBindings, *this),
205     maBorderInnerControl(SID_ATTR_BORDER_INNER, *pBindings, *this),
206     maGridShowControl(SID_SCGRIDSHOW, *pBindings, *this),
207     maBorderTLBRControl(SID_ATTR_BORDER_DIAG_TLBR, *pBindings, *this),
208     maBorderBLTRControl(SID_ATTR_BORDER_DIAG_BLTR, *pBindings, *this),
209 
210     maIMGBKColor(ScResId(IMG_BK_COLOR)),
211     maIMGCellBorder(ScResId(IMG_CELL_BORDER)),
212     maIMGLineColor(ScResId(IMG_LINE_COLOR)),
213     maIMGLineStyle1(ScResId(IMG_LINE_STYLE1)),
214     maIMGLineStyle2(ScResId(IMG_LINE_STYLE2)),
215     maIMGLineStyle3(ScResId(IMG_LINE_STYLE3)),
216     maIMGLineStyle4(ScResId(IMG_LINE_STYLE4)),
217     maIMGLineStyle5(ScResId(IMG_LINE_STYLE5)),
218     maIMGLineStyle6(ScResId(IMG_LINE_STYLE6)),
219     maIMGLineStyle7(ScResId(IMG_LINE_STYLE7)),
220     maIMGLineStyle8(ScResId(IMG_LINE_STYLE8)),
221     maIMGLineStyle9(ScResId(IMG_LINE_STYLE9)),
222 
223     maIMGBKColorH(ScResId(IMG_BK_COLOR_H)),
224     maIMGLineStyle1H(ScResId(IMG_LINE_STYLE1_H)),
225     maIMGLineStyle2H(ScResId(IMG_LINE_STYLE2_H)),
226     maIMGLineStyle3H(ScResId(IMG_LINE_STYLE3_H)),
227     maIMGLineStyle4H(ScResId(IMG_LINE_STYLE4_H)),
228     maIMGLineStyle5H(ScResId(IMG_LINE_STYLE5_H)),
229     maIMGLineStyle6H(ScResId(IMG_LINE_STYLE6_H)),
230     maIMGLineStyle7H(ScResId(IMG_LINE_STYLE7_H)),
231     maIMGLineStyle8H(ScResId(IMG_LINE_STYLE8_H)),
232     maIMGLineStyle9H(ScResId(IMG_LINE_STYLE9_H)),
233 
234     maBackColor(COL_TRANSPARENT),
235     maLineColor(COL_BLACK),
236     maTLBRColor(COL_BLACK),
237     maBLTRColor(COL_BLACK),
238     mnIn(0),
239     mnOut(0),
240     mnDis(0),
241     mnTLBRIn(0),
242     mnTLBROut(0),
243     mnTLBRDis(0),
244     mnBLTRIn(0),
245     mnBLTROut(0),
246     mnBLTRDis(0),
247     mbBackColorAvailable(true),
248     mbLineColorAvailable(true),
249     mbBorderStyleAvailable(true),
250     mbLeft(false),
251     mbRight(false),
252     mbTop(false),
253     mbBottom(false),
254     mbVer(false),
255     mbHor(false),
256     mbOuterBorder(false),
257     mbInnerBorder(false),
258     mbTLBR(false),
259     mbBLTR(false),
260 
261     maFillColorPopup(this, ::boost::bind(&CellAppearancePropertyPanel::CreateFillColorPopupControl, this, _1)),
262     maLineColorPopup(this, ::boost::bind(&CellAppearancePropertyPanel::CreateLineColorPopupControl, this, _1)),
263     mpCellLineStylePopup(),
264     mpCellBorderStylePopup(),
265 
266     mxFrame(rxFrame),
267     maContext(),
268     mpBindings(pBindings)
269 {
270     Initialize();
271     FreeResource();
272 }
273 
274 //////////////////////////////////////////////////////////////////////////////
275 
276 CellAppearancePropertyPanel::~CellAppearancePropertyPanel()
277 {
278     // Destroy the toolboxes, then their background windows.
279     mpTBFillColor.reset();
280     mpTBCellBorder.reset();
281     mpTBLineStyle.reset();
282     mpTBLineColor.reset();
283 
284     mpTBFillColorBackground.reset();
285     mpTBCellBorderBackground.reset();
286     mpTBLineStyleBackground.reset();
287     mpTBLineColorBackground.reset();
288 }
289 
290 //////////////////////////////////////////////////////////////////////////////
291 
292 void CellAppearancePropertyPanel::Initialize()
293 {
294 	mpTBFillColor->SetItemImage(TBI_BK_COLOR, GetDisplayBackground().GetColor().IsDark() ? maIMGBKColorH : maIMGBKColor);
295 	mpTBFillColor->SetItemBits( TBI_BK_COLOR, mpTBFillColor->GetItemBits( TBI_BK_COLOR ) | TIB_DROPDOWNONLY );
296 	mpTBFillColor->SetQuickHelpText(TBI_BK_COLOR,String(ScResId(STR_QH_BK_COLOR)));	//Add
297 	Size aTbxSize1( mpTBFillColor->CalcWindowSizePixel() );
298 	mpTBFillColor->SetOutputSizePixel( aTbxSize1 );
299 	mpTBFillColor->SetBackground(Wallpaper());
300 	mpTBFillColor->SetPaintTransparent(true);
301 	Link aLink = LINK(this, CellAppearancePropertyPanel, TbxBKColorSelectHdl);
302 	mpTBFillColor->SetDropdownClickHdl ( aLink );
303 	mpTBFillColor->SetSelectHdl ( aLink );
304 
305 	mpTBCellBorder->SetItemImage(TBI_BORDER, maIMGCellBorder);
306 	mpTBCellBorder->SetItemBits( TBI_BORDER, mpTBCellBorder->GetItemBits( TBI_BORDER ) | TIB_DROPDOWNONLY );
307 	mpTBCellBorder->SetQuickHelpText(TBI_BORDER,String(ScResId(STR_QH_BORDER)));	//Add
308 	Size aTbxSize2( mpTBCellBorder->CalcWindowSizePixel() );
309 	mpTBCellBorder->SetOutputSizePixel( aTbxSize2 );
310 	mpTBCellBorder->SetBackground(Wallpaper());
311 	mpTBCellBorder->SetPaintTransparent(true);
312 	aLink = LINK(this, CellAppearancePropertyPanel, TbxCellBorderSelectHdl);
313 	mpTBCellBorder->SetDropdownClickHdl ( aLink );
314 	mpTBCellBorder->SetSelectHdl ( aLink );
315 
316 	mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, maIMGLineStyle1);
317 	mpTBLineStyle->SetItemBits( TBI_LINE_STYLE, mpTBLineStyle->GetItemBits( TBI_LINE_STYLE ) | TIB_DROPDOWNONLY );
318 	mpTBLineStyle->SetQuickHelpText(TBI_LINE_STYLE,String(ScResId(STR_QH_BORDER_LINE_STYLE)));	//Add
319 	Size aTbxSize3( mpTBLineStyle->CalcWindowSizePixel() );
320 	mpTBLineStyle->SetOutputSizePixel( aTbxSize3 );
321 	mpTBLineStyle->SetBackground(Wallpaper());
322 	mpTBLineStyle->SetPaintTransparent(true);
323 	aLink = LINK(this, CellAppearancePropertyPanel, TbxLineStyleSelectHdl);
324 	mpTBLineStyle->SetDropdownClickHdl ( aLink );
325 	mpTBLineStyle->SetSelectHdl ( aLink );
326 	mpTBLineStyle->Disable();
327 
328 	mpTBLineColor->SetItemImage(TBI_LINE_COLOR, maIMGLineColor);
329 	mpTBLineColor->SetItemBits( TBI_LINE_COLOR, mpTBLineColor->GetItemBits( TBI_LINE_COLOR ) | TIB_DROPDOWNONLY );
330 	mpTBLineColor->SetQuickHelpText(TBI_LINE_COLOR,String(ScResId(STR_QH_BORDER_LINE_COLOR)));	//Add
331 	Size aTbxSize4( mpTBLineColor->CalcWindowSizePixel() );
332 	mpTBLineColor->SetOutputSizePixel( aTbxSize4 );
333 	mpTBLineColor->SetBackground(Wallpaper());
334 	mpTBLineColor->SetPaintTransparent(true);
335 	aLink = LINK(this, CellAppearancePropertyPanel, TbxLineColorSelectHdl);
336 	mpTBLineColor->SetDropdownClickHdl ( aLink );
337 	mpTBLineColor->SetSelectHdl ( aLink );
338 	mpTBLineColor->Disable();
339 
340 	aLink = LINK(this, CellAppearancePropertyPanel, CBOXGridShowClkHdl);
341 	mpCBXShowGrid->SetClickHdl ( aLink );
342 
343 	mpTBFillColor->SetAccessibleRelationLabeledBy(mpFTFillColor.get());
344 	mpTBLineColor->SetAccessibleRelationLabeledBy(mpTBLineColor.get());
345 	mpTBCellBorder->SetAccessibleRelationLabeledBy(mpFTCellBorder.get());
346 	mpTBLineStyle->SetAccessibleRelationLabeledBy(mpTBLineStyle.get());
347 }
348 
349 //////////////////////////////////////////////////////////////////////////////
350 
351 IMPL_LINK(CellAppearancePropertyPanel, TbxBKColorSelectHdl, ToolBox*, pToolBox)
352 {
353 	sal_uInt16 nId = pToolBox->GetCurItemId();
354 	if(nId == TBI_BK_COLOR)
355 	{
356         maFillColorPopup.Show(*pToolBox);
357         maFillColorPopup.SetCurrentColor(maBackColor, mbBackColorAvailable);
358 	}
359 	return 0;
360 }
361 
362 //////////////////////////////////////////////////////////////////////////////
363 
364 IMPL_LINK(CellAppearancePropertyPanel, TbxLineColorSelectHdl, ToolBox*, pToolBox)
365 {
366 	sal_uInt16 nId = pToolBox->GetCurItemId();
367 	if(nId == TBI_LINE_COLOR)
368 	{
369         maLineColorPopup.Show(*pToolBox);
370         maLineColorPopup.SetCurrentColor(maLineColor, mbLineColorAvailable);
371 	}
372 	return 0;
373 }
374 
375 //////////////////////////////////////////////////////////////////////////////
376 
377 IMPL_LINK(CellAppearancePropertyPanel, TbxCellBorderSelectHdl, ToolBox*, pToolBox)
378 {
379 	sal_uInt16 nId = pToolBox->GetCurItemId();
380 
381     if(nId == TBI_BORDER)
382 	{
383         // create popup on demand
384         if(!mpCellBorderStylePopup.get())
385         {
386             mpCellBorderStylePopup.reset(
387                 new CellBorderStylePopup(
388                     this,
389                     ::boost::bind(&CellAppearancePropertyPanel::CreateCellBorderStylePopupControl, this, _1)));
390         }
391 
392         if(mpCellBorderStylePopup.get())
393         {
394             mpCellBorderStylePopup->Show(*pToolBox);
395         }
396 
397 //		pToolBox->SetItemDown( nId, true );
398 //
399 //		ScCellLineBorderPage* pBorderPage = GetBorderPage();
400 //
401 //		Size aFloatSz = pBorderPage->GetOutputSizePixel();
402 //		GetBorderFloatWin()->SetSizePixel( aFloatSz );
403 //
404 //		Point aPos = mpTBCellBorder->GetPosPixel();
405 //		aPos = OutputToScreenPixel( aPos );
406 //		Size aSize = mpTBCellBorder->GetSizePixel();
407 //		Rectangle aRect( aPos, aSize );
408 //
409 //		GetBorderFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
410 //		GetBorderFloatWin()->SetPopupModeFlags(GetBorderFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
411 //		pBorderPage->GetFocus();
412 //	//	pBorderPage->SetCurBorderSelect(maLineColor, true);
413 	}
414 	return 0;
415 }
416 
417 //////////////////////////////////////////////////////////////////////////////
418 
419 IMPL_LINK(CellAppearancePropertyPanel, TbxLineStyleSelectHdl, ToolBox*, pToolBox)
420 {
421 	sal_uInt16 nId = pToolBox->GetCurItemId();
422 	if(nId == TBI_LINE_STYLE)
423 	{
424         // create popup on demand
425         if(!mpCellLineStylePopup.get())
426         {
427             mpCellLineStylePopup.reset(
428                 new CellLineStylePopup(
429                     this,
430                     ::boost::bind(&CellAppearancePropertyPanel::CreateCellLineStylePopupControl, this, _1)));
431         }
432 
433         if(mpCellLineStylePopup.get())
434         {
435             mpCellLineStylePopup->SetLineStyleSelect(mnOut, mnIn, mnDis);
436             mpCellLineStylePopup->Show(*pToolBox);
437         }
438 
439 //		pToolBox->SetItemDown( nId, true );
440 //
441 //		ScCellLineStylePage* pStylePage = GetStylePage();
442 //		pStylePage->SetLineStyleSelect(mnOut, mnIn, mnDis);
443 //		Size aFloatSz = pStylePage->GetOutputSizePixel();
444 //		GetStyleFloatWin()->SetSizePixel( aFloatSz );
445 //		Point aPos = mpTBLineStyle->GetPosPixel();
446 //		aPos = OutputToScreenPixel( aPos );
447 //		Size aSize = mpTBLineStyle->GetSizePixel();
448 //		Rectangle aRect( aPos, aSize );
449 //
450 //		GetStyleFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
451 //		GetStyleFloatWin()->SetPopupModeFlags(GetStyleFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
452 //		pStylePage->GetFocus();
453 	}
454 	return 0;
455 }
456 
457 //////////////////////////////////////////////////////////////////////////////
458 
459 IMPL_LINK(CellAppearancePropertyPanel, CBOXGridShowClkHdl, void*, EMPTYARG)
460 {
461 	bool bState = mpCBXShowGrid->IsChecked();
462 	SfxBoolItem aItem( SID_SCGRIDSHOW , bState);
463 	GetBindings()->GetDispatcher()->Execute(SID_SCGRIDSHOW, SFX_CALLMODE_RECORD, &aItem, false, 0L);
464 	return 0;
465 }
466 
467 //////////////////////////////////////////////////////////////////////////////
468 
469 CellAppearancePropertyPanel* CellAppearancePropertyPanel::Create (
470     Window* pParent,
471     const cssu::Reference<css::frame::XFrame>& rxFrame,
472     SfxBindings* pBindings)
473 {
474     if (pParent == NULL)
475         throw lang::IllegalArgumentException(A2S("no parent Window given to CellAppearancePropertyPanel::Create"), NULL, 0);
476     if ( ! rxFrame.is())
477         throw lang::IllegalArgumentException(A2S("no XFrame given to CellAppearancePropertyPanel::Create"), NULL, 1);
478     if (pBindings == NULL)
479         throw lang::IllegalArgumentException(A2S("no SfxBindings given to CellAppearancePropertyPanel::Create"), NULL, 2);
480 
481     return new CellAppearancePropertyPanel(
482         pParent,
483         rxFrame,
484         pBindings);
485 }
486 
487 //////////////////////////////////////////////////////////////////////////////
488 
489 void CellAppearancePropertyPanel::DataChanged(
490     const DataChangedEvent& rEvent)
491 {
492     (void)rEvent;
493 }
494 
495 //////////////////////////////////////////////////////////////////////////////
496 
497 void CellAppearancePropertyPanel::HandleContextChange(
498     const ::sfx2::sidebar::EnumContext aContext)
499 {
500     if(maContext == aContext)
501     {
502         // Nothing to do.
503         return;
504     }
505 
506     maContext = aContext;
507 
508 
509 
510     // todo
511 }
512 
513 //////////////////////////////////////////////////////////////////////////////
514 
515 void CellAppearancePropertyPanel::NotifyItemUpdate(
516     sal_uInt16 nSID,
517     SfxItemState eState,
518     const SfxPoolItem* pState)
519 {
520 	switch(nSID)
521 	{
522 	case SID_BACKGROUND_COLOR:
523 		if(eState >= SFX_ITEM_DEFAULT)
524 		{
525             const SvxColorItem* pSvxColorItem = dynamic_cast< const SvxColorItem* >(pState);
526 
527             if(pSvxColorItem)
528             {
529 			    maBackColor = ((const SvxColorItem*)pState)->GetValue();
530 			    mbBackColorAvailable = true;
531 			    mpFillColorUpdater->Update(maBackColor);
532                 break;
533             }
534 		}
535 
536         mbBackColorAvailable = false;
537 		maBackColor.SetColor(COL_TRANSPARENT);
538 		mpFillColorUpdater->Update(COL_TRANSPARENT);
539         break;
540 	case SID_FRAME_LINECOLOR:
541 		if( eState == SFX_ITEM_DONTCARE)
542 		{
543 			mbLineColorAvailable = true;
544 			maLineColor.SetColor( COL_TRANSPARENT );
545     		UpdateControlState();
546             break;
547 		}
548 
549         if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SvxColorItem) )
550 		{
551             const SvxColorItem* pSvxColorItem = dynamic_cast< const SvxColorItem* >(pState);
552 
553             if(pSvxColorItem)
554             {
555 			    maLineColor = ((const SvxColorItem*)pState)->GetValue();
556 			    if(maLineColor == COL_AUTO)
557 				    mbLineColorAvailable = false;
558 			    else
559 			    {
560 				    mbLineColorAvailable = true;
561 			    //	mpLineColorUpdater->Update(maLineColor);
562 			    }
563 
564                 UpdateControlState();
565                 break;
566             }
567 		}
568 
569         mbLineColorAvailable = false;
570 		maLineColor.SetColor(COL_AUTO);
571 	    //	mpLineColorUpdater->Update(maLineColor);
572 		UpdateControlState();
573 		break;
574 	case SID_FRAME_LINESTYLE:
575 		if( eState == SFX_ITEM_DONTCARE )
576 		{
577 			mbBorderStyleAvailable = true;
578 			mnIn = 0;
579 			mnOut = 0;
580 			mnDis = 0;
581     		SetStyleIcon();
582             break;
583 		}
584 
585         if(eState >= SFX_ITEM_DEFAULT)
586 		{
587             const SvxLineItem* pSvxLineItem = dynamic_cast< const SvxLineItem* >(pState);
588 
589             if(pSvxLineItem)
590             {
591 			    const SvxBorderLine* mbLineItem = pSvxLineItem->GetLine();
592 			    mnIn = mbLineItem->GetInWidth();
593 			    mnOut = mbLineItem->GetOutWidth();
594 			    mnDis = mbLineItem->GetDistance();
595 
596                 if(mnIn == 0 && mnOut == 0 && mnDis == 0)
597 				    mbBorderStyleAvailable = false;
598 			    else
599 				    mbBorderStyleAvailable = true;
600 
601                 SetStyleIcon();
602                 break;
603             }
604 		}
605 
606 		mbBorderStyleAvailable = false;
607 		SetStyleIcon();
608 		break;
609 	case SID_ATTR_BORDER_OUTER:
610 		if(eState >= SFX_ITEM_DEFAULT)
611 		{
612 			const SvxBoxItem* pBoxItem = dynamic_cast< const SvxBoxItem* >(pState);
613 
614             if(pBoxItem)
615             {
616 			    mbLeft=false, mbRight=false, mbTop=false, mbBottom=false;
617 
618 			    if(pBoxItem->GetLeft())
619 				    mbLeft = true;
620 
621                 if(pBoxItem->GetRight())
622 				    mbRight = true;
623 
624                 if(pBoxItem->GetTop())
625 				    mbTop = true;
626 
627                 if(pBoxItem->GetBottom())
628 				    mbBottom = true;
629 
630                 if(!Application::GetSettings().GetLayoutRTL())
631 				    mpCellBorderUpdater->UpdateCellBorder(mbTop, mbBottom, mbLeft, mbRight, maIMGCellBorder, mbVer, mbHor);
632 			    else
633 				    mpCellBorderUpdater->UpdateCellBorder(mbTop, mbBottom, mbRight, mbLeft, maIMGCellBorder, mbVer, mbHor);
634 
635                 if(mbLeft || mbRight || mbTop || mbBottom)
636 				    mbOuterBorder = true;
637 			    else
638 				    mbOuterBorder = false;
639 
640                 UpdateControlState();
641             }
642 		}
643 		break;
644 	case SID_ATTR_BORDER_INNER:
645 		if(eState >= SFX_ITEM_DEFAULT)
646 		{
647 			const SvxBoxInfoItem* pBoxInfoItem = dynamic_cast< const SvxBoxInfoItem* >(pState);
648 
649             if(pBoxInfoItem)
650             {
651 			    bool bLeft(false), bRight(false), bTop(false), bBottom(false);
652 
653 			    mbVer = false, mbHor = false;
654 
655                 if(!pBoxInfoItem->IsValid( VALID_VERT )  || pBoxInfoItem->GetVert())
656 				    mbVer = true;
657 
658 			    if(!pBoxInfoItem->IsValid( VALID_HORI )  || pBoxInfoItem->GetHori())
659 				    mbHor = true;
660 
661 			    if(!pBoxInfoItem->IsValid( VALID_LEFT ) || mbLeft)
662 				    bLeft = true;
663 
664 			    if(!pBoxInfoItem->IsValid( VALID_RIGHT ) || mbRight)
665 				    bRight = true;
666 
667 			    if(!pBoxInfoItem->IsValid( VALID_TOP ) || mbTop)
668 				    bTop = true;
669 
670 			    if(!pBoxInfoItem->IsValid( VALID_BOTTOM ) || mbBottom)
671 				    bBottom = true;
672 
673                 if(!Application::GetSettings().GetLayoutRTL())
674 				    mpCellBorderUpdater->UpdateCellBorder(bTop, bBottom, bLeft, bRight, maIMGCellBorder, mbVer, mbHor);
675 			    else
676 				    mpCellBorderUpdater->UpdateCellBorder(bTop, bBottom, bRight, bLeft, maIMGCellBorder, mbVer, mbHor);
677 
678                 if(mbVer || mbHor || bLeft || bRight || bTop || bBottom)
679 				    mbInnerBorder = true;
680 			    else
681 				    mbInnerBorder = false;
682 
683                 UpdateControlState();
684             }
685 		}
686 		break;
687 	case SID_ATTR_BORDER_DIAG_TLBR:
688 		if( eState == SFX_ITEM_DONTCARE )
689 		{
690 			mbTLBR = true;
691 			maTLBRColor.SetColor(COL_TRANSPARENT);
692 			mnTLBRIn = mnTLBROut = mnTLBRDis = 0;
693     		UpdateControlState();
694             break;
695 		}
696 
697         if(eState >= SFX_ITEM_DEFAULT)
698 		{
699 			const SvxLineItem* pItem = dynamic_cast< const SvxLineItem* >(pState);
700 
701             if(pItem)
702             {
703 			    const SvxBorderLine* aLine = pItem->GetLine();
704 
705                 if(!aLine)
706                 {
707 				    mbTLBR = false;
708                 }
709 			    else
710 			    {
711 				    mbTLBR = true;
712 				    maTLBRColor = aLine->GetColor();
713 				    mnTLBRIn = aLine->GetInWidth();
714 				    mnTLBROut = aLine->GetOutWidth();
715 				    mnTLBRDis = aLine->GetDistance();
716 
717                     if(mnTLBRIn == 0 && mnTLBROut == 0 && mnTLBRDis == 0)
718 					    mbTLBR = false;
719 			    }
720 
721                 UpdateControlState();
722                 break;
723             }
724 		}
725 
726         mbTLBR = false;
727 		UpdateControlState();
728 		break;
729 	case SID_ATTR_BORDER_DIAG_BLTR:
730 		if( eState == SFX_ITEM_DONTCARE )
731 		{
732 			mbBLTR = true;
733 			maBLTRColor.SetColor( COL_TRANSPARENT );
734 			mnBLTRIn = mnBLTROut = mnBLTRDis = 0;
735     		UpdateControlState();
736             break;
737 		}
738 
739         if(eState >= SFX_ITEM_DEFAULT)
740 		{
741 			const SvxLineItem* pItem = dynamic_cast< const SvxLineItem* >(pState);
742 
743             if(pItem)
744             {
745 			    const SvxBorderLine* aLine = pItem->GetLine();
746 
747                 if(!aLine)
748                 {
749 				    mbBLTR = false;
750                 }
751 			    else
752 			    {
753 				    mbBLTR = true;
754 				    maBLTRColor = aLine->GetColor();
755 				    mnBLTRIn = aLine->GetInWidth();
756 				    mnBLTROut = aLine->GetOutWidth();
757 				    mnBLTRDis = aLine->GetDistance();
758 
759                     if(mnBLTRIn == 0 && mnBLTROut == 0 && mnBLTRDis == 0)
760 					    mbBLTR = false;
761 			    }
762 
763                 UpdateControlState();
764             }
765             break;
766 		}
767 
768         mbBLTR = false;
769 		UpdateControlState();
770 		break;
771 	case SID_SCGRIDSHOW:
772 		if(eState >= SFX_ITEM_DEFAULT)
773 		{
774 			const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
775 
776             if(pItem)
777             {
778 			    const bool bVal = pItem->GetValue();
779 
780 			    if(bVal)
781 				    mpCBXShowGrid->Check(true);
782 			    else
783 				    mpCBXShowGrid->Check(false);
784             }
785 		}
786 		break;
787 	}
788 }
789 
790 //////////////////////////////////////////////////////////////////////////////
791 
792 SfxBindings* CellAppearancePropertyPanel::GetBindings()
793 {
794     return mpBindings;
795 }
796 
797 //////////////////////////////////////////////////////////////////////////////
798 
799 void CellAppearancePropertyPanel::SetStyleIcon()
800 {
801 	if(mnOut == DEF_LINE_WIDTH_0 && mnIn == 0 && mnDis == 0)	//1
802 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle1H : maIMGLineStyle1);
803 	else if(mnOut == DEF_LINE_WIDTH_2 && mnIn == 0 && mnDis == 0) //2
804 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle2H :maIMGLineStyle2);
805 	else if(mnOut == DEF_LINE_WIDTH_3 && mnIn == 0 && mnDis == 0) //3
806 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle3H :maIMGLineStyle3);
807 	else if(mnOut == DEF_LINE_WIDTH_4 && mnIn == 0 && mnDis == 0) //4
808 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle4H :maIMGLineStyle4);
809 	else if(mnOut == DEF_DOUBLE_LINE0_OUT && mnIn == DEF_DOUBLE_LINE0_IN && mnDis == DEF_DOUBLE_LINE0_DIST) //5
810 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle5H :maIMGLineStyle5);
811 	else if(mnOut == DEF_DOUBLE_LINE7_OUT && mnIn == DEF_DOUBLE_LINE7_IN && mnDis == DEF_DOUBLE_LINE7_DIST) //6
812 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle6H :maIMGLineStyle6);
813 	else if(mnOut == DEF_DOUBLE_LINE4_OUT && mnIn == DEF_DOUBLE_LINE4_IN && mnDis == DEF_DOUBLE_LINE4_DIST) //7
814 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle7H :maIMGLineStyle7);
815 	else if(mnOut == DEF_DOUBLE_LINE9_OUT && mnIn == DEF_DOUBLE_LINE9_IN && mnDis == DEF_DOUBLE_LINE9_DIST) //8
816 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle8H :maIMGLineStyle8);
817 	else if(mnOut == DEF_DOUBLE_LINE2_OUT && mnIn == DEF_DOUBLE_LINE2_IN && mnDis == DEF_DOUBLE_LINE2_DIST) //9
818 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle9H :maIMGLineStyle9);
819 	else
820 		mpTBLineStyle->SetItemImage(TBI_LINE_STYLE, GetDisplayBackground().GetColor().IsDark() ? maIMGLineStyle1H :maIMGLineStyle1);
821 }
822 
823 //////////////////////////////////////////////////////////////////////////////
824 
825 void CellAppearancePropertyPanel::UpdateControlState()
826 {
827 	if(mbOuterBorder || mbInnerBorder || mbTLBR || mbBLTR)
828 	{
829 		mpTBLineColor->Enable();
830 		mpTBLineStyle->Enable();
831 
832 		//set line color state
833 		if( mbLineColorAvailable && !mbTLBR && !mbBLTR )
834 			mpLineColorUpdater->Update(maLineColor);
835 		else if( !mbLineColorAvailable && mbTLBR && !mbBLTR )
836 			mpLineColorUpdater->Update(maTLBRColor);
837 		else if ( !mbLineColorAvailable && !mbTLBR && mbBLTR )
838 			mpLineColorUpdater->Update(maBLTRColor);
839 		else if( !mbLineColorAvailable && mbTLBR && mbBLTR)
840 		{
841 			if( maTLBRColor == maBLTRColor)
842 				mpLineColorUpdater->Update(maBLTRColor);
843 			else
844 				mpLineColorUpdater->Update(COL_TRANSPARENT);
845 		}
846 		else if( mbLineColorAvailable && mbTLBR && !mbBLTR )
847 		{
848 			if( maTLBRColor == maLineColor)
849 				mpLineColorUpdater->Update(maLineColor);
850 			else
851 				mpLineColorUpdater->Update(COL_TRANSPARENT);
852 		}
853 		else if( mbLineColorAvailable && !mbTLBR && mbBLTR )
854 		{
855 			if( maBLTRColor == maLineColor)
856 				mpLineColorUpdater->Update(maLineColor);
857 			else
858 				mpLineColorUpdater->Update(COL_TRANSPARENT);
859 		}
860 		else
861 			mpLineColorUpdater->Update(COL_TRANSPARENT);
862 
863 		//set line style state
864 		if( mbBorderStyleAvailable && !mbTLBR && !mbBLTR )
865 		{
866 		}
867 		else if( !mbBorderStyleAvailable && mbTLBR && !mbBLTR )
868 		{
869 			mnIn = mnTLBRIn;
870 			mnOut = mnTLBROut;
871 			mnDis = mnTLBRDis;
872 		}
873 		else if ( !mbBorderStyleAvailable && !mbTLBR && mbBLTR )
874 		{
875 			mnIn = mnBLTRIn;
876 			mnOut = mnBLTROut;
877 			mnDis = mnBLTRDis;
878 		}
879 		else if( !mbBorderStyleAvailable && mbTLBR && mbBLTR)
880 		{
881 			if( mnTLBRIn == mnBLTRIn && mnTLBROut == mnBLTROut && mnTLBRDis == mnBLTRDis)
882 			{
883 				mnIn = mnTLBRIn;
884 				mnOut = mnTLBROut;
885 				mnDis = mnTLBRDis;
886 			}
887 			else
888 			{
889 				mnIn = 0;
890 				mnOut = 0;
891 				mnDis = 0;
892 			}
893 		}
894 		else if( mbBorderStyleAvailable && mbTLBR && !mbBLTR )
895 		{
896 			if( mnTLBRIn != mnIn || mnTLBROut != mnOut || mnTLBRDis != mnDis)
897 			{
898 				mnIn = 0;
899 				mnOut = 0;
900 				mnDis = 0;
901 			}
902 		}
903 		else if( mbBorderStyleAvailable && !mbTLBR && mbBLTR )
904 		{
905 			if(  mnBLTRIn != mnIn || mnBLTROut != mnOut || mnBLTRDis != mnDis )
906 			{
907 				mnIn = 0;
908 				mnOut = 0;
909 				mnDis = 0;
910 			}
911 		}
912 		else
913 		{
914 			mnIn = 0;
915 			mnOut = 0;
916 			mnDis = 0;
917 		}
918 		SetStyleIcon();
919 	}
920 	else
921 	{
922 		mpTBLineColor->Disable();
923 		mpTBLineStyle->Disable();
924 	}
925 }
926 
927 //////////////////////////////////////////////////////////////////////////////
928 
929 
930 
931 
932 //void CellAppearancePropertyPanel::PaintRect(const ToolBox &rTB)
933 //{
934 //	Point aPos = rTB.GetPosPixel();
935 //	Size aSize = rTB.GetSizePixel();
936 //	Rectangle aRect( aPos, aSize );
937 //	aRect.Left() -= 1;
938 //	aRect.Top() -= 1;
939 //	aRect.Right() += 1;
940 //	aRect.Bottom() += 1;
941 //	Color aOldLineColor = GetLineColor();
942 //	Color aOldFillColor = GetFillColor();
943 //	Color aLineColor(119,152,185);
944 ////	Color aLineColor = GetSettings().GetStyleSettings().GetPropertySectionTBxBorderColor();
945 //	SetLineColor(aLineColor);
946 //	if(!GetSettings().GetStyleSettings().GetHighContrastMode())
947 //	{
948 //		SetLineColor(aLineColor);
949 //		SetFillColor(COL_WHITE);
950 //	}
951 //	else
952 //	{
953 //		SetLineColor(GetSettings().GetStyleSettings().GetShadowColor());
954 //		SetFillColor(COL_TRANSPARENT);
955 //	}
956 //	DrawRect(aRect);
957 //
958 //	SetLineColor(aOldLineColor);
959 //	SetFillColor(aOldFillColor);
960 //}
961 //void CellAppearancePropertyPanel::Paint(const Rectangle &rRect)
962 //{
963 //	SfxSectionPage::Paint(rRect);
964 //	if(mpLineColorUpdater == NULL)
965 //		return;
966 //
967 //	PaintRect(*mpTBFillColor);
968 //	PaintRect(*mpTBCellBorder);
969 //	PaintRect(*mpTBLineStyle);
970 //	PaintRect(*mpTBLineColor);
971 //}
972 //CellAppearancePropertyPanel::ScCellBackColorPage* CellAppearancePropertyPanel::GetColorPage()
973 //{
974 //	if (!mpFloatWinColor)
975 //	{
976 //		mpFloatWinColor = new SfxPopupPanelWin(this);
977 //		mpFloatWinColor->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Background Color")));		//wj acc
978 //		mpFloatWinColor->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
979 //		mpPageColor = new ScCellBackColorPage(mpFloatWinColor, this);
980 //		mpFloatWinColor->SetBorderLineStyle( mpFloatWinColor->GetBorderStyle() | WINDOW_BORDER_MENU );
981 //	}
982 //	return mpPageColor;
983 //}
984 //SfxPopupPanelWin* CellAppearancePropertyPanel::GetColorFloatWin()
985 //{
986 //	if (!mpFloatWinColor)
987 //	{
988 //		mpFloatWinColor = new SfxPopupPanelWin(this);
989 //		mpFloatWinColor->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Background Color")));		//wj acc
990 //		mpFloatWinColor->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
991 //		mpPageColor = new ScCellBackColorPage(mpFloatWinColor, this);
992 //		mpFloatWinColor->SetBorderLineStyle( mpFloatWinColor->GetBorderStyle() | WINDOW_BORDER_MENU );
993 //	}
994 //	return mpFloatWinColor;
995 //}
996 //CellAppearancePropertyPanel::ScCellLineColorPage* CellAppearancePropertyPanel::GetLineColorPage()
997 //{
998 //	if (!mpFloatWinLineColor)
999 //	{
1000 //		mpFloatWinLineColor = new SfxPopupPanelWin(this);
1001 //		mpFloatWinLineColor->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Line Color")));		//wj acc
1002 //		mpFloatWinLineColor->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
1003 //		mpPageLineColor = new ScCellLineColorPage(mpFloatWinLineColor, this);
1004 //		mpFloatWinLineColor->SetBorderLineStyle( mpFloatWinLineColor->GetBorderStyle() | WINDOW_BORDER_MENU );
1005 //	}
1006 //	return mpPageLineColor;
1007 //}
1008 //SfxPopupPanelWin* CellAppearancePropertyPanel::GetLineColorFloatWin()
1009 //{
1010 //	if (!mpFloatWinLineColor)
1011 //	{
1012 //		mpFloatWinLineColor = new SfxPopupPanelWin(this);
1013 //		mpFloatWinLineColor->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Line Color")));		//wj acc
1014 //		mpFloatWinLineColor->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
1015 //		mpPageLineColor = new ScCellLineColorPage(mpFloatWinLineColor, this);
1016 //		mpFloatWinLineColor->SetBorderLineStyle( mpFloatWinLineColor->GetBorderStyle() | WINDOW_BORDER_MENU );
1017 //	}
1018 //	return mpFloatWinLineColor;
1019 //}
1020 //void  CellAppearancePropertyPanel::SetColor(Color aColor, sal_uInt16 nType)
1021 //{
1022 //	if(nType == BACK_COLOR)
1023 //		maBackColor = aColor;
1024 //	else if(nType == LINE_COLOR)
1025 //		maLineColor = aColor;
1026 //}
1027 //CellAppearancePropertyPanel::ScCellLineBorderPage* CellAppearancePropertyPanel::GetBorderPage()
1028 //{
1029 //	if (!mpFloatWinBorder)
1030 //	{
1031 //		mpFloatWinBorder = new SfxPopupPanelWin(this);
1032 //		mpFloatWinBorder->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cell Border")));		//wj acc
1033 //		mpFloatWinBorder->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
1034 //		mpPageBorder = new ScCellLineBorderPage(mpFloatWinBorder, this);
1035 //		mpFloatWinBorder->SetBorderLineStyle( mpFloatWinBorder->GetBorderStyle() | WINDOW_BORDER_MENU );
1036 //	}
1037 //	return mpPageBorder;
1038 //}
1039 //SfxPopupPanelWin* CellAppearancePropertyPanel::GetBorderFloatWin()
1040 //{
1041 //	if (!mpFloatWinBorder)
1042 //	{
1043 //		mpFloatWinBorder = new SfxPopupPanelWin(this);
1044 //		mpFloatWinBorder->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cell Border")));		//wj acc
1045 //		mpFloatWinBorder->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
1046 //		mpPageBorder = new ScCellLineBorderPage(mpFloatWinBorder, this);
1047 //		mpFloatWinBorder->SetBorderLineStyle( mpFloatWinBorder->GetBorderStyle() | WINDOW_BORDER_MENU );
1048 //	}
1049 //	return mpFloatWinBorder;
1050 //}
1051 //line Style window
1052 //CellAppearancePropertyPanel::ScCellLineStylePage* CellAppearancePropertyPanel::GetStylePage()
1053 //{
1054 //	if (!mpFloatWinStyle)
1055 //	{
1056 //		mpFloatWinStyle = new SfxPopupPanelWin(this);
1057 //		mpFloatWinStyle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Line Style")));		//wj acc
1058 //		mpFloatWinStyle->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
1059 //		mpPageStyle = new ScCellLineStylePage(mpFloatWinStyle, this);
1060 //		mpFloatWinStyle->SetBorderLineStyle( mpFloatWinStyle->GetBorderStyle() | WINDOW_BORDER_MENU );
1061 //	}
1062 //	return mpPageStyle;
1063 //}
1064 //SfxPopupPanelWin* CellAppearancePropertyPanel::GetStyleFloatWin()
1065 //{
1066 //	if (!mpFloatWinStyle)
1067 //	{
1068 //		mpFloatWinStyle = new SfxPopupPanelWin(this);
1069 //		mpFloatWinStyle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Line Style")));		//wj acc
1070 //		mpFloatWinStyle->SetPopupModeEndHdl( LINK( this, CellAppearancePropertyPanel, ImplPopupModeEndHdl ) );
1071 //		mpPageStyle = new ScCellLineStylePage(mpFloatWinStyle, this);
1072 //		mpFloatWinStyle->SetBorderLineStyle( mpFloatWinStyle->GetBorderStyle() | WINDOW_BORDER_MENU );
1073 //	}
1074 //	return mpFloatWinStyle;
1075 //}
1076 
1077 //////////////////////////////////////////////////////////////////////////////
1078 // namespace close
1079 
1080 }} // end of namespace ::sc::sidebar
1081 
1082 //////////////////////////////////////////////////////////////////////////////
1083 // eof
1084