You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/03/30 19:27:44 UTC
svn commit: r1462835 [3/4] - in /openoffice/branches/sidebar/main:
default_images/sc/res/sidebar/
officecfg/registry/data/org/openoffice/Office/UI/ sc/inc/ sc/prj/ sc/sdi/
sc/source/core/data/ sc/source/ui/app/ sc/source/ui/inc/
sc/source/ui/sidebar/ s...
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,264 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef SC_PROPERTYPANEL_APPEARANCE_HXX
+#define SC_PROPERTYPANEL_APPEARANCE_HXX
+
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <boost/scoped_ptr.hpp>
+#include <svx/sidebar/ColorPopup.hxx>
+
+//#include <sfx2/sectionpage.hxx>
+//#include <svx/dialcontrol.hxx>
+//#include <svx/tbxcolorupdate.hxx>
+//#include <svx/tbxlineupdate.hxx>
+//#include <vcl/fixed.hxx>
+//#include <vcl/toolbox.hxx>
+//#include <vcl/button.hxx>
+//#include <vcl/field.hxx>
+//#include <svx/svxenum.hxx>
+//#include <svx/borderline.hxx>
+
+class FixedText;
+namespace svx { class ToolboxButtonColorUpdater; }
+namespace sc { namespace sidebar {
+ class CellLineStylePopup;
+ class CellBorderStylePopup;
+ class CellLineStyleControl;
+ class CellBorderUpdater;
+}}
+class ToolBox;
+class CheckBox;
+
+namespace sc { namespace sidebar {
+
+class CellAppearancePropertyPanel
+: public Control,
+ public ::sfx2::sidebar::IContextChangeReceiver,
+ public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+private:
+ friend class CellLineStyleControl;
+ friend class CellBorderStyleControl;
+
+public:
+ static CellAppearancePropertyPanel* Create(
+ Window* pParent,
+ const cssu::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+
+ virtual void DataChanged(
+ const DataChangedEvent& rEvent);
+
+ virtual void HandleContextChange(
+ const ::sfx2::sidebar::EnumContext aContext);
+
+ virtual void NotifyItemUpdate(
+ const sal_uInt16 nSId,
+ const SfxItemState eState,
+ const SfxPoolItem* pState);
+
+ SfxBindings* GetBindings();
+
+ //virtual void Paint(const Rectangle &rRect);
+ //void SetColor(Color aColor, sal_uInt16 nType);
+
+private:
+ //ui controls
+ ::boost::scoped_ptr< FixedText > mpFTFillColor;
+ ::boost::scoped_ptr< Window > mpTBFillColorBackground;
+ ::boost::scoped_ptr< ToolBox > mpTBFillColor;
+ ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpFillColorUpdater;
+
+ ::boost::scoped_ptr< FixedText > mpFTCellBorder;
+ ::boost::scoped_ptr< Window > mpTBCellBorderBackground;
+ ::boost::scoped_ptr< ToolBox > mpTBCellBorder;
+ ::boost::scoped_ptr< CellBorderUpdater > mpCellBorderUpdater;
+
+ ::boost::scoped_ptr< Window > mpTBLineStyleBackground;
+ ::boost::scoped_ptr< ToolBox > mpTBLineStyle;
+
+ ::boost::scoped_ptr< Window > mpTBLineColorBackground;
+ ::boost::scoped_ptr< ToolBox > mpTBLineColor;
+ ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpLineColorUpdater;
+
+ ::boost::scoped_ptr< CheckBox > mpCBXShowGrid;
+
+ ::sfx2::sidebar::ControllerItem maBackColorControl;
+ ::sfx2::sidebar::ControllerItem maLineColorControl;
+ ::sfx2::sidebar::ControllerItem maLineStyleControl;
+ ::sfx2::sidebar::ControllerItem maBorderOuterControl;
+ ::sfx2::sidebar::ControllerItem maBorderInnerControl;
+ ::sfx2::sidebar::ControllerItem maGridShowControl;
+ ::sfx2::sidebar::ControllerItem maBorderTLBRControl;
+ ::sfx2::sidebar::ControllerItem maBorderBLTRControl;
+
+ // images
+ Image maIMGBKColor;
+ Image maIMGCellBorder;
+ Image maIMGLineColor;
+ Image maIMGLineStyle1;
+ Image maIMGLineStyle2;
+ Image maIMGLineStyle3;
+ Image maIMGLineStyle4;
+ Image maIMGLineStyle5;
+ Image maIMGLineStyle6;
+ Image maIMGLineStyle7;
+ Image maIMGLineStyle8;
+ Image maIMGLineStyle9;
+
+ // high contrast images
+ Image maIMGBKColorH;
+ Image maIMGLineStyle0H;
+ Image maIMGLineStyle1H;
+ Image maIMGLineStyle2H;
+ Image maIMGLineStyle3H;
+ Image maIMGLineStyle4H;
+ Image maIMGLineStyle5H;
+ Image maIMGLineStyle6H;
+ Image maIMGLineStyle7H;
+ Image maIMGLineStyle8H;
+ Image maIMGLineStyle9H;
+
+ // cell background color
+ Color maBackColor;
+
+ // cell line color(s)
+ Color maLineColor;
+ Color maTLBRColor;
+ Color maBLTRColor;
+
+ // BorderStyle defines
+ sal_uInt16 mnIn;
+ sal_uInt16 mnOut;
+ sal_uInt16 mnDis;
+ sal_uInt16 mnTLBRIn;
+ sal_uInt16 mnTLBROut;
+ sal_uInt16 mnTLBRDis;
+ sal_uInt16 mnBLTRIn;
+ sal_uInt16 mnBLTROut;
+ sal_uInt16 mnBLTRDis;
+
+ /// bitfield
+ bool mbBackColorAvailable : 1;
+ bool mbLineColorAvailable : 1;
+ bool mbBorderStyleAvailable : 1;
+
+ // CellBorder defines
+ bool mbLeft : 1;
+ bool mbRight : 1;
+ bool mbTop : 1;
+ bool mbBottom : 1;
+ bool mbVer : 1;
+ bool mbHor : 1;
+
+ bool mbOuterBorder : 1; // mbLeft || mbRight || mbTop || mbBottom
+ bool mbInnerBorder : 1; // mbVer || mbHor || bLeft || bRight || bTop || bBottom
+
+ bool mbTLBR : 1;
+ bool mbBLTR : 1;
+
+ // popups
+ svx::sidebar::ColorPopup maFillColorPopup;
+ svx::sidebar::ColorPopup maLineColorPopup;
+ ::boost::scoped_ptr< CellLineStylePopup > mpCellLineStylePopup;
+ ::boost::scoped_ptr< CellBorderStylePopup > mpCellBorderStylePopup;
+
+ cssu::Reference<css::frame::XFrame> mxFrame;
+ ::sfx2::sidebar::EnumContext maContext;
+ SfxBindings* mpBindings;
+
+ DECL_LINK(TbxBKColorSelectHdl, ToolBox*);
+ DECL_LINK(TbxLineColorSelectHdl, ToolBox*);
+ DECL_LINK(TbxCellBorderSelectHdl, ToolBox*);
+ DECL_LINK(TbxLineStyleSelectHdl, ToolBox*);
+ DECL_LINK(CBOXGridShowClkHdl, void*);
+
+ // for fill color picker
+ svx::sidebar::PopupControl* CreateFillColorPopupControl(svx::sidebar::PopupContainer* pParent);
+ Color GetLastFillColor(void) const;
+ void SetFillColor(const String& rsColorName, const Color aColor);
+
+ // for line color picker
+ svx::sidebar::PopupControl* CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent);
+ Color GetLastLineColor(void) const;
+ void SetLineColor(const String& rsColorName, const Color aColor);
+
+ // for CellLineStyle popup
+ svx::sidebar::PopupControl* CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent);
+ void EndCellLineStylePopupMode(void);
+
+ // for CellBorderStyle popup
+ svx::sidebar::PopupControl* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent);
+ void EndCellBorderStylePopupMode(void);
+
+ // constructor/destuctor
+ CellAppearancePropertyPanel(
+ Window* pParent,
+ const cssu::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+ virtual ~CellAppearancePropertyPanel();
+
+ void Initialize();
+ void SetStyleIcon();
+ void UpdateControlState();
+
+
+ //popup windows
+// SfxPopupPanelWin* mpFloatWinColor;
+// class ScCellBackColorPage;
+// ScCellBackColorPage* mpPageColor;
+
+// SfxPopupPanelWin* mpFloatWinLineColor;
+// class ScCellLineColorPage;
+// ScCellLineColorPage* mpPageLineColor;
+
+// SfxPopupPanelWin* mpFloatWinStyle;
+// class ScCellLineStylePage;
+// ScCellLineStylePage* mpPageStyle;
+
+// SfxPopupPanelWin* mpFloatWinBorder;
+// class ScCellLineBorderPage;
+// ScCellLineBorderPage* mpPageBorder;
+
+// void PaintRect(const ToolBox &rTB);
+
+// ScCellBackColorPage* GetColorPage();
+// SfxPopupPanelWin* GetColorFloatWin();
+//
+// ScCellLineColorPage* GetLineColorPage();
+// SfxPopupPanelWin* GetLineColorFloatWin();
+//
+// ScCellLineStylePage* GetStylePage();
+// SfxPopupPanelWin* GetStyleFloatWin();
+//
+// ScCellLineBorderPage* GetBorderPage();
+// SfxPopupPanelWin* GetBorderFloatWin();
+
+
+};
+
+} } // end of namespace ::sc::sidebar
+
+#endif
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.src?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.src (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.src Sat Mar 30 18:27:42 2013
@@ -0,0 +1,612 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "CellAppearancePropertyPanel.hrc"
+#include <sfx2/sidebar/propertypanel.hrc>
+#include "sc.hrc"
+#include "helpids.h"
+
+#define TOOLBOX_WIDTH 50
+#define TOOLBOX_HEIGHT 15
+
+#define TOOLBOX_WIDTH_2 34
+#define TOOLBOX_HEIGHT_2 30
+
+#define TOOLBOX_BORDER_WIDTH 107
+#define PB_BORDER_MOREBTN 57
+#define POPUPPANEL_MARGIN_SMALL_PIXEL 8
+
+//////////////////////////////////////////////////////////////////////////////
+// the basic propertypanel
+
+Control RID_PROPERTYPANEL_SC_APPEAR
+{
+ OutputSize = TRUE;
+ DialogControl = TRUE;
+ Border = FALSE;
+
+ Size = MAP_APPFONT( PROPERTYPAGE_WIDTH, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT * 2 + TEXT_CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT_2 + CBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT - 2);
+ HelpID = HID_PROPERTYPANEL_SC_CELL_SECTION ;
+ Text [ en-US ] = "Cell Appearance";
+
+ FixedText FT_BK_COLOR
+ {
+ Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL, SECTIONPAGE_MARGIN_VERTICAL_TOP );
+ Size = MAP_APPFONT ( PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL * 2 , TEXT_HEIGHT) ;
+ Text [ en-US ] = "~Cell background:";
+ };
+ ToolBox TB_BK_COLOR
+ {
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL) ;
+ Size = MAP_APPFONT (TOOLBOX_WIDTH ,TOOLBOX_HEIGHT ) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_TBX_BKCOLOR ;
+ Text [ en-US ] = "Cell Background";
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = TBI_BK_COLOR ;
+ DropDown = TRUE ;
+ Text [ en-US ] = "Cell background" ;
+ HelpID = HID_PROPERTYPANEL_SC_TBI_BKCOLOR;
+ };
+ };
+ };
+ String STR_QH_BK_COLOR
+ {
+ Text [ en-US ] = "Select the background color of the selected cells." ;
+ };
+ FixedText FT_BORDER
+ {
+ Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL + TOOLBOX_HEIGHT + CONTROL_SPACING_VERTICAL);
+ Size = MAP_APPFONT ( PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL * 2 , TEXT_HEIGHT) ;
+ Text [ en-US ] = "Cell ~border:";
+ };
+ ToolBox TB_APP_BORDER
+ {
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT * 2 + TEXT_CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT + CONTROL_SPACING_VERTICAL) ;
+ Size = MAP_APPFONT (TOOLBOX_WIDTH_2 ,TOOLBOX_HEIGHT_2 ) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_TBX_BORDER ;
+ Text [ en-US ] = "Cell Border";
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER ;
+ DropDown = TRUE ;
+ Text [ en-US ] = "Cell border" ;
+ HelpID = HID_PROPERTYPANEL_SC_TBI_BORDER;
+ };
+ };
+ };
+ String STR_QH_BORDER
+ {
+ Text [ en-US ] = "Specify the borders of the selected cells." ;
+ };
+ ToolBox TB_BORDER_LINE_STYLE
+ {
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH_2 + 3, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT * 2 + TEXT_CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT + CONTROL_SPACING_VERTICAL ) ;
+ Size = MAP_APPFONT (TOOLBOX_WIDTH ,TOOLBOX_HEIGHT) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_TBX_STYLE ;
+ Text [ en-US ] = "Line Style";
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = TBI_LINE_STYLE ;
+ DropDown = TRUE ;
+ Text [ en-US ] = "Line style" ;
+ HelpID = HID_PROPERTYPANEL_SC_TBI_STYLE;
+ };
+ };
+ };
+ String STR_QH_BORDER_LINE_STYLE
+ {
+ Text [ en-US ] = "Select the line style of the borders." ;
+ };
+ ToolBox TB_BORDER_LINE_COLOR
+ {
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH_2 + 3, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT * 2 + TEXT_CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT * 2 + CONTROL_SPACING_VERTICAL + 3) ;
+ Size = MAP_APPFONT (TOOLBOX_WIDTH ,TOOLBOX_HEIGHT ) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_TBX_LINECOLOR ;
+ Text [ en-US ] = "Line Color";
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = TBI_LINE_COLOR ;
+ DropDown = TRUE ;
+ Text [ en-US ] = "Line color" ;
+ HelpID = HID_PROPERTYPANEL_SC_TBI_LINECOLOR;
+ };
+ };
+ };
+ String STR_QH_BORDER_LINE_COLOR
+ {
+ Text [ en-US ] = "Select the line color of the borders." ;
+ };
+ CheckBox CBX_SHOW_GRID
+ {
+ Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL , SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT * 2 + TEXT_CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + TOOLBOX_HEIGHT_2 + 2) ;
+ Size = MAP_APPFONT ( 90 , CBOX_HEIGHT ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Show cell ~grid lines" ;
+ QuickHelpText [ en-US ] = "Show the grid lines of the cells in the entire spreadsheet.";
+ HelpID = HID_PROPERTYPANEL_SC_CBOX_SHOWGRID;
+ };
+
+ Image IMG_BK_COLOR
+ {
+ ImageBitmap = Bitmap{File = "sidebar/fill_color.png";};
+ };
+ Image IMG_CELL_BORDER
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder.png";};
+ //MaskColor = STD_MASKCOLOR ;
+ };
+ Image IMG_LINE_COLOR
+ {
+ ImageBitmap = Bitmap{File = "sidebar/Line_color.png";};
+ };
+ Image IMG_LINE_STYLE1
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_005.png";};
+ };
+ Image IMG_LINE_STYLE2
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_250.png";};
+ };
+ Image IMG_LINE_STYLE3
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_400.png";};
+ };
+ Image IMG_LINE_STYLE4
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_500.png";};
+ };
+ Image IMG_LINE_STYLE5
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_110.png";};
+ };
+ Image IMG_LINE_STYLE6
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_260.png";};
+ };
+ Image IMG_LINE_STYLE7
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_450.png";};
+ };
+ Image IMG_LINE_STYLE8
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_505.png";};
+ };
+ Image IMG_LINE_STYLE9
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_750.png";};
+ };
+
+ //high contrast
+ Image IMG_BK_COLOR_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/fill_color_h.png";};
+ };
+ Image IMG_LINE_STYLE1_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_005_h.png";};
+ };
+ Image IMG_LINE_STYLE2_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_250_h.png";};
+ };
+ Image IMG_LINE_STYLE3_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_400_h.png";};
+ };
+ Image IMG_LINE_STYLE4_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_500_h.png";};
+ };
+ Image IMG_LINE_STYLE5_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_110_h.png";};
+ };
+ Image IMG_LINE_STYLE6_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_260_h.png";};
+ };
+ Image IMG_LINE_STYLE7_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_450_h.png";};
+ };
+ Image IMG_LINE_STYLE8_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_505_h.png";};
+ };
+ Image IMG_LINE_STYLE9_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_750_h.png";};
+ };
+
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// fill color popup
+
+Control RID_POPUPPANEL_CELLAPPEARANCE_FILLCOLOR
+{
+ OutputSize = TRUE;
+ DialogControl = TRUE;
+ Border = FALSE;
+ Size = MAP_APPFONT( POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT );
+
+ Control VS_FILLCOLOR
+ {
+ HelpID = HID_PROPERTYPANEL_FILL_COLOR_VS;
+ Hide = TRUE ;
+ Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
+ Size = MAP_APPFONT ( POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2);
+ TabStop = TRUE ;
+ Text [ en-US ] = "Color";
+ };
+
+ String VS_NOFILLCOLOR
+ {
+ Text [ en-US ] = "No Color" ;
+ };
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// line color popup
+
+Control RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR
+{
+ OutputSize = TRUE;
+ DialogControl = TRUE;
+ Border = FALSE;
+ Size = MAP_APPFONT( POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT );
+
+ Control VS_LINECOLOR
+ {
+ HelpID = HID_PROPERTYPANEL_LINE_COLOR_VS;
+ Hide = TRUE ;
+ Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
+ Size = MAP_APPFONT ( POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2);
+ TabStop = TRUE ;
+ Text [ en-US ] = "Color";
+ };
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// cell line style popup
+
+Control RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE
+{
+ OutputSize = TRUE;
+ DialogControl = TRUE;
+ Border = FALSE;
+
+ Size = MAP_APPFONT(
+ POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + 80,
+ 13 + POPUP_BORDER_HEIGHT + POPUPPANEL_MARGIN_SMALL * 2 + POPUPPANEL_MARGIN_LARGE + 12*9);
+
+ Control VS_STYLE
+ {
+ HelpID = HID_PROPERTYPANEL_SC_STYLE_VS ;
+ Hide = TRUE ;
+ Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X , POPUPPANEL_MARGIN_SMALL + OFFSET_Y );
+ Size = MAP_APPFONT ( 80 , 12 * 9);
+ TabStop = TRUE ;
+ Text [ en-US ] = "Line Style";
+ };
+ PushButton PB_OPTIONS
+ {
+ HelpID = HID_PROPERTYPANEL_SC_STYLE_PB;
+ Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_LARGE + OFFSET_X , POPUPPANEL_MARGIN_SMALL * 2 + OFFSET_Y + 12 * 9);
+ Size = MAP_APPFONT ( 75 , 12 );
+ TabStop = TRUE;
+ Text [ en-US ] = "~More Options...";
+ };
+ Bitmap BMP_UNDERLINE_MORE
+ {
+ File = "sidebar/morebutton.png";
+ };
+ Bitmap BMP_UNDERLINE_MORE_H
+ {
+ File = "sidebar/morebutton_h.png";
+ };
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// cell border style popup
+
+Control RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE
+{
+ OutputSize = TRUE;
+ DialogControl = TRUE;
+ Border = FALSE;
+
+ Size = MAP_PIXEL( POPUPPANEL_MARGIN_SMALL_PIXEL * 2 + 108, POPUPPANEL_MARGIN_SMALL_PIXEL * 2 + 138);
+
+ ToolBox TB_BORDER1
+ {
+ SVLook = TRUE ;
+ Pos = MAP_PIXEL(POPUPPANEL_MARGIN_SMALL_PIXEL, POPUPPANEL_MARGIN_SMALL_PIXEL); //MAP_APPFONT (POPUPPANEL_MARGIN_SMALL + OFFSET_X + 1, POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 1) ;
+ Size = MAP_PIXEL(TOOLBOX_BORDER_WIDTH, 31); //MAP_APPFONT (TOOLBOX_BORDER_WIDTH ,20) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER1_TBX;
+ Text [ en-US ] = "Cell Border 1";
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER1_NONE ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_NONE;
+ Text [ en-US ] = "No Border" ;
+ };
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER1_ALL ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_ALL;
+ Text [ en-US ] = "All Borders" ;
+ };
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER1_OUTER ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_OUTER;
+ Text [ en-US ] = "Outside Borders" ;
+ };
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER1_OUTERBOLD ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_OUTERBOLD;
+ Text [ en-US ] = "Thick Box Border" ;
+ };
+ };
+ };
+ FixedLine FL_1
+ {
+ Pos = MAP_PIXEL(POPUPPANEL_MARGIN_SMALL_PIXEL, POPUPPANEL_MARGIN_SMALL_PIXEL + 31); //MAP_APPFONT ( POPUPPANEL_MARGIN_SMALL + OFFSET_X + 1 , POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 20 + 1) ;
+ Size = MAP_PIXEL(TOOLBOX_BORDER_WIDTH, 8); // MAP_APPFONT ( TOOLBOX_BORDER_WIDTH , 5 ) ;
+ };
+ ToolBox TB_BORDER2
+ {
+ SVLook = TRUE ;
+ Pos = MAP_PIXEL(POPUPPANEL_MARGIN_SMALL_PIXEL, POPUPPANEL_MARGIN_SMALL_PIXEL + 31 + 8); // MAP_APPFONT (POPUPPANEL_MARGIN_SMALL + OFFSET_X + 1, POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 20 + 5 + 1) ;
+ Size = MAP_PIXEL (TOOLBOX_BORDER_WIDTH ,61) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER2_TBX;
+ Text [ en-US ] = "Cell Border 2";
+ };
+ FixedLine FL_2
+ {
+ Pos = MAP_PIXEL(POPUPPANEL_MARGIN_SMALL_PIXEL, POPUPPANEL_MARGIN_SMALL_PIXEL + 31 + 8 + 61); // MAP_APPFONT ( POPUPPANEL_MARGIN_SMALL + OFFSET_X + 1 , POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 20 + 38 + 5 + 1) ;
+ Size = MAP_PIXEL ( TOOLBOX_BORDER_WIDTH , 8 ) ;
+ };
+ ToolBox TB_BORDER3
+ {
+ SVLook = TRUE ;
+ Pos = MAP_PIXEL(POPUPPANEL_MARGIN_SMALL_PIXEL, POPUPPANEL_MARGIN_SMALL_PIXEL + 31 +8 + 61 + 8); // MAP_APPFONT (POPUPPANEL_MARGIN_SMALL + OFFSET_X + 1, POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 20 + 38 + 10 + 1) ;
+ Size = MAP_PIXEL (TOOLBOX_BORDER_WIDTH ,31) ;
+ TabStop = TRUE ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER3_TBX;
+ Text [ en-US ] = "Cell Border 3";
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER3_S1;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_S1;
+ Text [ en-US ] = "Thick Bottom Border" ;
+ };
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER3_S2 ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_S2;
+ Text [ en-US ] = "Double Bottom Border" ;
+ };
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER3_S3 ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_S3;
+ Text [ en-US ] = "Top and Thick Bottom Borders" ;
+ };
+ ToolBoxItem
+ {
+ Identifier = TBI_BORDER3_S4 ;
+ HelpID = HID_PROPERTYPANEL_SC_BORDER_TBI_S4;
+ Text [ en-US ] = "Top and Double Bottom Borders" ;
+ };
+ };
+ };
+
+ Image IMG_BORDER1
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Empty_18x18.png";};
+ };
+ Image IMG_BORDER2
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_All_18x18.png";};
+ };
+ Image IMG_BORDER3
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_FourBorders_18x18.png";};
+ };
+ Image IMG_BORDER4
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_FourBorders_Thick_18x18.png";};
+ };
+ Image IMG_BORDER5
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Left_18x18.png";};
+ };
+ Image IMG_BORDER6
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Right_18x18.png";};
+ };
+ Image IMG_BORDER7
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Top_18x18.png";};
+ };
+ Image IMG_BORDER8
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Bottom_18x18.png";};
+ };
+ Image IMG_BORDER9
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_RightDiagonal_18x18.png";};
+ };
+ Image IMG_BORDER10
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_LeftDiagonal_18x18.png";};
+ };
+ Image IMG_BORDER11
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_TopAndBottom_18x18.png";};
+ };
+ Image IMG_BORDER12
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_LeftAndRight_18x18.png";};
+ };
+ Image IMG_BORDER13
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Bottom_Thick_18x18.png";};
+ };
+ Image IMG_BORDER14
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Bottom_Double_18x18.png";};
+ };
+ Image IMG_BORDER15
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_TopThin_BottomThick_18x18.png";};
+ };
+ Image IMG_BORDER16
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_TopSingle_BottomDouble_18x18.png";};
+ };
+ String STR_BORDER_1
+ {
+ Text [ en-US ] = "Left Border";
+ };
+ String STR_BORDER_2
+ {
+ Text [ en-US ] = "Right Border";
+ };
+ String STR_BORDER_3
+ {
+ Text [ en-US ] = "Top Border";
+ };
+ String STR_BORDER_4
+ {
+ Text [ en-US ] = "Bottom Border";
+ };
+ String STR_BORDER_5
+ {
+ Text [ en-US ] = "Diagonal Up Border";
+ };
+ String STR_BORDER_6
+ {
+ Text [ en-US ] = "Diagonal Down Border";
+ };
+ String STR_BORDER_7
+ {
+ Text [ en-US ] = "Top and Bottom Borders";
+ };
+ String STR_BORDER_8
+ {
+ Text [ en-US ] = "Left and Right Borders";
+ };
+
+ //high contrast
+ Image IMG_BORDER1_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Empty_18x18_h.png";};
+ };
+ Image IMG_BORDER2_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_All_18x18_h.png";};
+ };
+ Image IMG_BORDER3_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_FourBorders_18x18_h.png";};
+ };
+ Image IMG_BORDER4_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_FourBorders_Thick_18x18_h.png";};
+ };
+ Image IMG_BORDER5_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Left_18x18_h.png";};
+ };
+ Image IMG_BORDER6_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Right_18x18_h.png";};
+ };
+ Image IMG_BORDER7_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Top_18x18_h.png";};
+ };
+ Image IMG_BORDER8_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Bottom_18x18_h.png";};
+ };
+ Image IMG_BORDER9_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_RightDiagonal_18x18_h.png";};
+ };
+ Image IMG_BORDER10_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_LeftDiagonal_18x18_h.png";};
+ };
+ Image IMG_BORDER11_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_TopAndBottom_18x18_h.png";};
+ };
+ Image IMG_BORDER12_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_LeftAndRight_18x18_h.png";};
+ };
+ Image IMG_BORDER13_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Bottom_Thick_18x18_h.png";};
+ };
+ Image IMG_BORDER14_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_Bottom_Double_18x18_h.png";};
+ };
+ Image IMG_BORDER15_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_TopThin_BottomThick_18x18_h.png";};
+ };
+ Image IMG_BORDER16_H
+ {
+ ImageBitmap = Bitmap{File = "sidebar/CellBorder_TopSingle_BottomDouble_18x18_h.png";};
+ };
+};
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellAppearancePropertyPanel.src
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.cxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.cxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.cxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,364 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sc.hxx"
+
+#include <CellBorderStyleControl.hxx>
+#include "sc.hrc"
+#include "scresid.hxx"
+#include <CellAppearancePropertyPanel.hrc>
+#include <editeng/boxitem.hxx>
+#include <editeng/bolnitem.hxx>
+#include <CellAppearancePropertyPanel.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <vcl/svapp.hxx>
+
+namespace sc { namespace sidebar {
+
+#define FRM_VALID_LEFT 0x01
+#define FRM_VALID_RIGHT 0x02
+#define FRM_VALID_TOP 0x04
+#define FRM_VALID_BOTTOM 0x08
+#define FRM_VALID_HINNER 0x10
+#define FRM_VALID_VINNER 0x20
+#define FRM_VALID_OUTER 0x0f
+#define FRM_VALID_ALL 0xff
+
+CellBorderStyleControl::CellBorderStyleControl(Window* pParent, CellAppearancePropertyPanel& rPanel)
+: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE)),
+ mrCellAppearancePropertyPanel(rPanel),
+ maTBBorder1(this, ScResId(TB_BORDER1)),
+ maTBBorder2(this, ScResId(TB_BORDER2)),
+ maTBBorder3(this, ScResId(TB_BORDER3)),
+ maFL1(this, ScResId(FL_1)),
+ maFL2(this, ScResId(FL_2)),
+ mpImageList(0),
+ mpImageListH(0)
+{
+ Initialize();
+ FreeResource();
+}
+
+CellBorderStyleControl::~CellBorderStyleControl(void)
+{
+ delete[] mpImageList;
+ delete[] mpImageListH;
+}
+
+void CellBorderStyleControl::Initialize()
+{
+ mpImageList = new Image[16];
+ mpImageList[0] = Image(ScResId(IMG_BORDER1));
+ mpImageList[1] = Image(ScResId(IMG_BORDER2));
+ mpImageList[2] = Image(ScResId(IMG_BORDER3));
+ mpImageList[3] = Image(ScResId(IMG_BORDER4));
+ mpImageList[4] = Image(ScResId(IMG_BORDER5));
+ mpImageList[5] = Image(ScResId(IMG_BORDER6));
+ mpImageList[6] = Image(ScResId(IMG_BORDER7));
+ mpImageList[7] = Image(ScResId(IMG_BORDER8));
+ mpImageList[8] = Image(ScResId(IMG_BORDER9));
+ mpImageList[9] = Image(ScResId(IMG_BORDER10));
+ mpImageList[10] = Image(ScResId(IMG_BORDER11));
+ mpImageList[11] = Image(ScResId(IMG_BORDER12));
+ mpImageList[12] = Image(ScResId(IMG_BORDER13));
+ mpImageList[13] = Image(ScResId(IMG_BORDER14));
+ mpImageList[14] = Image(ScResId(IMG_BORDER15));
+ mpImageList[15] = Image(ScResId(IMG_BORDER16));
+
+ //high contrast
+ mpImageListH = new Image[16];
+ mpImageListH[0] = Image(ScResId(IMG_BORDER1_H));
+ mpImageListH[1] = Image(ScResId(IMG_BORDER2_H));
+ mpImageListH[2] = Image(ScResId(IMG_BORDER3_H));
+ mpImageListH[3] = Image(ScResId(IMG_BORDER4_H));
+ mpImageListH[4] = Image(ScResId(IMG_BORDER5_H));
+ mpImageListH[5] = Image(ScResId(IMG_BORDER6_H));
+ mpImageListH[6] = Image(ScResId(IMG_BORDER7_H));
+ mpImageListH[7] = Image(ScResId(IMG_BORDER8_H));
+ mpImageListH[8] = Image(ScResId(IMG_BORDER9_H));
+ mpImageListH[9] = Image(ScResId(IMG_BORDER10_H));
+ mpImageListH[10] = Image(ScResId(IMG_BORDER11_H));
+ mpImageListH[11] = Image(ScResId(IMG_BORDER12_H));
+ mpImageListH[12] = Image(ScResId(IMG_BORDER13_H));
+ mpImageListH[13] = Image(ScResId(IMG_BORDER14_H));
+ mpImageListH[14] = Image(ScResId(IMG_BORDER15_H));
+ mpImageListH[15] = Image(ScResId(IMG_BORDER16_H));
+
+ maTBBorder1.SetItemImage(TBI_BORDER1_NONE, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[0] : mpImageList[0]);
+ maTBBorder1.SetItemImage(TBI_BORDER1_ALL, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[1] : mpImageList[1]);
+ maTBBorder1.SetItemImage(TBI_BORDER1_OUTER, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[2] : mpImageList[2]);
+ maTBBorder1.SetItemImage(TBI_BORDER1_OUTERBOLD, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[3] : mpImageList[3]);
+ maTBBorder1.SetBackground(Wallpaper());
+ maTBBorder1.SetPaintTransparent(true);
+ Size aTbxSize( maTBBorder1.CalcWindowSizePixel() );
+ maTBBorder1.SetOutputSizePixel( aTbxSize );
+ Link aLink = LINK(this, CellBorderStyleControl, TB1SelectHdl);
+ maTBBorder1.SetSelectHdl ( aLink );
+
+ maTBBorder2.SetLineCount(2);
+ maTBBorder2.InsertItem(TBI_BORDER2_LEFT, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[4] : mpImageList[4]);
+ maTBBorder2.InsertItem(TBI_BORDER2_RIGHT, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[5] : mpImageList[5]);
+ maTBBorder2.InsertItem(TBI_BORDER2_TOP, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[6] : mpImageList[6]);
+ maTBBorder2.InsertItem(TBI_BORDER2_BOT, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[7] : mpImageList[7]);
+ maTBBorder2.InsertBreak();
+ maTBBorder2.InsertItem(TBI_BORDER2_BLTR, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[8] : mpImageList[8]);
+ maTBBorder2.InsertItem(TBI_BORDER2_TLBR, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[9] : mpImageList[9]);
+ maTBBorder2.InsertItem(TBI_BORDER2_TOPBOT, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[10] : mpImageList[10]);
+ maTBBorder2.InsertItem(TBI_BORDER2_LEFTRIGHT, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[11] : mpImageList[11]);
+ maTBBorder2.SetBackground(Wallpaper());
+ maTBBorder2.SetPaintTransparent(true);
+ aTbxSize = maTBBorder2.CalcWindowSizePixel() ;
+ maTBBorder2.SetOutputSizePixel( aTbxSize );
+ maTBBorder2.SetHelpId(TBI_BORDER2_LEFT, HID_PROPERTYPANEL_SC_BORDER_TBI_LEFT);
+ maTBBorder2.SetHelpId(TBI_BORDER2_RIGHT, HID_PROPERTYPANEL_SC_BORDER_TBI_RIGHT);
+ maTBBorder2.SetHelpId(TBI_BORDER2_TOP, HID_PROPERTYPANEL_SC_BORDER_TBI_TOP);
+ maTBBorder2.SetHelpId(TBI_BORDER2_BOT, HID_PROPERTYPANEL_SC_BORDER_TBI_BOT);
+ maTBBorder2.SetHelpId(TBI_BORDER2_BLTR, HID_PROPERTYPANEL_SC_BORDER_TBI_BLTR);
+ maTBBorder2.SetHelpId(TBI_BORDER2_TLBR, HID_PROPERTYPANEL_SC_BORDER_TBI_TLBR);
+ maTBBorder2.SetHelpId(TBI_BORDER2_TOPBOT, HID_PROPERTYPANEL_SC_BORDER_TBI_TOPBOT);
+ maTBBorder2.SetHelpId(TBI_BORDER2_LEFTRIGHT, HID_PROPERTYPANEL_SC_BORDER_TBI_LEFTRIGHT);
+ maTBBorder2.SetItemText(TBI_BORDER2_LEFT, ScResId(STR_BORDER_1));
+ maTBBorder2.SetItemText(TBI_BORDER2_RIGHT, ScResId(STR_BORDER_2));
+ maTBBorder2.SetItemText(TBI_BORDER2_TOP, ScResId(STR_BORDER_3));
+ maTBBorder2.SetItemText(TBI_BORDER2_BOT, ScResId(STR_BORDER_4));
+ maTBBorder2.SetItemText(TBI_BORDER2_BLTR, ScResId(STR_BORDER_5));
+ maTBBorder2.SetItemText(TBI_BORDER2_TLBR, ScResId(STR_BORDER_6));
+ maTBBorder2.SetItemText(TBI_BORDER2_TOPBOT, ScResId(STR_BORDER_7));
+ maTBBorder2.SetItemText(TBI_BORDER2_LEFTRIGHT, ScResId(STR_BORDER_8));
+ aLink = LINK(this, CellBorderStyleControl, TB2SelectHdl);
+ maTBBorder2.SetSelectHdl ( aLink );
+
+ maTBBorder3.SetItemImage(TBI_BORDER3_S1, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[12] : mpImageList[12]);
+ maTBBorder3.SetItemImage(TBI_BORDER3_S2, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[13] : mpImageList[13]);
+ maTBBorder3.SetItemImage(TBI_BORDER3_S3, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[14] : mpImageList[14]);
+ maTBBorder3.SetItemImage(TBI_BORDER3_S4, GetDisplayBackground().GetColor().IsDark() ? mpImageListH[15] : mpImageList[15]);
+ maTBBorder3.SetBackground(Wallpaper());
+ maTBBorder3.SetPaintTransparent(true);
+ aTbxSize = maTBBorder3.CalcWindowSizePixel() ;
+ maTBBorder3.SetOutputSizePixel( aTbxSize );
+ aLink = LINK(this, CellBorderStyleControl, TB3SelectHdl);
+ maTBBorder3.SetSelectHdl ( aLink );
+}
+
+IMPL_LINK(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox)
+{
+ sal_uInt16 nId = pToolBox->GetCurItemId();
+ ::Color aColBlack( COL_BLACK );
+ SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
+ SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER );
+ SvxBorderLine theDefLine(NULL,1, 0, 0);
+ SvxBorderLine *pLeft = 0, *pRight = 0, *pTop = 0, *pBottom = 0;
+ sal_uInt8 nValidFlags = 0;
+ switch ( nId )
+ {
+ case TBI_BORDER1_NONE:
+ {
+ nValidFlags |= FRM_VALID_ALL;
+ SvxLineItem aLineItem1( SID_ATTR_BORDER_DIAG_BLTR );
+ SvxLineItem aLineItem2( SID_ATTR_BORDER_DIAG_TLBR );
+ aLineItem1.SetLine( NULL ); //modify
+ aLineItem2.SetLine( NULL ); //modify
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_BLTR, SFX_CALLMODE_RECORD, &aLineItem1, 0L);
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_TLBR, SFX_CALLMODE_RECORD, &aLineItem2, 0L);
+ }
+ break;
+ case TBI_BORDER1_ALL:
+ pLeft = pRight = pTop = pBottom = &theDefLine;
+ aBorderInner.SetLine( &theDefLine, BOXINFO_LINE_HORI );
+ aBorderInner.SetLine( &theDefLine, BOXINFO_LINE_VERT );
+ nValidFlags |= FRM_VALID_ALL;
+ break;
+ case TBI_BORDER1_OUTER:
+ pLeft = pRight = pTop = pBottom = &theDefLine;
+ nValidFlags |= FRM_VALID_OUTER;
+ break;
+ case TBI_BORDER1_OUTERBOLD:
+ theDefLine.SetOutWidth(DEF_LINE_WIDTH_2);
+ pLeft = pRight = pTop = pBottom = &theDefLine;
+ nValidFlags |= FRM_VALID_OUTER;
+ break;
+ }
+
+ aBorderOuter.SetLine( pLeft, BOX_LINE_LEFT );
+ aBorderOuter.SetLine( pRight, BOX_LINE_RIGHT );
+ aBorderOuter.SetLine( pTop, BOX_LINE_TOP );
+ aBorderOuter.SetLine( pBottom, BOX_LINE_BOTTOM );
+
+ aBorderInner.SetValid( VALID_TOP, 0 != (nValidFlags&FRM_VALID_TOP ));
+ aBorderInner.SetValid( VALID_BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM ));
+ aBorderInner.SetValid( VALID_LEFT, 0 != (nValidFlags&FRM_VALID_LEFT));
+ aBorderInner.SetValid( VALID_RIGHT, 0 != (nValidFlags&FRM_VALID_RIGHT ));
+ aBorderInner.SetValid( VALID_HORI, 0 != (nValidFlags&FRM_VALID_HINNER ));
+ aBorderInner.SetValid( VALID_VERT, 0 != (nValidFlags&FRM_VALID_VINNER));
+ aBorderInner.SetValid( VALID_DISTANCE, true );
+ aBorderInner.SetValid( VALID_DISABLE, false );
+
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER, SFX_CALLMODE_RECORD, &aBorderOuter, &aBorderInner, 0L);
+ mrCellAppearancePropertyPanel.EndCellBorderStylePopupMode();
+ return 0;
+}
+
+IMPL_LINK(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox)
+{
+ sal_uInt16 nId = pToolBox->GetCurItemId();
+
+ if( nId != TBI_BORDER2_BLTR && nId != TBI_BORDER2_TLBR )
+ {
+ ::Color aColBlack( COL_BLACK );
+ SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
+ SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER );
+ SvxBorderLine theDefLine(NULL, 1, 0, 0);
+ SvxBorderLine *pLeft = 0,
+ *pRight = 0,
+ *pTop = 0,
+ *pBottom = 0;
+ sal_uInt8 nValidFlags = 0;
+ switch ( nId )
+ {
+ case TBI_BORDER2_LEFT:
+ pLeft = &theDefLine;
+ nValidFlags |= FRM_VALID_LEFT;
+ break;
+ case TBI_BORDER2_RIGHT:
+ //
+ if(!Application::GetSettings().GetLayoutRTL())
+ {
+ pRight = &theDefLine;
+ nValidFlags |= FRM_VALID_RIGHT;
+ }
+ else
+ {
+ pLeft = &theDefLine;
+ nValidFlags |= FRM_VALID_LEFT;
+ }
+ break;
+ case TBI_BORDER2_TOP:
+ pTop = &theDefLine;
+ nValidFlags |= FRM_VALID_TOP;
+ break;
+ case TBI_BORDER2_BOT:
+ pBottom = &theDefLine;
+ nValidFlags |= FRM_VALID_BOTTOM;
+ break;
+ case TBI_BORDER2_TOPBOT:
+ pTop = pBottom = &theDefLine;
+ nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
+ break;
+ case TBI_BORDER2_LEFTRIGHT:
+ pLeft = pRight = &theDefLine;
+ nValidFlags |= FRM_VALID_RIGHT|FRM_VALID_LEFT;
+ break;
+ }
+ aBorderOuter.SetLine( pLeft, BOX_LINE_LEFT );
+ aBorderOuter.SetLine( pRight, BOX_LINE_RIGHT );
+ aBorderOuter.SetLine( pTop, BOX_LINE_TOP );
+ aBorderOuter.SetLine( pBottom, BOX_LINE_BOTTOM );
+
+ aBorderInner.SetValid( VALID_TOP, 0 != (nValidFlags&FRM_VALID_TOP ));
+ aBorderInner.SetValid( VALID_BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM ));
+ aBorderInner.SetValid( VALID_LEFT, 0 != (nValidFlags&FRM_VALID_LEFT));
+ aBorderInner.SetValid( VALID_RIGHT, 0 != (nValidFlags&FRM_VALID_RIGHT ));
+ aBorderInner.SetValid( VALID_HORI, 0 != (nValidFlags&FRM_VALID_HINNER ));
+ aBorderInner.SetValid( VALID_VERT, 0 != (nValidFlags&FRM_VALID_VINNER));
+ aBorderInner.SetValid( VALID_DISTANCE, true );
+ aBorderInner.SetValid( VALID_DISABLE, false );
+
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER, SFX_CALLMODE_RECORD, &aBorderOuter, &aBorderInner, 0L);
+ }
+ else if(nId == TBI_BORDER2_BLTR)
+ {
+ SvxBorderLine aTmp( NULL, 1, 0, 0 );
+ SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_BLTR );
+ aLineItem.SetLine( &aTmp );
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_BLTR, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ }
+ else if(nId == TBI_BORDER2_TLBR)
+ {
+ SvxBorderLine aTmp( NULL, 1, 0, 0 );
+ SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_TLBR );
+ aLineItem.SetLine( &aTmp );
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER_DIAG_TLBR, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ }
+
+ mrCellAppearancePropertyPanel.EndCellBorderStylePopupMode();
+ return 0;
+}
+
+IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
+{
+ sal_uInt16 nId = pToolBox->GetCurItemId();
+
+ ::Color aColBlack( COL_BLACK );
+ SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
+ SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER );
+ SvxBorderLine *pTop = 0 ,
+ *pBottom = 0 ;
+ sal_uInt8 nValidFlags = 0;
+
+ switch ( nId )
+ {
+ case TBI_BORDER3_S1:
+ pBottom = new SvxBorderLine(NULL, DEF_LINE_WIDTH_2, 0, 0);
+ nValidFlags |= FRM_VALID_BOTTOM;
+ break;
+ case TBI_BORDER3_S2:
+ pBottom = new SvxBorderLine(NULL, DEF_DOUBLE_LINE0_OUT, DEF_DOUBLE_LINE0_IN, DEF_DOUBLE_LINE0_DIST);
+ nValidFlags |= FRM_VALID_BOTTOM;
+ break;
+ case TBI_BORDER3_S3:
+ pBottom = new SvxBorderLine(NULL, DEF_LINE_WIDTH_2, 0, 0);
+ pTop = new SvxBorderLine(NULL, 1, 0, 0);
+ nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
+ break;
+ case TBI_BORDER3_S4:
+ pBottom = new SvxBorderLine(NULL, DEF_DOUBLE_LINE0_OUT, DEF_DOUBLE_LINE0_IN, DEF_DOUBLE_LINE0_DIST);
+ pTop = new SvxBorderLine(NULL, 1, 0, 0);
+ nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
+ break;
+ }
+
+ aBorderOuter.SetLine( pTop, BOX_LINE_TOP );
+ aBorderOuter.SetLine( pBottom, BOX_LINE_BOTTOM );
+ aBorderOuter.SetLine( NULL, BOX_LINE_LEFT );
+ aBorderOuter.SetLine( NULL, BOX_LINE_RIGHT );
+
+ aBorderInner.SetValid( VALID_TOP, 0 != (nValidFlags&FRM_VALID_TOP ));
+ aBorderInner.SetValid( VALID_BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM ));
+ aBorderInner.SetValid( VALID_LEFT, 0 != (nValidFlags&FRM_VALID_LEFT ));
+ aBorderInner.SetValid( VALID_RIGHT, 0 != (nValidFlags&FRM_VALID_RIGHT ));
+ aBorderInner.SetValid( VALID_HORI, 0 != (nValidFlags&FRM_VALID_HINNER ));
+ aBorderInner.SetValid( VALID_VERT, 0 != (nValidFlags&FRM_VALID_VINNER));
+ aBorderInner.SetValid( VALID_DISTANCE, true );
+ aBorderInner.SetValid( VALID_DISABLE, false );
+
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_ATTR_BORDER, SFX_CALLMODE_RECORD, &aBorderOuter, &aBorderInner, 0L);
+
+ delete pTop;
+ delete pBottom;
+
+ mrCellAppearancePropertyPanel.EndCellBorderStylePopupMode();
+ return 0;
+}
+
+} } // end of namespace svx::sidebar
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,61 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef SC_SIDEBAR_CELL_BORDER_STYLE_CONTROL_HXX
+#define SC_SIDEBAR_CELL_BORDER_STYLE_CONTROL_HXX
+
+#include <svx/sidebar/PopupControl.hxx>
+#include <vcl/button.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/fixed.hxx>
+
+namespace sc { namespace sidebar {
+
+class CellAppearancePropertyPanel;
+
+class CellBorderStyleControl : public svx::sidebar::PopupControl
+{
+private:
+ CellAppearancePropertyPanel& mrCellAppearancePropertyPanel;
+ ToolBox maTBBorder1;
+ ToolBox maTBBorder2;
+ ToolBox maTBBorder3;
+ FixedLine maFL1;
+ FixedLine maFL2;
+ Image* mpImageList;
+ Image* mpImageListH; //high contrast
+
+ void Initialize();
+
+ DECL_LINK(TB1SelectHdl, ToolBox *);
+ DECL_LINK(TB2SelectHdl, ToolBox *);
+ DECL_LINK(TB3SelectHdl, ToolBox *);
+
+public:
+ CellBorderStyleControl(Window* pParent, CellAppearancePropertyPanel& rPanel);
+ virtual ~CellBorderStyleControl(void);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif // SC_SIDEBAR_CELL_BORDER_STYLE_CONTROL_HXX
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStyleControl.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.cxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.cxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.cxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,42 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sc.hxx"
+
+#include "CellBorderStylePopup.hxx"
+#include "CellLineStyleControl.hxx"
+
+namespace sc { namespace sidebar {
+
+CellBorderStylePopup::CellBorderStylePopup (
+ Window* pParent,
+ const ::boost::function<svx::sidebar::PopupControl*(svx::sidebar::PopupContainer*)>& rControlCreator)
+: Popup(pParent, rControlCreator, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellBorderStyle")))
+{
+}
+
+CellBorderStylePopup::~CellBorderStylePopup (void)
+{
+}
+
+} } // end of namespace sc::sidebar
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,43 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _SC_SIDEBAR_CELL_BORDER_STYLE_POPUP_HXX_
+#define _SC_SIDEBAR_CELL_BORDER_STYLE_POPUP_HXX_
+
+#include <svx/sidebar/Popup.hxx>
+#include <boost/function.hpp>
+
+namespace sc { namespace sidebar {
+
+class CellBorderStylePopup : public svx::sidebar::Popup
+{
+public :
+ CellBorderStylePopup(
+ Window* pParent,
+ const ::boost::function<svx::sidebar::PopupControl*(svx::sidebar::PopupContainer*)>& rControlCreator);
+ virtual ~CellBorderStylePopup(void);
+};
+
+} } // end of namespace sc::sidebar
+
+#endif // _SC_SIDEBAR_CELL_BORDER_STYLE_POPUP_HXX_
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderStylePopup.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.cxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.cxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.cxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,127 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sc.hxx"
+
+#include <CellBorderUpdater.hxx>
+#include <vcl/bmpacc.hxx>
+#include <vcl/svapp.hxx>
+
+namespace sc { namespace sidebar {
+
+CellBorderUpdater::CellBorderUpdater(
+ sal_uInt16 nTbxBtnId,
+ ToolBox& rTbx)
+: mnBtnId(nTbxBtnId),
+ mrTbx(rTbx)
+{
+}
+
+CellBorderUpdater::~CellBorderUpdater()
+{
+}
+
+void CellBorderUpdater::UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight, Image aImg, bool bVer, bool bHor)
+{
+ BitmapEx aBmpEx( aImg.GetBitmapEx() );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+ BitmapWriteAccess* pBmpAcc = aBmp.AcquireWriteAccess();
+ const Size maBmpSize = aBmp.GetSizePixel();
+
+ if( pBmpAcc )
+ {
+ Bitmap aMsk;
+ BitmapWriteAccess* pMskAcc;
+
+ if( aBmpEx.IsAlpha() )
+ pMskAcc = ( aMsk = aBmpEx.GetAlpha().GetBitmap() ).AcquireWriteAccess();
+ else if( aBmpEx.IsTransparent() )
+ pMskAcc = ( aMsk = aBmpEx.GetMask() ).AcquireWriteAccess();
+ else
+ pMskAcc = NULL;
+
+ pBmpAcc->SetLineColor( ::Application::GetSettings().GetStyleSettings().GetFieldTextColor() ) ;
+ pBmpAcc->SetFillColor( COL_BLACK);
+
+ if(maBmpSize.Width() == 43 && maBmpSize.Height() == 43)
+ {
+ 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);
+ if( pMskAcc )
+ {
+ pMskAcc->SetLineColor( COL_BLACK );
+ pMskAcc->SetFillColor( COL_BLACK );
+ }
+ if(bLeft)
+ {
+ pBmpAcc->DrawLine( aTL,aBL );
+ if( pMskAcc )
+ pMskAcc->DrawLine( aTL,aBL );
+ }
+ if(bRight)
+ {
+ pBmpAcc->DrawLine( aTR,aBR );
+ if( pMskAcc )
+ pMskAcc->DrawLine( aTR,aBR );
+ }
+ if(bTop)
+ {
+ pBmpAcc->DrawLine( aTL,aTR );
+ if( pMskAcc )
+ pMskAcc->DrawLine( aTL,aTR );
+ }
+ if(bBot)
+ {
+ pBmpAcc->DrawLine( aBL,aBR );
+ if( pMskAcc )
+ pMskAcc->DrawLine( aBL,aBR );
+ }
+ if(bVer)
+ {
+ pBmpAcc->DrawLine( aVT,aVB );
+ if( pMskAcc )
+ pMskAcc->DrawLine( aVT,aVB );
+ }
+ if(bHor)
+ {
+ pBmpAcc->DrawLine( aHL,aHR );
+ if( pMskAcc )
+ pMskAcc->DrawLine( aHL,aHR );
+ }
+ }
+
+ aBmp.ReleaseAccess( pBmpAcc );
+ if( pMskAcc )
+ aMsk.ReleaseAccess( pMskAcc );
+
+ if( aBmpEx.IsAlpha() )
+ aBmpEx = BitmapEx( aBmp, AlphaMask( aMsk ) );
+ else if( aBmpEx.IsTransparent() )
+ aBmpEx = BitmapEx( aBmp, aMsk );
+ else
+ aBmpEx = aBmp;
+
+ mrTbx.SetItemImage( mnBtnId, Image( aBmpEx ) );
+ }
+}
+
+} } // end of namespace svx::sidebar
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,46 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef SC_SIDEBAR_CELL_BORDER_UPDATER_HXX
+#define SC_SIDEBAR_CELL_BORDER_UPDATER_HXX
+
+#include <vcl/toolbox.hxx>
+
+namespace sc { namespace sidebar {
+
+class CellBorderUpdater
+{
+private:
+ sal_uInt16 mnBtnId;
+ ToolBox& mrTbx;
+
+public:
+ CellBorderUpdater(sal_uInt16 nTbxBtnId, ToolBox& rTbx);
+ ~CellBorderUpdater();
+
+ void UpdateCellBorder(bool bTop, bool bBot, bool bLeft, bool bRight, Image aImg, bool bVer, bool bHor);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif // SC_SIDEBAR_CELL_BORDER_UPDATER_HXX
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellBorderUpdater.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.cxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.cxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.cxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,259 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sc.hxx"
+
+#include <CellLineStyleControl.hxx>
+#include "sc.hrc"
+#include "scresid.hxx"
+#include <CellAppearancePropertyPanel.hrc>
+#include <CellLineStyleValueSet.hxx>
+#include <vcl/i18nhelp.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/bolnitem.hxx>
+#include <CellAppearancePropertyPanel.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+
+namespace sc { namespace sidebar {
+
+CellLineStyleControl::CellLineStyleControl(Window* pParent, CellAppearancePropertyPanel& rPanel)
+: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE)),
+ mrCellAppearancePropertyPanel(rPanel),
+ maPushButtonMoreOptions(this, ScResId(PB_OPTIONS)),
+ maCellLineStyleValueSet(this, ScResId(VS_STYLE)),
+ mpStr(0),
+ mbVSfocus(true)
+{
+ Initialize();
+ FreeResource();
+}
+
+CellLineStyleControl::~CellLineStyleControl(void)
+{
+ delete[] mpStr;
+}
+
+void CellLineStyleControl::Initialize()
+{
+ //if(!GetSettings().GetStyleSettings().GetHighContrastMode())
+ //{
+ // maPushButtonMoreOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetPopupPanelBackgroundColor());//Color(244,245,249)
+ // maPushButtonMoreOptions.SetHoverBkColor(GetSettings().GetStyleSettings().GetCustButtonHoverColor());//Color( 93, 120, 163 )
+ // maPushButtonMoreOptions.SetHoverTxtColor(GetSettings().GetStyleSettings().GetCustButtonTextHoverColor());//Color( 255, 255, 255 )
+ //}
+ //else
+ //{
+ // maPushButtonMoreOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetMenuColor());//Color(244,245,249)
+ // maPushButtonMoreOptions.SetHoverBkColor(GetSettings().GetStyleSettings().GetMenuColor());//Color( 93, 120, 163 )
+ // maPushButtonMoreOptions.SetHoverTxtColor(GetSettings().GetStyleSettings().GetCustButtonTextHoverColor());//Color( 255, 255, 255 )
+ //}
+
+ //maPushButtonMoreOptions.SetIcoPosX(2);
+ Link aLink = LINK(this, CellLineStyleControl, PBClickHdl);
+ maPushButtonMoreOptions.SetClickHdl(aLink);
+
+ maCellLineStyleValueSet.SetStyle(maCellLineStyleValueSet.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT);
+ maCellLineStyleValueSet.SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
+ maCellLineStyleValueSet.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+
+ for(sal_uInt16 i = 1 ; i <= 9 ; i++)
+ {
+ maCellLineStyleValueSet.InsertItem(i);
+ }
+
+ mpStr = new XubString[9];
+ mpStr[0] = GetSettings().GetLocaleI18nHelper().GetNum( 5, 2 ).AppendAscii("pt");
+ mpStr[1] = GetSettings().GetLocaleI18nHelper().GetNum( 250, 2 ).AppendAscii("pt");
+ mpStr[2] = GetSettings().GetLocaleI18nHelper().GetNum( 400, 2 ).AppendAscii("pt");
+ mpStr[3] = GetSettings().GetLocaleI18nHelper().GetNum( 500, 2 ).AppendAscii("pt");
+ mpStr[4] = GetSettings().GetLocaleI18nHelper().GetNum( 110, 2 ).AppendAscii("pt");
+ mpStr[5] = GetSettings().GetLocaleI18nHelper().GetNum( 260, 2 ).AppendAscii("pt");
+ mpStr[6] = GetSettings().GetLocaleI18nHelper().GetNum( 450, 2 ).AppendAscii("pt");
+ mpStr[7] = GetSettings().GetLocaleI18nHelper().GetNum( 505, 2 ).AppendAscii("pt");
+ mpStr[8] = GetSettings().GetLocaleI18nHelper().GetNum( 750, 2 ).AppendAscii("pt");
+ maCellLineStyleValueSet.SetUnit(mpStr);
+
+ for(sal_uInt16 i = 1 ; i <= 9 ; i++)
+ {
+ maCellLineStyleValueSet.SetItemText(i, mpStr[i-1]);
+ }
+
+ SetAllNoSel();
+ aLink = LINK(this, CellLineStyleControl, VSSelectHdl);
+ maCellLineStyleValueSet.SetSelectHdl(aLink);
+ maCellLineStyleValueSet.StartSelection();
+ maCellLineStyleValueSet.Show();
+}
+
+void CellLineStyleControl::GetFocus()
+{
+ if(!mbVSfocus)
+ {
+ maPushButtonMoreOptions.GrabFocus();
+ }
+ else
+ {
+ maCellLineStyleValueSet.GrabFocus();
+ }
+}
+
+void CellLineStyleControl::SetAllNoSel()
+{
+ maCellLineStyleValueSet.SelectItem(0);
+ maCellLineStyleValueSet.SetNoSelection();
+ maCellLineStyleValueSet.Format();
+ Invalidate();
+ maCellLineStyleValueSet.StartSelection();
+}
+
+IMPL_LINK(CellLineStyleControl, VSSelectHdl, void *, pControl)
+{
+ if(pControl == &maCellLineStyleValueSet)
+ {
+ const sal_uInt16 iPos(maCellLineStyleValueSet.GetSelectItemId());
+ SvxLineItem aLineItem(SID_FRAME_LINESTYLE);
+ sal_uInt16 n1 = 0;
+ sal_uInt16 n2 = 0;
+ sal_uInt16 n3 = 0;
+
+ switch(iPos)
+ {
+ case 1:
+ n1 = DEF_LINE_WIDTH_0;
+ break;
+ case 2:
+ n1 = DEF_LINE_WIDTH_2;
+ break;
+ case 3:
+ n1 = DEF_LINE_WIDTH_3;
+ break;
+ case 4:
+ n1 = DEF_LINE_WIDTH_4;
+ break;
+ case 5:
+ n1 = DEF_DOUBLE_LINE0_OUT;
+ n2 = DEF_DOUBLE_LINE0_IN;
+ n3 = DEF_DOUBLE_LINE0_DIST;
+ break;
+ case 6:
+ n1 = DEF_DOUBLE_LINE7_OUT;
+ n2 = DEF_DOUBLE_LINE7_IN;
+ n3 = DEF_DOUBLE_LINE7_DIST;
+ break;
+ case 7:
+ n1 = DEF_DOUBLE_LINE4_OUT;
+ n2 = DEF_DOUBLE_LINE4_IN;
+ n3 = DEF_DOUBLE_LINE4_DIST;
+ break;
+ case 8:
+ n1 = DEF_DOUBLE_LINE9_OUT;
+ n2 = DEF_DOUBLE_LINE9_IN;
+ n3 = DEF_DOUBLE_LINE9_DIST;
+ break;
+ case 9:
+ n1 = DEF_DOUBLE_LINE2_OUT;
+ n2 = DEF_DOUBLE_LINE2_IN;
+ n3 = DEF_DOUBLE_LINE2_DIST;
+ break;
+ default:
+ break;
+ }
+
+ SvxBorderLine aTmp( NULL, n1, n2, n3 );
+ aLineItem.SetLine( &aTmp );
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_FRAME_LINESTYLE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ SetAllNoSel();
+ mrCellAppearancePropertyPanel.EndCellLineStylePopupMode();
+ }
+
+ return(0L);
+}
+
+IMPL_LINK(CellLineStyleControl, PBClickHdl, PushButton *, pPBtn)
+{
+ if(pPBtn == &maPushButtonMoreOptions)
+ {
+ if(mrCellAppearancePropertyPanel.GetBindings())
+ {
+ mrCellAppearancePropertyPanel.GetBindings()->GetDispatcher()->Execute(SID_CELL_FORMAT_BORDER, SFX_CALLMODE_ASYNCHRON);
+ }
+
+ mrCellAppearancePropertyPanel.EndCellLineStylePopupMode();
+ }
+
+ return 0;
+}
+
+void CellLineStyleControl::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis)
+{
+ SetAllNoSel();
+ mbVSfocus = true;
+
+ if(out == DEF_LINE_WIDTH_0 && in == 0 && dis == 0) //1
+ {
+ maCellLineStyleValueSet.SetSelItem(1);
+ }
+ else if(out == DEF_LINE_WIDTH_2 && in == 0 && dis == 0) //2
+ {
+ maCellLineStyleValueSet.SetSelItem(2);
+ }
+ else if(out == DEF_LINE_WIDTH_3 && in == 0 && dis == 0) //3
+ {
+ maCellLineStyleValueSet.SetSelItem(3);
+ }
+ else if(out == DEF_LINE_WIDTH_4 && in == 0 && dis == 0) //4
+ {
+ maCellLineStyleValueSet.SetSelItem(4);
+ }
+ else if(out == DEF_DOUBLE_LINE0_OUT && in == DEF_DOUBLE_LINE0_IN && dis == DEF_DOUBLE_LINE0_DIST) //5
+ {
+ maCellLineStyleValueSet.SetSelItem(5);
+ }
+ else if(out == DEF_DOUBLE_LINE7_OUT && in == DEF_DOUBLE_LINE7_IN && dis == DEF_DOUBLE_LINE7_DIST) //6
+ {
+ maCellLineStyleValueSet.SetSelItem(6);
+ }
+ else if(out == DEF_DOUBLE_LINE4_OUT && in == DEF_DOUBLE_LINE4_IN && dis == DEF_DOUBLE_LINE4_DIST) //7
+ {
+ maCellLineStyleValueSet.SetSelItem(7);
+ }
+ else if(out == DEF_DOUBLE_LINE9_OUT && in == DEF_DOUBLE_LINE9_IN && dis == DEF_DOUBLE_LINE9_DIST) //8
+ {
+ maCellLineStyleValueSet.SetSelItem(8);
+ }
+ else if(out == DEF_DOUBLE_LINE2_OUT && in == DEF_DOUBLE_LINE2_IN && dis == DEF_DOUBLE_LINE2_DIST) //9
+ {
+ maCellLineStyleValueSet.SetSelItem(9);
+ }
+ else
+ {
+ maCellLineStyleValueSet.SetSelItem(0);
+ mbVSfocus = false;
+ }
+
+ maCellLineStyleValueSet.Format();
+ maCellLineStyleValueSet.StartSelection();
+}
+
+} } // end of namespace svx::sidebar
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,72 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef SC_SIDEBAR_CELL_LINE_STYLE_CONTROL_HXX
+#define SC_SIDEBAR_CELL_LINE_STYLE_CONTROL_HXX
+
+#include <svx/sidebar/PopupControl.hxx>
+#include <vcl/button.hxx>
+#include <CellLineStyleValueSet.hxx>
+
+namespace sc { namespace sidebar {
+
+class CellAppearancePropertyPanel;
+
+class CellLineStyleControl : public svx::sidebar::PopupControl
+{
+private:
+ CellAppearancePropertyPanel& mrCellAppearancePropertyPanel;
+ PushButton maPushButtonMoreOptions;
+ CellLineStyleValueSet maCellLineStyleValueSet;
+ XubString* mpStr;
+
+ /// bitfield
+ bool mbVSfocus : 1;
+
+ void Initialize();
+ void SetAllNoSel();
+
+ DECL_LINK(VSSelectHdl, void*);
+ DECL_LINK(PBClickHdl, PushButton*);
+
+public:
+ CellLineStyleControl(Window* pParent, CellAppearancePropertyPanel& rPanel);
+ virtual ~CellLineStyleControl(void);
+
+ void GetFocus();
+ void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis);
+
+ ValueSet& GetValueSet()
+ {
+ return maCellLineStyleValueSet;
+ }
+
+ Control& GetPushButton()
+ {
+ return maPushButtonMoreOptions;
+ }
+};
+
+} } // end of namespace svx::sidebar
+
+#endif // SC_SIDEBAR_CELL_LINE_STYLE_CONTROL_HXX
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleControl.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.cxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.cxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.cxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,54 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sc.hxx"
+
+#include "CellLineStylePopup.hxx"
+#include "CellLineStyleControl.hxx"
+
+namespace sc { namespace sidebar {
+
+CellLineStylePopup::CellLineStylePopup (
+ Window* pParent,
+ const ::boost::function<svx::sidebar::PopupControl*(svx::sidebar::PopupContainer*)>& rControlCreator)
+: Popup(pParent, rControlCreator, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellLineStyle")))
+{
+}
+
+CellLineStylePopup::~CellLineStylePopup (void)
+{
+}
+
+void CellLineStylePopup::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis)
+{
+ ProvideContainerAndControl();
+
+ CellLineStyleControl* pControl = dynamic_cast< CellLineStyleControl* >(mpControl.get());
+
+ if(pControl)
+ {
+ pControl->SetLineStyleSelect(out, in, dis);
+ }
+}
+
+} } // end of namespace sc::sidebar
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,45 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _SC_SIDEBAR_CELL_LINE_STYLE_POPUP_HXX_
+#define _SC_SIDEBAR_CELL_LINE_STYLE_POPUP_HXX_
+
+#include <svx/sidebar/Popup.hxx>
+#include <boost/function.hpp>
+
+namespace sc { namespace sidebar {
+
+class CellLineStylePopup : public svx::sidebar::Popup
+{
+public :
+ CellLineStylePopup(
+ Window* pParent,
+ const ::boost::function<svx::sidebar::PopupControl*(svx::sidebar::PopupContainer*)>& rControlCreator);
+ virtual ~CellLineStylePopup(void);
+
+ void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis);
+};
+
+} } // end of namespace sc::sidebar
+
+#endif // _SC_SIDEBAR_CELL_LINE_STYLE_POPUP_HXX_
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStylePopup.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.cxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.cxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.cxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,184 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sc.hxx"
+
+#include <CellLineStyleValueSet.hxx>
+#include <i18npool/mslangid.hxx>
+
+namespace sc { namespace sidebar {
+
+CellLineStyleValueSet::CellLineStyleValueSet( Window* pParent, const ResId& rResId)
+: ValueSet( pParent, rResId ),
+ pVDev(NULL),
+ nSelItem(0),
+ bCusEnable(false)
+{
+ strUnit = new XubString[9];
+ SetColCount( 1 );
+ SetLineCount( 9);
+}
+
+CellLineStyleValueSet::~CellLineStyleValueSet()
+{
+ delete pVDev;
+ delete[] strUnit;
+}
+
+void CellLineStyleValueSet::SetUnit(XubString* str)
+{
+ for(int i = 0; i < 9; i++)
+ {
+ strUnit[i] = str[i];
+ }
+}
+
+void CellLineStyleValueSet::SetSelItem(sal_uInt16 nSel)
+{
+ nSelItem = nSel;
+ if(nSel == 0)
+ {
+ SelectItem(1);
+ SetNoSelection();
+ }
+ else
+ {
+ SelectItem(nSelItem);
+ GrabFocus();
+ }
+}
+
+sal_uInt16 CellLineStyleValueSet::GetSelItem()
+{
+ return nSelItem;
+}
+
+void CellLineStyleValueSet::SetImage(Image img)
+{
+ imgCus = img;
+}
+
+void CellLineStyleValueSet::SetCusEnable(bool bEnable)
+{
+ bCusEnable = bEnable;
+}
+
+void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
+{
+ Rectangle aRect = rUDEvt.GetRect();
+ OutputDevice* pDev = rUDEvt.GetDevice();
+ sal_uInt16 nItemId = rUDEvt.GetItemId();
+
+ long nRectHeight = aRect.GetHeight();
+ long nRectWidth = aRect.GetWidth();
+ Point aBLPos = aRect.TopLeft();
+
+ Font aOldFont = pDev->GetFont();
+ Color aOldColor = pDev->GetLineColor();
+ Color aOldFillColor = pDev->GetFillColor();
+
+ Font aFont(OutputDevice::GetDefaultFont(DEFAULTFONT_UI_SANS, MsLangId::getSystemLanguage(), DEFAULTFONT_FLAGS_ONLYONE));
+ Size aSize = aFont.GetSize();
+ aSize.Height() = nRectHeight*3/5;
+ aFont.SetSize( aSize );
+
+ Point aLineStart(aBLPos.X() + 5, aBLPos.Y() + ( nRectHeight - nItemId )/2);
+ Point aLineEnd(aBLPos.X() + nRectWidth * 7 / 9 - 15, aBLPos.Y() + ( nRectHeight - nItemId )/2);
+ long nTLX = aBLPos.X() + 5, nTLY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
+ long nTRX = aBLPos.X() + nRectWidth * 7 / 9 - 15, nTRY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
+
+ if( nSelItem == nItemId )
+ {
+ Color aBackColor(50,107,197);
+ Rectangle aBackRect = aRect;
+ aBackRect.Top() += 3;
+ aBackRect.Bottom() -= 2;
+ pDev->SetFillColor(aBackColor);
+ pDev->DrawRect(aBackRect);
+ }
+ else
+ {
+ pDev->SetFillColor( COL_TRANSPARENT );
+ pDev->DrawRect(aRect);
+ }
+
+ //draw text
+ if(nSelItem == nItemId )
+ aFont.SetColor(COL_WHITE);
+ else
+ aFont.SetColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
+
+ pDev->SetFont(aFont);
+ Point aStart(aBLPos.X() + nRectWidth * 7 / 9 - 5 , aBLPos.Y() + nRectHeight/6);
+ pDev->DrawText(aStart, strUnit[ nItemId - 1 ]); //can't set TEXT_DRAW_ENDELLIPSIS here, or the text will disapear
+
+ //draw line
+ if( nSelItem == nItemId )
+ {
+ pDev->SetFillColor(COL_WHITE);
+ pDev->SetLineColor(COL_WHITE);
+ }
+ else
+ {
+ pDev->SetFillColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
+ pDev->SetLineColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
+ }
+
+ switch( nItemId )
+ {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ pDev->DrawRect(Rectangle(nTLX, nTLY , nTRX, nTRY + nItemId * 2 - 1 ));
+ break;
+ case 5:
+ pDev->DrawRect(Rectangle(nTLX, nTLY , nTRX, nTRY + 1 ));
+ pDev->DrawRect(Rectangle(nTLX, nTLY + 3 , nTRX, nTRY + 4 ));
+ break;
+ case 6:
+ pDev->DrawRect(Rectangle(nTLX, nTLY , nTRX, nTRY + 1 ));
+ pDev->DrawRect(Rectangle(nTLX, nTLY + 5 , nTRX, nTRY + 6 ));
+ break;
+ case 7:
+ pDev->DrawRect(Rectangle(nTLX, nTLY , nTRX, nTRY + 1 ));
+ pDev->DrawRect(Rectangle(nTLX, nTLY + 3 , nTRX, nTRY + 6 ));
+ break;
+ case 8:
+ pDev->DrawRect(Rectangle(nTLX, nTLY , nTRX, nTRY + 3 ));
+ pDev->DrawRect(Rectangle(nTLX, nTLY + 5 , nTRX, nTRY + 6 ));
+ break;
+ case 9:
+ pDev->DrawRect(Rectangle(nTLX, nTLY , nTRX, nTRY + 3 ));
+ pDev->DrawRect(Rectangle(nTLX, nTLY + 5 , nTRX, nTRY + 8 ));
+ break;
+ }
+
+ Invalidate( aRect );
+ pDev->SetLineColor(aOldColor);
+ pDev->SetFillColor(aOldFillColor);
+ pDev->SetFont(aOldFont);
+
+}
+
+} } // end of namespace svx::sidebar
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.hxx?rev=1462835&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.hxx (added)
+++ openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.hxx Sat Mar 30 18:27:42 2013
@@ -0,0 +1,54 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef SC_SIDEBAR_CELL_LINE_STYLE_VALUE_SET_HXX
+#define SC_SIDEBAR_CELL_LINE_STYLE_VALUE_SET_HXX
+
+#include <svtools/valueset.hxx>
+#include <vcl/image.hxx>
+
+namespace sc { namespace sidebar {
+
+class CellLineStyleValueSet : public ValueSet
+{
+private:
+ VirtualDevice* pVDev;
+ sal_uInt16 nSelItem;
+ XubString* strUnit;
+ Image imgCus;
+ bool bCusEnable;
+public:
+ CellLineStyleValueSet( Window* pParent, const ResId& rResId);
+ virtual ~CellLineStyleValueSet();
+
+ void SetUnit(XubString* str);
+ void SetSelItem(sal_uInt16 nSel);
+ sal_uInt16 GetSelItem();
+ void SetImage(Image img);
+ void SetCusEnable(bool bEnable);
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+};
+
+} } // end of namespace svx::sidebar
+
+#endif // SC_SIDEBAR_CELL_LINE_STYLE_VALUE_SET_HXX
+
+// eof
Propchange: openoffice/branches/sidebar/main/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
------------------------------------------------------------------------------
svn:executable = *