You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by zh...@apache.org on 2013/03/21 21:23:21 UTC

svn commit: r1459509 [4/5] - in /openoffice/branches/sidebar/main: default_images/svx/res/ default_images/svx/res/symphony/ default_images/sw/res/sidebar/ officecfg/registry/data/org/openoffice/Office/UI/ sc/sdi/ sc/source/ui/drawfunc/ sc/source/ui/inc...

Added: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx?rev=1459509&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx Thu Mar 21 20:23:16 2013
@@ -0,0 +1,278 @@
+/**************************************************************
+ * 
+ * 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 SVX_SIDEBAR_PARA_PROPERTY_PAGE_HXX
+#define SVX_SIDEBAR_PARA_PROPERTY_PAGE_HXX
+
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <editeng/lspcitem.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <svx/tbxcolorupdate.hxx>
+#include <svx/relfld.hxx>
+#include <editeng/svxenum.hxx>
+#include <editeng/fhgtitem.hxx>
+
+#include <com/sun/star/ui/XUIElement.hpp>
+
+#include <boost/scoped_ptr.hpp>
+
+#include "sidebar/ColorPopup.hxx"
+#include <vcl/vclenum.hxx>
+#include <vcl/fixed.hxx>
+#include <svl/poolitem.hxx>
+#include <tools/fldunit.hxx>
+
+#include "ParaLineSpacingPopup.hxx"
+
+class FloatingWindow;
+class ToolBox;
+
+namespace svx { namespace sidebar {
+
+class PopupControl;
+class PopupContainer;
+
+class ParaPropertyPanel
+    : public Control,
+      public ::sfx2::sidebar::IContextChangeReceiver,
+      public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+public:
+    static ParaPropertyPanel* Create (
+        Window* pParent,
+        const cssu::Reference<css::frame::XFrame>& rxFrame,
+        SfxBindings* pBindings);
+
+	virtual void DataChanged (const DataChangedEvent& rEvent);
+	SfxBindings* GetBindings();
+
+	virtual void HandleContextChange (
+	    const ::sfx2::sidebar::EnumContext aContext);
+
+	virtual void NotifyItemUpdate(
+	    const sal_uInt16 nSId,
+	    const SfxItemState eState,
+	    const SfxPoolItem* pState);
+
+	void ShowMenu (void);
+	sal_uInt16 GetBulletTypeIndex(){ return nBulletTypeIndex; }
+	void SetBulletTypeIndex(sal_uInt16 nInd){ nBulletTypeIndex = nInd; }
+	sal_uInt16 GetNumTypeIndex(){ return nNumTypeIndex; }
+	void SetNumTypeIndex(sal_uInt16 nInd){ nNumTypeIndex = nInd; }
+	//End
+	FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
+
+	void EndSpacingPopupMode (void);
+	void EndBulletsPopupMode (void);
+	void EndNumberingPopupMode (void);
+
+private:
+	/**********************************************************
+	 **
+	 ** UI controls
+	 **
+	***********************************************************/
+	//Alignment
+	::boost::scoped_ptr<Window> 			maAlignToolBoxBackground;
+	::boost::scoped_ptr<ToolBox>			maAlignToolBox;
+	::boost::scoped_ptr<Window> 			maTBxVertAlignBackground;
+	::boost::scoped_ptr<ToolBox>			maTBxVertAlign;
+	//NumBullet&Backcolor
+	::boost::scoped_ptr<Window> 			maTBxNumBulletBackground;
+	::boost::scoped_ptr<ToolBox>			maTBxNumBullet;
+	::boost::scoped_ptr<Window> 			maTBxBackColorBackground;
+	::boost::scoped_ptr<ToolBox>			maTBxBackColor;
+	//Paragraph spacing
+	::boost::scoped_ptr<FixedText>			maFTUL;
+	::boost::scoped_ptr<Window> 			maTbxUL_IncDecBackground;
+	::boost::scoped_ptr<ToolBox>			maTbxUL_IncDec;
+	::boost::scoped_ptr<SvxRelativeField>	maTopDist;
+	::boost::scoped_ptr<SvxRelativeField>	maBottomDist;
+	//Line spacing
+	::boost::scoped_ptr<Window> 			maLineSPTbxBackground;
+	::boost::scoped_ptr<ToolBox>			maLineSPTbx;
+	//Indent
+	::boost::scoped_ptr<FixedText>			maFTIndent;
+	::boost::scoped_ptr<Window> 			maTbxIndent_IncDecBackground;
+	::boost::scoped_ptr<ToolBox>			maTbxIndent_IncDec;
+	::boost::scoped_ptr<Window> 			maTbxProDemoteBackground;
+	::boost::scoped_ptr<ToolBox>			maTbxProDemote;
+	::boost::scoped_ptr<SvxRelativeField>	maLeftIndent;
+	::boost::scoped_ptr<SvxRelativeField>	maRightIndent;
+	::boost::scoped_ptr<SvxRelativeField>	maFLineIndent;
+	::boost::scoped_ptr<::svx::ToolboxButtonColorUpdater>	mpColorUpdater;	
+	
+	/**********************************************************
+	 **
+	 ** Resources
+	 **
+	***********************************************************/
+	FixedImage  maFISpace1;
+	FixedImage  maFISpace2;
+	FixedImage  maFIndent1;
+	FixedImage  maFIndent2;
+	FixedImage  maFIndent3;
+
+	Image  maSpace1;
+	Image  maSpace2;
+	Image  maSpace3;
+	Image  maIndent1;
+	Image  maIndent2;
+	Image  maIndent3;
+
+	Image  maLeftPara;
+	Image  maCentPara;
+	Image  maRightPara;
+	Image  maJusPara;
+
+	Image  maIndInc;
+	Image  maIndDec;
+	Image  maIndInc_BD;
+	Image  maIndDec_BD;
+	Image  maIndHang;
+	Image  maParInc;
+	Image  maParDec;
+
+	ImageList	maVertImageList;
+	ImageList	maVertImageListH;	
+	ImageList	maNumBImageList;
+	ImageList	maNumBImageListH;
+	ImageList	maNumBImageListRTL;	//sym2_7380
+	Image		maImgBackColorHigh;
+	Image		maImgBackColor;
+
+	/****************************************************************
+	**
+	** Data Member
+	**
+	*****************************************************************/
+	long				maTxtLeft;
+	//Line spacing
+	SvxLineSpacingItem	*mpLnSPItem; 
+	SfxItemState			meLnSpState;
+	bool					mbOutLineLeft;
+	bool					mbOutLineRight;
+	long					maUpper;
+	long					maLower;
+
+	sal_uInt16			nBulletTypeIndex;
+	sal_uInt16			nNumTypeIndex;
+	Color				maColor;
+	bool					mbColorAvailable;
+	FieldUnit						m_eMetricUnit;
+	FieldUnit						m_last_eMetricUnit;
+	SfxMapUnit                      m_eLRSpaceUnit;
+	SfxMapUnit                      m_eULSpaceUnit;
+	/****************************************************************
+	**
+	** Controll Itemb
+	**
+	*****************************************************************/
+
+	::sfx2::sidebar::ControllerItem  maLeftAlignControl;
+	::sfx2::sidebar::ControllerItem  maCenterAlignControl;
+	::sfx2::sidebar::ControllerItem  maRightAlignControl;
+	::sfx2::sidebar::ControllerItem  maJustifyAlignControl;
+	::sfx2::sidebar::ControllerItem  maLRSpaceControl;
+	::sfx2::sidebar::ControllerItem  maLNSpaceControl;
+	::sfx2::sidebar::ControllerItem  maULSpaceControl;
+	::sfx2::sidebar::ControllerItem  maOutLineLeftControl;
+	::sfx2::sidebar::ControllerItem  maOutLineRightControl;
+	::sfx2::sidebar::ControllerItem  maDecIndentControl;
+	::sfx2::sidebar::ControllerItem  maIncIndentControl;
+	::sfx2::sidebar::ControllerItem  maVertTop;
+	::sfx2::sidebar::ControllerItem  maVertCenter;
+	::sfx2::sidebar::ControllerItem  maVertBottom;
+	::sfx2::sidebar::ControllerItem  maBulletOnOff;
+	::sfx2::sidebar::ControllerItem  maNumberOnOff;
+	::sfx2::sidebar::ControllerItem  maBackColorControl;
+	::sfx2::sidebar::ControllerItem  m_aMetricCtl;
+	::sfx2::sidebar::ControllerItem  maBulletNumRuleIndex;
+	::sfx2::sidebar::ControllerItem  maNumNumRuleIndex;
+
+    cssu::Reference<css::frame::XFrame> mxFrame;
+    ::sfx2::sidebar::EnumContext maContext;
+    SfxBindings* mpBindings;
+
+
+	ParaLineSpacingPopup maLineSpacePopup;
+    
+    ParaPropertyPanel (
+        Window* pParent,
+        const cssu::Reference<css::frame::XFrame>& rxFrame,
+        SfxBindings* pBindings);
+	virtual ~ParaPropertyPanel (void);
+
+	void InitImageList(::boost::scoped_ptr<ToolBox>& rTbx, ImageList& rImglst, ImageList& rImgHlst);
+
+	DECL_LINK(AlignStyleModifyHdl_Impl, ToolBox*);
+	DECL_LINK(VertTbxSelectHandler, ToolBox*);
+	DECL_LINK(NumBTbxSelectHandler, ToolBox*);
+	DECL_LINK(ModifyIndentHdl_Impl, SvxRelativeField*);
+	DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*);
+	DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*);
+	DECL_LINK(ULSpaceHdl_Impl, SvxRelativeField*);
+	DECL_LINK(ClickUL_IncDec_Hdl_Impl, ToolBox*);
+	DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* );
+
+	void VertStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
+	void ParaBKGStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
+	void StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	void StateChangedLnSPImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	void StateChangeOutLineImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	void StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	//Sym3_1093. Add toggle state for numbering and bullet icons
+	void StateChangeBulletNumImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	//Modified for Numbering&Bullets Dialog UX Enh(Story 992) by chengjh,2011.7.5
+	//Handing the transferred the num rule index data of the current selection
+	void StateChangeBulletNumRuleImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
+	
+	void initial();
+	void ReSize(bool bSize);
+
+	
+	PopupControl* CreateLineSpacingControl (PopupContainer* pParent);
+	PopupControl* CreateBulletsPopupControl (PopupContainer* pParent);
+	PopupControl* CreateNumberingPopupControl (PopupContainer* pParent);
+	PopupControl* CreateBGColorPopupControl (PopupContainer* pParent);
+	DECL_LINK(ClickLineSPDropDownHdl_Impl, ToolBox*);
+	DECL_LINK(NumBTbxDDHandler, ToolBox*);
+	DECL_LINK(ToolBoxBackColorDDHandler, ToolBox *);
+
+	void SetupIcons (void);
+	void InitToolBoxAlign();
+	void InitToolBoxVertAlign();
+	void InitToolBoxIndent();
+	void InitToolBoxBGColor();
+	void InitToolBoxBulletsNumbering();
+	void InitToolBoxSpacing();
+	void InitToolBoxLineSpacing();
+};
+
+} } // end of namespace ::svx::sidebar
+
+#endif
+

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.src?rev=1459509&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.src (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.src Thu Mar 21 20:23:16 2013
@@ -0,0 +1,857 @@
+/**************************************************************
+ * 
+ * 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 "ParaPropertyPanel.hrc"
+#include <sfx2/sidebar/propertypanel.hrc>
+#include "helpid.hrc"
+
+#define MASKCOLOR	MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
+
+#define SVX_PROPERTYPANEL_PARA_VERT_IDLIST \
+	IdList =			   \
+	{					   \
+		IID_VERT_TOP ;	   \
+		IID_VERT_CENTER ;   \
+		IID_VERT_BOTTOM ;   \
+	};					   \
+	IdCount = { 3 ; };
+
+#define SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST \
+	IdList =			   \
+	{					   \
+		IID_BULLET ;	   \
+		IID_NUMBER ;	   \
+	};					   \
+	IdCount = { 2 ; };
+
+//add by wj for sym2_7380	
+#define SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST_RTL \
+	IdList =			   \
+	{					   \
+		IID_BULLET ;	   \
+		IID_NUMBER ;	   \
+	};					   \
+	IdCount = { 2 ; };
+	
+Control RID_SIDEBAR_PARA_PANEL
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+	Size = MAP_APPFONT( PROPERTYPAGE_WIDTH, PARA_SECTIONPAGE_HEIGHT );
+	HelpID = HID_PROPERTYPANEL_PARA_SECTION ;
+	Text = "Paragraph";	
+
+	ToolBox TBX_HORIZONTALALIGNMENT
+	{
+        Pos = MAP_APPFONT ( TBX_HORI_ALIGN_X , TBX_HORI_ALIGN_Y );
+        Size = MAP_APPFONT ( ALIGNMENT_TBX_WIDTH*4 ,ALIGNMENT_TBX_HEIGHT);
+		SVLook = TRUE ;
+		Border = FALSE ;
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_HALIGN;
+		Text = "Horizontal Alignment";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = BT_SUBSTLEFT ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_LEFT;
+				Text [ en-US ] = "Align Left" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/AlignTextLeft_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = BT_SUBSTCENTER ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_CENTER;
+				Text [ en-US ] = "Align Center" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/AlignTextCenter_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = BT_SUBSTRIGHT ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_RIGHT;
+				Text [ en-US ] = "Align Right" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/AlignTextRight_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = BT_SUBSTJUSTIFY ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_JUSTIFY;
+				Text [ en-US ] = "Align Justified" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/AlignTextJustified_16x16.png";
+				};
+			};
+		};
+	};
+	ToolBox TBX_VERT_ALIGN
+	{
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_VALIGN;
+		SVLook = TRUE ;
+		Border = FALSE ;
+		Pos = MAP_APPFONT ( TBX_VERT_ALIGN_X,  TBX_VERT_ALIGN_Y ) ;
+		Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 3 ,  TOOLBOX_ITEM_HEIGHT) ;
+		TabStop = TRUE ;
+		Text = "Vertical Alignment";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = IID_VERT_TOP ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_VALIGN_TOP;
+				Text [ en-US ] = "Align Top" ;
+			};
+			
+			ToolBoxItem
+			{
+				Identifier = IID_VERT_CENTER ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_VALIGN_CENTER;
+				Text [ en-US ] = "Align Center Vertically" ;
+			};
+			
+			ToolBoxItem
+			{
+				Identifier = IID_VERT_BOTTOM ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_VALIGN_BOT;
+				Text [ en-US ] = "Align Bottom" ;
+			};
+		};
+	};
+
+    ToolBox TBX_NUM_BULLET
+	{
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_NUM_BULLET;
+		Border = FALSE ;
+		Pos = MAP_APPFONT ( TBX_NUM_BULLET_X , TBX_NUM_BULLET_Y ) ;
+		Size = MAP_APPFONT ( TOOLBOX_ITEM_DD_WIDTH * 2 ,  TOOLBOX_ITEM_HEIGHT) ;
+		TabStop = TRUE ;
+		Text = "Bullets and Numbering";
+		ItemList =
+		{			
+			ToolBoxItem
+			{
+				Identifier = IID_BULLET ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_BULLET ;
+				Text [ en-US ] = "Bullets" ;
+				DropDown = TRUE ;
+			};			
+			ToolBoxItem
+			{
+				Identifier = IID_NUMBER ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_NUM ;
+				Text [ en-US ] = "Numbering" ;
+				DropDown = TRUE ;
+			};
+		};
+	};	
+	ToolBox TBX_BACK_COLOR
+	{
+		SVLook = TRUE ;
+		Pos = MAP_APPFONT (TBX_BACK_COLOR_X, TBX_BACK_COLOR_Y) ;
+		Size = MAP_APPFONT (TOOLBOX_WIDTH,TOOLBOX_HEIGHT ) ;
+		TabStop = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_BACK_COLOR;
+		Text = "Paragraph Background Color" ;
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = TBI_BACK_COLOR ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_BACK_COLOR;
+				DropDown = TRUE ;
+				Text [ en-US ] = "Paragraph Background Color" ;
+			};
+		};
+	};
+	FixedText FT_SPACING
+	{
+	    Pos = MAP_APPFONT ( FT_PARA_SPACE_X, FT_PARA_SPACE_Y );
+        Size = MAP_APPFONT ( FT_PARA_INDENT_X - 7 - FT_PARA_SPACE_X, _FIXED_TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Spacing:"; 
+	};
+	ToolBox TBX_UL_INC_DEC
+	{
+		Pos = MAP_APPFONT ( TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y );
+		Size = MAP_APPFONT (ALIGNMENT_TBX_WIDTH*2,ALIGNMENT_TBX_HEIGHT);
+		SVLook = TRUE ;
+		Border = FALSE ;
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_INC_DEC ;
+		Text = "Spacing"; 
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = BT_TBX_UL_INC ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INC ;
+				Text [ en-US ] = "Increase Spacing" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/IncreaseSpace_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = BT_TBX_UL_DEC ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_DEC ;
+				Text [ en-US ] = "Decrease Spacing" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/DecreaseSpace_16x16.png";
+				};
+			};
+		};
+	};
+	MetricField MF_ABOVE_PARASPACING
+	{
+		HelpID = HID_POPUP_PS_ED_SBINDE_TOPDIST ;
+		Border = TRUE;
+		Pos = MAP_APPFONT ( MBX_TOP_DIST_X, MBX_TOP_DIST_Y );
+        	Size = MAP_APPFONT ( CONTROL_WIDTH -10 ,MBOX_HEIGHT ) ;
+        //QuickHelpText [ en-US ] = "Above Paragraph Spacing";
+        	TabStop = TRUE;
+		Repeat = TRUE;
+		Spin = TRUE;
+		Maximum = 999;
+		Unit = FUNIT_INCH;
+		Last = 999;
+		SpinSize = 1;
+
+	};
+	MetricField MF_BELOW_PARASPACING
+	{
+		Border = TRUE;
+		Pos = MAP_APPFONT ( MBX_BOT_DIST_X, MBX_BOT_DIST_Y );
+        Size = MAP_APPFONT ( CONTROL_WIDTH -10,MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "Below Paragraph Spacing";
+        HelpID = HID_POPUP_PS_ED_SBINDE_BOTTOMDIST ;
+		Repeat = TRUE;
+		Spin = TRUE;
+		Maximum = 999;
+		Unit = FUNIT_INCH;
+		Last = 999;
+		SpinSize = 1;
+	};
+	FixedText FT_INDENT
+	{
+	    Pos = MAP_APPFONT ( FT_PARA_INDENT_X, FT_PARA_INDENT_Y );
+        Size = MAP_APPFONT ( _FIXED_TEXT_WIDTH + 50, _FIXED_TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Indent:";
+	};
+	ToolBox TBX_INDENT_INC_DEC
+	{
+		Pos = MAP_APPFONT ( TBX_PARA_INDENT_INC_DEC_X, TBX_PARA_INDENT_INC_DEC_Y );
+		Size = MAP_APPFONT (ALIGNMENT_TBX_WIDTH*2,ALIGNMENT_TBX_HEIGHT);
+		SVLook = TRUE ;
+		Border = FALSE ;
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_INDENT_INC_DEC ;
+		Text = "Indent";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = BT_TBX_INDENT_INC ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INDENT_INC ;
+				Text [ en-US ] = "Increase Indent" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/Indent_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = BT_TBX_INDENT_DEC ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INDENT_DEC ;
+				Text [ en-US ] = "Decrease Indent" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/Outdent_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = ID_HANGING_INDENT ;
+				Text [ en-US ] = "Switch to Hanging Indent" ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INDENT_HANG ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/Indent_Hanging.png";
+				};
+			};
+		};		
+	};
+	ToolBox TBX_INDENT_PRO_DEMOTE
+	{
+		Pos = MAP_APPFONT ( TBX_PARA_INDENT_INC_DEC_X, TBX_PARA_INDENT_INC_DEC_Y );
+		Size = MAP_APPFONT (ALIGNMENT_TBX_WIDTH*2,ALIGNMENT_TBX_HEIGHT);
+		SVLook = TRUE ;
+		Border = FALSE ;
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_INDENTP_INC_DEC ;
+		Text = "Indent";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = BT_TBX_INDENT_PROMOTE ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INDENTP_INC ;
+				Text [ en-US ] = "Increase Indent" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/Indent_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = BT_TBX_INDENT_DEMOTE ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INDENTP_DEC ;
+				Text [ en-US ] = "Decrease Indent" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/Outdent_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = SD_HANGING_INDENT ;
+				Text [ en-US ] = "Switch to Hanging Indent" ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_INDENTP_HANG ; 
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/Indent_Hanging.png";
+				};
+			};
+		};		
+	};
+	MetricField MF_BEFORE_INDENT
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( MBX_LEFT_DIST_X, MBX_LEFT_DIST_Y );
+        Size = MAP_APPFONT ( CONTROL_WIDTH - 10,MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "Before Text Indent";
+        HelpID = HID_POPUP_INDENT_ED_INDENT_LEFTINDENT ;
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Maximum = 9999 ;
+		StrictFormat = TRUE ;
+		Unit = FUNIT_INCH;
+		Last = 9999 ;
+		SpinSize = 2 ;
+	};
+    MetricField MF_AFTER_INDENT
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( MBX_RIGHT_DIST_X, MBX_RIGHT_DIST_Y );
+        Size = MAP_APPFONT ( CONTROL_WIDTH -10 ,MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "After Text Indent";
+        HelpID = HID_POPUP_INDENT_ED_INDENT_RIGHTINDENT ;
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Maximum = 9999 ;
+		StrictFormat = TRUE ;
+		Unit = FUNIT_INCH;
+		Last = 9999 ;
+		SpinSize = 2 ;
+	};
+    MetricField MF_FL_INDENT
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( MBX_FLINE_DIST_X, MBX_FLINE_DIST_Y );
+        Size = MAP_APPFONT ( CONTROL_WIDTH -10 ,MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "First Line Indent";
+        HelpID = HID_POPUP_INDENT_ED_INDENT_FLINDENT ;
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Minimum = -9999;
+		Maximum = 9999 ;
+		DecimalDigits = 2;
+		Unit = FUNIT_INCH;
+		First = -9999;
+		Last = 9999 ;
+		SpinSize = 2 ;
+	};
+	ToolBox TBX_LINESP
+	{
+	    Pos = MAP_APPFONT ( TBX_LINE_SPACE_X, TBX_LINE_SPACE_Y);
+		SVLook = TRUE ;
+		Border = FALSE ;
+		Size = MAP_APPFONT (TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
+		HelpID = HID_PPROPERTYPANEL_PARA_TBX_LINESP ;
+		Text = "Line Spacing" ;
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = BT_BTX_LINESP ;
+				HelpID = HID_PPROPERTYPANEL_PARA_TBI_LINESP ;
+				Text [ en-US ] = "Line Spacing" ;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/lpsmall-spacing-1.png" ;
+				};
+				DropDown = TRUE;
+			};
+		};
+	};
+	FixedImage FI_INDENT1
+    {
+        Pos = MAP_APPFONT( IMG_SPACE_X, IMG_SPACE1_Y );
+        Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE );
+    };
+    FixedImage FI_INDENT2
+    {
+        Pos = MAP_APPFONT( IMG_SPACE_X, IMG_SPACE2_Y );
+        Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE );
+    };
+    FixedImage FI_INDENT3
+    {
+        Pos = MAP_APPFONT( IMG_INDENT_X, IMG_INDENT1_Y );
+        Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE );
+    };
+    FixedImage FI_SPACE1
+    {
+        Pos = MAP_APPFONT( IMG_INDENT_X, IMG_INDENT2_Y );
+        Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE );
+    };
+    FixedImage FI_SPACE2
+    {
+        Pos = MAP_APPFONT( IMG_INDENT_X, IMG_INDENT3_Y );
+        Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE );
+    };
+	
+	ImageList IL_VERT_ALIGN
+	{
+        Prefix = "symphony/para_vert";
+		MaskColor = STD_MASKCOLOR ;
+        SVX_PROPERTYPANEL_PARA_VERT_IDLIST
+    };
+    ImageList ILH_VERT_ALIGN
+	{
+        Prefix = "symphony/para_verth";
+		MaskColor = STD_MASKCOLOR ;
+        SVX_PROPERTYPANEL_PARA_VERT_IDLIST
+    };
+    
+	ImageList IL_NUM_BULLET
+	{
+        Prefix = "symphony/para_numbullet";
+		MaskColor = STD_MASKCOLOR ;
+        SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST
+    };
+    ImageList ILH_NUM_BULLET
+	{
+        Prefix = "symphony/para_numbulleth";
+		MaskColor = STD_MASKCOLOR ;
+        SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST
+    };    
+    //for sym2_7380
+    ImageList IL_NUM_BULLET_RTL
+	{
+        Prefix = "symphony/para_numbullet_rtl";
+		MaskColor = STD_MASKCOLOR ;
+        SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST_RTL
+    };
+    //end
+    /*Image IMG_BACK_COLOR
+	{
+		ImageBitmap = Bitmap{File = "sc_backgroundcolor.bmp";};
+	};
+	Image IMG_BACK_COLOR_H
+	{
+		ImageBitmap = Bitmap{File = "sch_backgroundcolor.bmp";};
+	};	*/
+	Image IMG_SPACE1   
+	{
+	    ImageBitmap = Bitmap{File = "symphony/spacing1.png";};
+	};  
+	Image IMG_SPACE2   
+    {
+	    ImageBitmap = Bitmap{File = "symphony/spacing2.png";};
+	};    
+	Image IMG_SPACE3
+	{
+	    ImageBitmap = Bitmap{File = "symphony/spacing3.png";};
+	};  					
+    Image IMG_INDENT1 
+    {
+	    ImageBitmap = Bitmap{File = "symphony/Indent2.png";};
+	};       
+    Image IMG_INDENT2  
+    {
+	    ImageBitmap = Bitmap{File = "symphony/Indent3.png";};
+	};            
+    Image IMG_INDENT3
+    {
+	    ImageBitmap = Bitmap{File = "symphony/Indent4.png";};
+	};
+	Image IMG_LEFT_PARA
+    { 
+        ImageBitmap = Bitmap{File = "symphony/AlignTextLeft_16x16.png";};
+	};
+	Image IMG_CENTER_PARA 
+    {
+		ImageBitmap = Bitmap{File = "symphony/AlignTextCenter_16x16.png";};
+	};
+	Image IMG_RIGHT_PARA 
+    {
+		ImageBitmap = Bitmap{File = "symphony/AlignTextRight_16x16.png";};
+	};
+	Image IMG_JUSTIFY_PARA 
+    {
+	    ImageBitmap = Bitmap{File = "symphony/AlignTextJustified_16x16.png";};
+	};
+	Image IMG_INDENT_INC 
+    {
+	    ImageBitmap = Bitmap{File = "symphony/Indent_16x16.png";};
+	};
+	Image IMG_INDENT_DEC
+    {
+	    ImageBitmap = Bitmap{File = "symphony/Outdent_16x16.png";};
+	};
+	Image IMG_INDENT_INC_BD 
+    {
+	    ImageBitmap = Bitmap{File = "symphony/rte_Indent_16x16.png";};
+	};
+	Image IMG_INDENT_DEC_BD
+    {
+	    ImageBitmap = Bitmap{File = "symphony/rte_Outdent_16x16.png";};
+	};
+	Image IMG_INDENT_HANG
+    {
+	    ImageBitmap = Bitmap{File = "symphony/Indent_Hanging.png";};
+	};
+	Image IMG_PARA_INC 
+    {
+	    ImageBitmap = Bitmap{File = "symphony/IncreaseSpace_16x16.png";};
+	};
+	Image IMG_PARA_DEC
+    {
+	    ImageBitmap = Bitmap{File = "symphony/DecreaseSpace_16x16.png";};
+	};	
+};
+
+//===========================================Back color page==============================
+
+/*Control RID_POPUPPANEL_PARAPAGE_BACK_COLOR
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+	
+	Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH + POPUP_BORDER_WIDTH , POPUP_COLOR_PICKER_HEIGHT +POPUP_BORDER_HEIGHT );
+	
+	Control VS_FONT_COLOR
+	{
+		HelpID = HID_PPROPERTYPANEL_PARA_BACK_COLOR_VS ;
+        Hide = TRUE ;
+        Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y );
+        Size = MAP_APPFONT (  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT );
+		TabStop = TRUE ;
+		Text = "Color Picker";
+	};
+
+	String STR_NOFILL
+	{
+		Text [ en-US ] = "No Color";
+	};
+		
+};*/
+
+//===========================================Bullet popup page==============================
+Control RID_POPUPPANEL_PARAPAGE_BULLETS
+{
+	DialogControl = TRUE;
+	OutputSize = TRUE;
+	Border = FALSE;
+	
+	Size = MAP_APPFONT ( POPUP_WIDTH_BULLET , POPUP_HEIGHT_BULLET) ;
+	Control VS_VALUES
+	{
+		Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_NB , POPUPPANEL_MARGIN_NB ) ;
+		Size = MAP_APPFONT ( VS_WIDTH_BULLET ,  VS_HEIGHT_BULLET) ;
+		HelpID = HID_POPUP_BULLET_VS_VALUES ;
+		TabStop = TRUE ;
+		Text = "Bullet";
+	};
+	PushButton CB_BULLET_MORE
+	{
+		Pos = MAP_APPFONT (CUST_MORE_BUTTON_X + POPUPPANEL_MARGIN_NB, VS_HEIGHT_BULLET + POPUPPANEL_MARGIN_NB * 2 ) ;
+		Size = MAP_APPFONT (POPUP_WIDTH_BULLET - 2*CUST_MORE_BUTTON_X - POPUPPANEL_MARGIN_NB*2, CUST_MORE_BUTTON_HEIGHT ) ;
+		HelpID = HID_POPUP_BULLET_CB_BULLET_MORE ;
+		TabStop = TRUE ;
+		Text [ en-US ] = "~More Options";
+	};	
+    Bitmap	BMP_BULLET_MORE
+	{
+		File = "symphony/__morebutton.bmp";
+	};
+	Bitmap	BMP_BULLET_MORE_H
+	{
+		File = "symphony/__morebutton_h.bmp";
+	};	
+};
+
+String RID_SVXSTR_SIDEBAR_BULLET_DESCRIPTIONS_0
+{
+    Text [en-US] = "large square bullets";
+};
+
+String RID_SVXSTR_SIDEBAR_BULLET_DESCRIPTIONS_1
+{
+    Text [en-US] = "graphic bullets";
+};
+
+String RID_SVXSTR_SIDEBAR_BULLET_DESCRIPTIONS_2
+{
+    Text [en-US] = "graphic bullets";
+};
+
+String RID_SVXSTR_SIDEBAR_BULLET_DESCRIPTIONS_3
+{
+    Text [en-US] = "graphic bullets";
+};
+
+String RID_SVXSTR_SIDEBAR_BULLET_DESCRIPTIONS_4
+{
+    Text [en-US] = "graphic bullets";
+};
+
+//===========================================Numbering popup page==============================
+Control RID_POPUPPANEL_PARAPAGE_NUMBERING
+{
+	SVLook = TRUE ;
+	DialogControl = TRUE;
+	OutputSize = TRUE;
+	Border = FALSE;
+	
+	Size = MAP_APPFONT ( POPUP_WIDTH_NUM , POPUP_HEIGHT_NUM) ;
+	Control VS_NUMBERING
+	{
+		Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_NB, POPUPPANEL_MARGIN_NB ) ;
+		Size = MAP_APPFONT ( VS_WIDTH_NUM ,  VS_HEIGHT_NUM) ;
+		HelpID = HID_POPUP_NUM_VS_NUMBERING ;
+		TabStop = TRUE ;
+		Text = "Numbering";
+	};
+	PushButton CB_NUMBERING_MORE
+	{
+		Pos = MAP_APPFONT (CUST_MORE_BUTTON_X + POPUPPANEL_MARGIN_NB,  VS_HEIGHT_NUM + POPUPPANEL_MARGIN_NB * 2 ) ;
+		Size = MAP_APPFONT (POPUP_WIDTH_NUM - 2*CUST_MORE_BUTTON_X - POPUPPANEL_MARGIN_NB*2, CUST_MORE_BUTTON_HEIGHT ) ;
+		HelpID = HID_POPUP_NUM_CB_NUMBERING_MORE ;
+		TabStop = TRUE ;
+		Text [ en-US ] = "~More Options";
+	};	
+    Bitmap	BMP_NUMERING_MORE
+	{
+		File = "symphony/__morebutton.bmp";
+	};
+	Bitmap	BMP_NUMERING_MORE_H
+	{
+		File = "symphony/__morebutton_h.bmp";
+	};	
+};
+
+//===========================================Line Space popup page==============================
+Control RID_POPUPPANEL_PARAPAGE_LINESPACING
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+	
+	Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_SPACING_WIDTH, POPUP_PAGE_HEIGHT );
+	
+	Control LINE_SPACING
+	{
+		Pos = MAP_APPFONT(  POPUPPANEL_MARGIN_SMALL + OFFSET_X , POPUPPANEL_MARGIN_SMALL + OFFSET_Y ); 
+        Size = MAP_APPFONT ( VS_SPACING_WIDTH  , 17 * 5);
+		TabStop = TRUE ;
+		Text = "Line Spacing";
+	};
+	
+	FixedText FT_CUSTOM
+	{
+	    Pos = MAP_APPFONT ( POP_FT_CUSTOM_X, POP_FT_CUSTOM_Y );
+        Size = MAP_APPFONT ( _FIXED_TEXT_WIDTH + 50 , _FIXED_TEXT_HEIGHT) ;
+		Text [ en-US ] = "Custom:";
+	};
+    FixedText FT_LINE_SPACING
+	{
+	    Pos = MAP_APPFONT ( FT_1_X, FT_1_Y );
+        Size = MAP_APPFONT ( _FIXED_TEXT_WIDTH + 10, _FIXED_TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Line Spacing:";
+	};
+
+	FixedText FT_OF
+	{
+	    Pos = MAP_APPFONT ( FT_2_X, FT_2_Y );
+        Size = MAP_APPFONT ( _FIXED_TEXT_WIDTH , _FIXED_TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Of:";
+	};
+	
+	ListBox LB_LINE_SPACING
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( EDIT_1_X, EDIT_1_Y );
+        Size = MAP_APPFONT ( BD_WIDTH - POPUPPANEL_MARGIN_LARGE * 2,LISTBOX_HEIGHT ) ;
+		TabStop = TRUE ;
+		DropDown = TRUE ;
+		HelpID = HID_POPUP_LS_LB_LINE_SPACING ;
+        StringList [ en-US ] =
+        {
+			< "Single" ; Default ; > ;
+			< "1.5 Lines" ; Default ; > ;
+			< "Double" ; Default ; > ;
+            < "Proportional" ; Default ; > ;
+            < "At least" ; Default ; > ;
+            < "Leading" ; Default ; > ;
+            < "Fixed" ; Default ; > ;
+        };
+	};
+	MetricField ED_SBINDE_LINEDISTPERCENT
+	{
+		Disable = TRUE;
+		Border = TRUE;
+		Pos = MAP_APPFONT ( EDIT_2_X, EDIT_2_Y );
+        Size = MAP_APPFONT ( BD_WIDTH - POPUPPANEL_MARGIN_LARGE * 2,MBOX_HEIGHT ) ;
+        HelpID = HID_POPUP_LS_ED_SBINDE_LINEDISTPERCENT ;
+		Repeat = TRUE;
+		Spin = TRUE;
+		Minimum = 50;
+		Maximum = 200;
+		Value = 100;
+		StrictFormat = TRUE;
+		Unit = FUNIT_CUSTOM ;
+		CustomUnitText = "%";
+		First = 50;
+		Last = 200;
+		SpinSize = 1;
+	};
+	MetricField ED_SBINDE_LINEDISTPOINT
+	{
+		Disable = TRUE;
+		Border = TRUE;
+		Pos = MAP_APPFONT ( EDIT_2_X, EDIT_2_Y );
+        Size = MAP_APPFONT ( BD_WIDTH - POPUPPANEL_MARGIN_LARGE * 2, MBOX_HEIGHT ) ;
+        HelpID = HID_POPUP_LS_ED_SBINDE_LINEDISTPOINT ;
+		Repeat = TRUE;
+		Spin = TRUE;
+		Maximum = 9999;
+		DecimalDigits = 2;
+		StrictFormat = TRUE ;
+		Unit = FUNIT_INCH;
+		Last = 9999;
+		SpinSize = 2;
+	};
+	Image IMG_SPACING1
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpspacing-1.png";};
+	};
+	Image IMG_SPACING115
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpspacing-1_15.png";};
+	};
+	Image IMG_SPACING15
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpspacing-1_5.png";};
+	};
+	Image IMG_SPACING2
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpspacing-2.png";};
+	};
+	Image IMG_SEL_SPACING1
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1.png";};
+	};
+	Image IMG_SEL_SPACING115
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1_15.png";};
+	};
+	Image IMG_SEL_SPACING15
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1_5.png";};
+	};
+	Image IMG_SEL_SPACING2
+	{
+	    ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-2.png";};
+	};
+    Image IMG_CUSTOM
+	{
+		ImageBitmap = Bitmap{File = "symphony/last_custom_common.png";};
+	};
+	Image IMG_CUSTOM_GRAY
+	{
+		ImageBitmap = Bitmap{File = "symphony/last_custom_common_grey.png";};
+	};
+	String STR_LS_SINGLE
+    {
+        Text [ en-US ] = "Line spacing: Single";
+    };
+    String STR_LS_115
+    {
+        Text [ en-US ] = "Line spacing: 1.15 Lines";
+    };
+    String STR_LS_15
+    {
+        Text [ en-US ] = "Line spacing: 1.5 Lines";
+    };
+    String STR_LS_DOUBLE
+    {
+        Text [ en-US ] = "Line spacing: Double";
+    };
+    String STR_LSPACING
+    {
+        Text [ en-US ] = "Line spacing:";
+    };
+    String STR_LS_OF
+    {
+        Text [ en-US ] = "of:";
+    };
+    String STR_SPACING1
+    {
+        Text [ en-US ] = "Spacing: 1";
+    };
+    String STR_SPACING115
+    {
+        Text [ en-US ] = "Spacing: 1.15";
+    };
+    String STR_SPACING15
+    {
+        Text [ en-US ] = "Spacing: 1.5";
+    };
+    String STR_SPACING2
+    {
+        Text [ en-US ] = "Spacing: 2";
+    };
+    String STR_LCVALUE
+    {
+        Text [ en-US ] = "Last Custom Value";
+    };
+
+};
+

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.src
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx?rev=1459509&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.cxx Thu Mar 21 20:23:16 2013
@@ -0,0 +1,505 @@
+/**************************************************************
+ * 
+ * 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_svx.hxx"
+#include "TextCharacterSpacingControl.hxx"
+#include "TextPropertyPanel.hrc"
+#include <sfx2/sidebar/propertypanel.hrc>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <unotools/viewoptions.hxx>
+#include <editeng/kernitem.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/sidebar/Theme.hxx>
+
+namespace svx { namespace sidebar {
+TextCharacterSpacingControl::TextCharacterSpacingControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel)
+:	PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_SPACING))
+,	mrTextPropertyPanel(rPanel)
+,	mpBindings(NULL)
+,	maVSSpacing		(ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING))
+,	maLastCus		(this, SVX_RES(FT_LASTCUSTOM))
+//,	maBorder		(this, SVX_RES(CT_BORDER))
+,	maFTSpacing		(this, SVX_RES(FT_SPACING))
+,	maLBKerning		(this, SVX_RES(LB_KERNING))
+,	maFTBy			(this, SVX_RES(FT_BY))
+,	maEditKerning	(this, SVX_RES(ED_KERNING))
+
+,	mpImg			(NULL)
+,	mpImgSel		(NULL)
+,	mpStr			(NULL)
+,	mpStrTip		(NULL)
+		
+,	maImgCus		(SVX_RES(IMG_CUSTOM))
+,	maImgCusGrey	(SVX_RES(IMG_CUSTOM_GRAY))
+,	maStrCus		(SVX_RES(STR_CUSTOM))
+,	maStrCusE		(SVX_RES(STR_CUSTOM_E_TIP))	//add 
+,	maStrCusC		(SVX_RES(STR_CUSTOM_C_TIP))	//add 
+,	maStrCusN		(SVX_RES(STR_NORMAL_TIP))	//add 
+,	maStrUnit		(SVX_RES(STR_PT))			//add 
+
+,	mnCustomKern(0)
+,	mnLastCus ( SPACING_NOCUSTOM )
+,	mbCusEnable(false)
+,	mbVS(true)
+{
+	initial();
+	FreeResource();
+	mpBindings = mrTextPropertyPanel.GetBindings();
+	Link aLink = LINK(this, TextCharacterSpacingControl, KerningSelectHdl);
+	maLBKerning.SetSelectHdl(aLink);
+	aLink =LINK(this, TextCharacterSpacingControl, KerningModifyHdl);
+	maEditKerning.SetModifyHdl(aLink);
+
+}
+TextCharacterSpacingControl::~TextCharacterSpacingControl()
+{
+	delete[] mpImg;
+	delete[] mpImgSel;
+	delete[] mpStr;
+	delete[] mpStrTip;
+}
+/*void TextCharacterSpacingControl::Paint(const Rectangle& rect)
+{
+	svx::sidebar::PopupControl::Paint(rect);
+	Color aOldLineColor = GetLineColor();
+	Color aOldFillColor = GetFillColor();
+
+	//Point aPos = maBorder.GetPosPixel();	
+	//Size aSize = maBorder.GetSizePixel();
+	Point aPos( LogicToPixel( Point( CUSTOM_X, CUSTOM_Y), MAP_APPFONT ));
+	Size aSize( LogicToPixel( Size(  CUSTOM_WIDTH, CUSTOM_HEIGHT ), MAP_APPFONT ));
+	Rectangle aRect( aPos, aSize );
+	aRect.Left() -= 1;
+	aRect.Top() -= 1;
+	aRect.Right() += 1;
+	aRect.Bottom() += 1;
+
+
+	Color aLineColor(189,201,219);
+	if(!GetSettings().GetStyleSettings().GetHighContrastMode())
+		SetLineColor(aLineColor);
+	else
+		SetLineColor(GetSettings().GetStyleSettings().GetShadowColor());
+	SetFillColor(COL_TRANSPARENT);
+	//add  for high contract
+	//if(GetSettings().GetStyleSettings().GetHighContrastMode())
+	//{
+	//	maBorder.SetBackground(GetSettings().GetStyleSettings().GetMenuColor());
+	//	maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetMenuColor());
+	//	maFTBy.SetBackground(GetSettings().GetStyleSettings().GetMenuColor());
+	//}
+	DrawRect(aRect);
+
+
+	SetLineColor(aOldLineColor);
+	SetFillColor(aOldFillColor);
+}*/
+void TextCharacterSpacingControl::initial()
+{
+	maVSSpacing.SetStyle( maVSSpacing.GetStyle()| WB_3DLOOK |  WB_NO_DIRECTSELECT  );
+	//for high contract
+	//if(GetSettings().GetStyleSettings().GetHighContrastMode())
+	{
+		maVSSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+		GetSettings().GetStyleSettings().GetMenuColor():
+		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+		maVSSpacing.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
+		GetSettings().GetStyleSettings().GetMenuColor():
+		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+		maVSSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+		GetSettings().GetStyleSettings().GetMenuColor():
+		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+		maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+		GetSettings().GetStyleSettings().GetMenuColor():
+		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+		maFTBy.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+		GetSettings().GetStyleSettings().GetMenuColor():
+		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+	}
+	mpImg = new Image[5];
+	mpImg[0] = Image(SVX_RES(IMG_VERY_TIGHT));
+	mpImg[1] = Image(SVX_RES(IMG_TIGHT));
+	mpImg[2] = Image(SVX_RES(IMG_NORMAL));
+	mpImg[3] = Image(SVX_RES(IMG_LOOSE));
+	mpImg[4] = Image(SVX_RES(IMG_VERY_LOOSE));
+
+	mpImgSel = new Image[5];
+	mpImgSel[0] = Image(SVX_RES(IMG_VERY_TIGHT_S));
+	mpImgSel[1] = Image(SVX_RES(IMG_TIGHT_S));
+	mpImgSel[2] = Image(SVX_RES(IMG_NORMAL_S));
+	mpImgSel[3] = Image(SVX_RES(IMG_LOOSE_S));
+	mpImgSel[4] = Image(SVX_RES(IMG_VERY_LOOSE_S));
+
+	mpStr = new XubString[5];
+	mpStr[0] = XubString(SVX_RES(STR_VERY_TIGHT));
+	mpStr[1] = XubString(SVX_RES(STR_TIGHT));
+	mpStr[2] = XubString(SVX_RES(STR_NORMAL));
+	mpStr[3] = XubString(SVX_RES(STR_LOOSE));
+	mpStr[4] = XubString(SVX_RES(STR_VERY_LOOSE));
+	
+
+	mpStrTip = new XubString[5];
+	mpStrTip[0] = XubString(SVX_RES(STR_VERY_TIGHT_TIP));
+	mpStrTip[1] = XubString(SVX_RES(STR_TIGHT_TIP));
+	mpStrTip[2] = XubString(SVX_RES(STR_NORMAL_TIP));
+	mpStrTip[3] = XubString(SVX_RES(STR_LOOSE_TIP));
+	mpStrTip[4] = XubString(SVX_RES(STR_VERY_LOOSE_TIP));
+	//maVSSpacing.SetDefaultTip(mpStr);	//modify
+	//maVSSpacing.SetDefaultTip(mpStrTip, TRUE); //Add
+
+	for (int i=0;i<5;i++)
+		maVSSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
+
+	maVSSpacing.InsertCustom(maImgCus, maImgCusGrey, maStrCus);
+	maVSSpacing.SetCustomTip(maStrCus); //Add
+
+	maVSSpacing.SetSelItem(0);			
+	Link aLink = LINK(this, TextCharacterSpacingControl,VSSelHdl );
+	maVSSpacing.SetSelectHdl(aLink);
+	maVSSpacing.StartSelection();
+	maVSSpacing.Show();
+}
+void TextCharacterSpacingControl::ToGetFocus()
+{
+	if(!mbVS)
+		maLBKerning.GrabFocus();
+	else
+		maVSSpacing.GrabFocus();
+}
+
+void TextCharacterSpacingControl::Rearrange(bool bLBAvailable,bool bAvailable, long nKerning)
+{
+	mbVS = true;
+	maVSSpacing.SetSelItem(0);
+	SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
+    if ( aWinOpt.Exists() )
+	{
+		::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData();
+		::rtl::OUString aTmp;
+		if ( aSeq.getLength())
+			aSeq[0].Value >>= aTmp;
+
+		String aWinData( aTmp );
+		mnCustomKern = aWinData.ToInt32();
+		mnLastCus = SPACING_CLOSE_BY_CUS_EDIT;
+		mbCusEnable = true;
+	}
+	else
+	{
+		mnLastCus = SPACING_NOCUSTOM;
+		mbCusEnable = false;
+	}
+
+	if( !mnLastCus ) 
+	{
+		maVSSpacing.SetCusEnable(false);
+		maVSSpacing.SetCustomTip(maStrCus,true);  //LAST CUSTOM no tip defect //add 
+	}
+	else
+	{
+		//set custom tips
+		maVSSpacing.SetCusEnable(true);
+		if(mnCustomKern > 0)
+		{	
+			String aStrTip( maStrCusE);   //LAST CUSTOM no tip defect //add 
+			aStrTip.Append( String::CreateFromDouble( (double)mnCustomKern / 10));
+			aStrTip.Append(String("pt", 2, RTL_TEXTENCODING_ASCII_US));
+			aStrTip.Append(maStrUnit);		// modify 
+			maVSSpacing.SetCustomTip(aStrTip,true);
+		}
+		else if(mnCustomKern < 0)
+		{	
+			String aStrTip(maStrCusC) ;		//LAST CUSTOM no tip defect //add 
+			aStrTip.Append( String::CreateFromDouble( (double)-mnCustomKern / 10));
+			aStrTip.Append(String("pt", 2, RTL_TEXTENCODING_ASCII_US));
+			aStrTip.Append(maStrUnit);		// modify 
+			maVSSpacing.SetCustomTip(aStrTip,true);
+		}	
+		else
+		{	
+			String aStrTip(maStrCusN) ;		//LAST CUSTOM no tip defect //add 
+			maVSSpacing.SetCustomTip(aStrTip,true);
+		}
+		
+	}
+
+	if(bLBAvailable && bAvailable)
+	{
+		maLBKerning.Enable();
+		maFTSpacing.Enable();
+		
+		SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
+        MapUnit eOrgUnit = (MapUnit)eUnit;
+        MapUnit ePntUnit( MAP_POINT );			
+        long nBig = maEditKerning.Normalize(nKerning);
+        nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit );
+
+		if ( nKerning > 0 )
+        {
+			maFTBy.Enable();
+            maEditKerning.Enable();
+            maEditKerning.SetMax( 9999 );
+            maEditKerning.SetLast( 9999 );
+            maEditKerning.SetValue( nKerning );
+            maLBKerning.SelectEntryPos( SIDEBAR_SPACE_EXPAND );
+			if(nKerning == 30)
+			{
+				maVSSpacing.SetSelItem(4);
+			}
+			else if(nKerning == 60)
+			{
+				maVSSpacing.SetSelItem(5);
+			}
+			else
+			{
+				maVSSpacing.SetSelItem(0);
+				mbVS = false;
+			}
+        }
+        else if ( nKerning < 0 )
+        {
+			maFTBy.Enable();
+            maEditKerning.Enable();
+            maEditKerning.SetValue( -nKerning );
+            maLBKerning.SelectEntryPos( SIDEBAR_SPACE_CONDENSED );
+            long nMax = mrTextPropertyPanel.GetSelFontSize()/6;
+            maEditKerning.SetMax( maEditKerning.Normalize( nMax ), FUNIT_POINT );
+            maEditKerning.SetLast( maEditKerning.GetMax( maEditKerning.GetUnit() ) );
+			if( nKerning == -30 )
+			{
+				maVSSpacing.SetSelItem(1);
+			}
+			else if( nKerning == -15 )
+			{
+				maVSSpacing.SetSelItem(2);
+			}
+			else
+			{
+				maVSSpacing.SetSelItem(0);
+				mbVS = false;
+			}
+        }
+        else
+        {
+			maVSSpacing.SetSelItem(3);
+			maLBKerning.SelectEntryPos( SIDEBAR_SPACE_NORMAL );
+			maFTBy.Disable();
+            maEditKerning.Disable();
+            maEditKerning.SetValue( 0 );
+            maEditKerning.SetMax( 9999 );
+            maEditKerning.SetLast( 9999 );
+        }
+	}
+	else if(bLBAvailable && !bAvailable)
+	{	
+		//modified 
+		maVSSpacing.SetSelItem(0);
+		mbVS = false;
+		maLBKerning.Enable();
+		maFTSpacing.Enable();
+		maLBKerning.SetNoSelection();
+		maEditKerning.SetText(String());
+		maEditKerning.Disable();
+		maFTBy.Disable();
+	}
+	else
+	{
+		maVSSpacing.SetSelItem(0);
+		mbVS = false;
+		maEditKerning.SetText(String());
+        maLBKerning.SetNoSelection();
+		maLBKerning.Disable();
+		maFTSpacing.Disable();
+        maEditKerning.Disable();
+		maFTBy.Disable();
+	}
+	GetFocus();
+	maVSSpacing.Format();
+	maVSSpacing.StartSelection();
+}
+IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
+{
+	mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+
+	if(pControl == &maVSSpacing)  
+	{		
+		sal_uInt16 iPos = maVSSpacing.GetSelectItemId();
+		short nKern = 0;
+		SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
+		long nVal = 0;
+		if(iPos == 1)
+		{
+			nVal = LogicToLogic(30, MAP_POINT, (MapUnit)eUnit);
+			nKern = (short)maEditKerning.Denormalize(nVal);
+			SvxKerningItem aKernItem(-nKern, SID_ATTR_CHAR_KERNING);
+			mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+			mrTextPropertyPanel.SetSpacing(-nKern);
+			mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+		}
+		else if(iPos == 2)
+		{
+			nVal = LogicToLogic(15, MAP_POINT, (MapUnit)eUnit);
+			nKern = (short)maEditKerning.Denormalize(nVal);
+			SvxKerningItem aKernItem(-nKern, SID_ATTR_CHAR_KERNING);
+			mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+			mrTextPropertyPanel.SetSpacing(-nKern);
+			mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+		}
+		else if(iPos == 3)
+		{
+			SvxKerningItem aKernItem(0, SID_ATTR_CHAR_KERNING);
+			mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+			mrTextPropertyPanel.SetSpacing(0);
+			mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+		}
+		else if(iPos == 4)
+		{
+			nVal = LogicToLogic(30, MAP_POINT, (MapUnit)eUnit);
+			nKern = (short)maEditKerning.Denormalize(nVal);
+			SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
+			mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+			mrTextPropertyPanel.SetSpacing(nKern);
+			mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+		}
+		else if(iPos == 5)
+		{
+			nVal = LogicToLogic(60, MAP_POINT, (MapUnit)eUnit);
+			nKern = (short)maEditKerning.Denormalize(nVal);
+			SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
+			mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+			mrTextPropertyPanel.SetSpacing(nKern);
+			mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+		}
+		else if(iPos == 6)
+		{
+			//modified 
+			if(mbCusEnable)
+			{
+				nVal = LogicToLogic(mnCustomKern, MAP_POINT, (MapUnit)eUnit);
+				nKern = (short)maEditKerning.Denormalize(nVal);
+				SvxKerningItem aKernItem(nKern , SID_ATTR_CHAR_KERNING);
+				mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+				mrTextPropertyPanel.SetSpacing(nKern);
+				mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
+			}
+			else
+			{
+				maVSSpacing.SetNoSelection();		//add , set no selection and keep the last select item 
+				maVSSpacing.Format();
+				Invalidate();
+				maVSSpacing.StartSelection();
+			}
+			//modify end
+		}
+		
+		if(iPos < 6 || (iPos == 6 && mbCusEnable)) //add 
+			mrTextPropertyPanel.EndSpacingPopupMode();
+	}
+
+
+		
+	return 0;
+}
+
+IMPL_LINK(TextCharacterSpacingControl, KerningSelectHdl, ListBox*, EMPTYARG)
+{
+	if ( maLBKerning.GetSelectEntryPos() > 0 )
+	{
+		maFTBy.Enable();
+		maEditKerning.Enable();
+	}
+	else
+	{
+		maEditKerning.SetValue( 0 );
+		maFTBy.Disable();
+		maEditKerning.Disable();
+	}
+
+	if(maVSSpacing.GetSelItem())
+	{
+		maVSSpacing.SetSelItem(0);	//modify 
+		maVSSpacing.Format();
+		Invalidate();
+		maVSSpacing.StartSelection();
+	}
+	KerningModifyHdl( NULL );
+	return 0;
+}
+IMPL_LINK(TextCharacterSpacingControl, KerningModifyHdl, MetricField*, EMPTYARG)
+{
+	if(maVSSpacing.GetSelItem())
+	{
+		maVSSpacing.SetSelItem(0);	//modify 
+		maVSSpacing.Format();
+		Invalidate();
+		maVSSpacing.StartSelection();
+	}
+	sal_uInt16 nPos = maLBKerning.GetSelectEntryPos();
+    short nKern = 0;
+    SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
+	mnLastCus = SPACING_CLOSE_BY_CUS_EDIT; 
+	if ( nPos == SIDEBAR_SPACE_EXPAND || nPos == SIDEBAR_SPACE_CONDENSED )
+    {
+        long nTmp = static_cast<long>(maEditKerning.GetValue());
+        if ( nPos == SIDEBAR_SPACE_CONDENSED )
+		{
+			long nMax =  mrTextPropertyPanel.GetSelFontSize()/6;
+			maEditKerning.SetMax( maEditKerning.Normalize( nMax ), FUNIT_TWIP );
+			maEditKerning.SetLast( maEditKerning.GetMax( maEditKerning.GetUnit() ) );
+			if(nTmp > maEditKerning.GetMax())
+				nTmp = maEditKerning.GetMax();
+			mnCustomKern = -nTmp;
+			long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
+			nKern = (short)maEditKerning.Denormalize( nVal );
+            nKern *= - 1;		
+		}
+		else
+		{
+			maEditKerning.SetMax( 9999 );
+			maEditKerning.SetLast( 9999 );
+			if(nTmp > maEditKerning.GetMax(FUNIT_TWIP))
+				nTmp = maEditKerning.GetMax(FUNIT_TWIP);
+			mnCustomKern = nTmp;
+			long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
+			nKern = (short)maEditKerning.Denormalize( nVal );	
+		}
+    }
+	else
+	{
+		mnCustomKern = 0;
+	}
+	SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
+	mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SFX_CALLMODE_RECORD, &aKernItem, 0L);
+	mrTextPropertyPanel.SetSpacing(nKern);
+	return 0;
+}
+short  TextCharacterSpacingControl::GetLastCustomState()
+{
+	return mnLastCus;
+}
+long  TextCharacterSpacingControl::GetLastCustomValue()
+{
+	return mnCustomKern;
+}
+
+}} // end of namespace sidebar

Added: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx?rev=1459509&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx Thu Mar 21 20:23:16 2013
@@ -0,0 +1,96 @@
+/**************************************************************
+ * 
+ * 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 _SVX_SIDEBAR_CHARACTER_SPACING_CONTROL_HXX_
+#define _SVX_SIDEBAR_CHARACTER_SPACING_CONTROL_HXX_
+ 
+#include "svx/sidebar/PopupControl.hxx"
+#include "svx/sidebar/ValueSetWithTextControl.hxx"
+#include <sfx2/bindings.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <svtools/ctrltool.hxx>
+#include "TextPropertyPanel.hxx"
+#include <vcl/fixed.hxx>
+
+
+namespace svx { namespace sidebar {
+#define SPACING_NOCUSTOM				0
+#define SPACING_CLOSE_BY_CLICK_ICON		-1
+#define SPACING_CLOSE_BY_CUS_EDIT		1
+
+#define SIDEBAR_SPACING_GLOBAL_VALUE	String("PopupPanal_Spacing", 18, RTL_TEXTENCODING_ASCII_US)
+
+#define SIDEBAR_SPACE_NORMAL	0
+#define SIDEBAR_SPACE_EXPAND	1
+#define SIDEBAR_SPACE_CONDENSED	2
+class TextCharacterSpacingControl:public svx::sidebar::PopupControl
+{
+public:
+	TextCharacterSpacingControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel);
+	~TextCharacterSpacingControl();
+	void ToGetFocus();
+	void Rearrange(bool bLBAvailable,bool bAvailable, long nKerning);
+	//virtual void Paint(const Rectangle& rect);
+	
+	//add 
+	short GetLastCustomState();
+	long  GetLastCustomValue();
+	//add end
+
+private:	
+	svx::sidebar::TextPropertyPanel&     mrTextPropertyPanel;
+	SfxBindings*		mpBindings;
+
+	ValueSetWithTextControl	maVSSpacing;
+
+	FixedText			maLastCus;
+//	Control				maBorder;
+
+	FixedText			maFTSpacing;
+	ListBox				maLBKerning;
+	FixedText			maFTBy;
+	MetricField			maEditKerning;
+
+	Image*				mpImg;
+	Image*				mpImgSel;
+	XubString*			mpStr;
+	XubString*			mpStrTip;
+
+	Image				maImgCus;
+	Image				maImgCusGrey;
+	XubString			maStrCus;
+	XubString			maStrCusE;		//add 
+	XubString			maStrCusC;		//add 
+	XubString			maStrCusN;		//add 
+	XubString			maStrUnit;		//add 
+
+	long				mnCustomKern;
+	short				mnLastCus;		
+	bool				mbCusEnable;
+	bool				mbVS;
+
+	void initial();
+	DECL_LINK(VSSelHdl, void*);
+	DECL_LINK(KerningSelectHdl, ListBox*);
+	DECL_LINK(KerningModifyHdl,  MetricField*);
+};
+}}
+
+#endif

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx?rev=1459509&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx Thu Mar 21 20:23:16 2013
@@ -0,0 +1,79 @@
+/**************************************************************
+ * 
+ * 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 "TextCharacterSpacingPopup.hxx"
+#include "TextCharacterSpacingControl.hxx"
+#include <boost/bind.hpp>
+#include <unotools/viewoptions.hxx>
+
+namespace svx { namespace sidebar {
+
+TextCharacterSpacingPopup::TextCharacterSpacingPopup (
+    Window* pParent,
+    const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator)
+    : Popup(
+        pParent,
+        rControlCreator, 
+        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Character Spacing")))
+{
+	SetPopupModeEndHandler(::boost::bind(&TextCharacterSpacingPopup::PopupModeEndCallback, this));
+}
+
+
+
+
+TextCharacterSpacingPopup::~TextCharacterSpacingPopup (void)
+{
+}
+
+
+
+
+void TextCharacterSpacingPopup::Rearrange (bool bLBAvailable,bool bAvailable, long nKerning)
+{
+    ProvideContainerAndControl();
+
+    TextCharacterSpacingControl* pControl = dynamic_cast<TextCharacterSpacingControl*>(mpControl.get());
+    if (pControl != NULL)
+        pControl->Rearrange(bLBAvailable,bAvailable,nKerning);	
+}
+
+void TextCharacterSpacingPopup::PopupModeEndCallback (void)
+{
+	ProvideContainerAndControl();
+	TextCharacterSpacingControl* pControl = dynamic_cast<TextCharacterSpacingControl*>(mpControl.get());
+	if (pControl == NULL)
+		return;
+	
+	if( pControl->GetLastCustomState() == SPACING_CLOSE_BY_CUS_EDIT)
+	{
+		SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
+		::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
+		aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Spacing") ); 
+		aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt32( pControl->GetLastCustomValue() ));
+		aWinOpt.SetUserData( aSeq );
+
+	}
+}
+
+
+} } // end of namespace svx::sidebar
+

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx?rev=1459509&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx Thu Mar 21 20:23:16 2013
@@ -0,0 +1,48 @@
+/**************************************************************
+ * 
+ * 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 _SVX_SIDEBAR_CHARACTER_SPACING_POPUP_HXX_
+#define _SVX_SIDEBAR_CHARACTER_SPACING_POPUP_HXX_
+
+#include "svx/sidebar/Popup.hxx"
+
+#include <boost/function.hpp>
+
+namespace svx { namespace sidebar {
+
+class TextCharacterSpacingPopup
+    : public Popup
+{
+public :
+    TextCharacterSpacingPopup (
+        Window* pParent,
+        const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator);
+    ~TextCharacterSpacingPopup (void);
+
+    void Rearrange (bool bLBAvailable,bool bAvailable, long nKerning);
+private:
+    void PopupModeEndCallback (void);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif
+

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
------------------------------------------------------------------------------
    svn:executable = *

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.cxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.cxx Thu Mar 21 20:23:16 2013
@@ -52,6 +52,17 @@
 #include <vcl/gradient.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/toolbox.hxx>
+#include "TextCharacterSpacingControl.hxx"
+#include "TextCharacterSpacingPopup.hxx"
+#include "TextUnderlineControl.hxx"
+#include "TextUnderlinePopup.hxx"
+//#include "SvxTextUnderlinePage.hxx"
+//#include "SvxTextFontColorPage.hxx"
+#include "sidebar/ColorControl.hxx"
+#include "svx/sidebar/PopupContainer.hxx"
+
+
+#include <boost/bind.hpp>
 
 using namespace css;
 using namespace cssu;
@@ -69,21 +80,58 @@ namespace svx { namespace sidebar {
 #define SIZE_CONTROL_WIDTH 		80
 #define CONTROL_COMBOX_HEIGHT	20
 #define CONTROL_HEIGHT_5X  		120
-#define SIDEBAR_SPACE_NORMAL	0
-#define SIDEBAR_SPACE_EXPAND	1
-#define SIDEBAR_SPACE_CONDENSED	2
-#define SIDEBAR_SPACING_GLOBAL_VALUE	String("PopupPanal_Spacing", 18, RTL_TEXTENCODING_ASCII_US)
+
+
 #define TEXT_SECTIONPAGE_HEIGHT_S   SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT  + ( TOOLBOX_ITEM_HEIGHT + 2 ) + CONTROL_SPACING_VERTICAL * 1 + SECTIONPAGE_MARGIN_VERTICAL_BOT
 #define TEXT_SECTIONPAGE_HEIGHT		SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT  + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT
 
 //
-#define SPACING_NOCUSTOM				0
-#define SPACING_CLOSE_BY_CLICK_ICON		-1
-#define SPACING_CLOSE_BY_CUS_EDIT		1
+
 //end
+PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
+{
+    return new TextCharacterSpacingControl(pParent, *this);
+}
 
+PopupControl* TextPropertyPanel::CreateUnderlinePopupControl (PopupContainer* pParent)
+{
+	return new TextUnderlineControl(pParent, *this);
+}
 
+PopupControl* TextPropertyPanel::CreateFontColorPopupControl (PopupContainer* pParent)
+{
+    return new ColorControl(
+        pParent,
+        mpBindings,
+        SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
+        SVX_RES(VS_FONT_COLOR),
+        ::boost::bind(&TextPropertyPanel::GetFontColor, this),
+        ::boost::bind(&TextPropertyPanel::SetFontColor, this, _1,_2),
+        pParent,
+        0);
+}
 
+PopupControl* TextPropertyPanel::CreateBrushColorPopupControl (PopupContainer* pParent)
+{
+    return new ColorControl(
+        pParent,
+        mpBindings,
+        SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
+        SVX_RES(VS_FONT_COLOR),
+        ::boost::bind(&TextPropertyPanel::GetBrushColor, this),
+        ::boost::bind(&TextPropertyPanel::SetBrushColor, this, _1,_2),
+        pParent,
+        0);
+}
+
+long TextPropertyPanel::GetSelFontSize()
+{
+    long nH = 240;
+    SfxMapUnit eUnit = maSpacingControl.GetCoreMetric();
+    if (mpHeightItem)
+        nH = LogicToLogic(  mpHeightItem->GetHeight(), (MapUnit)eUnit, MAP_TWIP );
+    return nH;
+} 
 
 
 TextPropertyPanel* TextPropertyPanel::Create (
@@ -105,7 +153,10 @@ TextPropertyPanel* TextPropertyPanel::Cr
 }
 
 
-
+::sfx2::sidebar::ControllerItem& TextPropertyPanel::GetSpaceController()
+{
+	return maSpacingControl;
+}
 
 TextPropertyPanel::TextPropertyPanel (
     Window* pParent,
@@ -142,6 +193,10 @@ TextPropertyPanel::TextPropertyPanel (
         mpToolBoxHighlight(ControlFactory::CreateToolBox(
                 mpToolBoxHighlightBackground.get(),
                 SVX_RES(TB_HIGHLIGHT))),
+	maCharSpacePopup(this, ::boost::bind(&TextPropertyPanel::CreateCharacterSpacingControl, this, _1)),
+	maFontColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateFontColorPopupControl, this, _1)),
+	maBrushColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateBrushColorPopupControl, this, _1)),
+	maUnderlinePopup(this, ::boost::bind(&TextPropertyPanel::CreateUnderlinePopupControl, this, _1)),
         mpFontColorUpdater(),
         mpHighlightUpdater(),
 
@@ -190,14 +245,6 @@ TextPropertyPanel::TextPropertyPanel (
         mpFontList			(NULL),
         mbMustDelete		(false),
         mbFocusOnFontSizeCtrl(false),
-        /*AF
-        mpFloatWinUnderline(NULL),
-        mpPageUnderline(NULL),
-        mpFloatWinFontColor(NULL),
-        mpPageFontColor(NULL),
-        mpFloatWinSpacing(NULL),
-        mpPageSpacing(NULL)
-        */
         mxFrame(rxFrame),
         maContext(),
         mpBindings(pBindings)
@@ -256,6 +303,10 @@ Image TextPropertyPanel::GetIcon (const 
 }
 
 
+void TextPropertyPanel::SetSpacing(long nKern)
+{
+	mlKerning = nKern;
+}
 
 
 void TextPropertyPanel::HandleContextChange (
@@ -349,7 +400,10 @@ void TextPropertyPanel::HandleContextCha
     }
 }
 
-
+SfxBindings* TextPropertyPanel::GetBindings() 
+{ 
+    return mpBindings; 
+}
 
 
 void TextPropertyPanel::DataChanged (const DataChangedEvent& rEvent)
@@ -392,17 +446,17 @@ void TextPropertyPanel::Initialize (void
     InitToolBoxHighlight();
 
 #ifdef HAS_IA2
-    mpFontNameBox->SetAccRelationLabeledBy(&maFontNameBox);
-    mpFontNameBox->SetMpSubEditAccLableBy(&maFontNameBox);
+    mpFontNameBox->SetAccRelationLabeledBy(&mpFontNameBox);
+    mpFontNameBox->SetMpSubEditAccLableBy(&mpFontNameBox);
     maFontSizeBox.SetAccRelationLabeledBy(&maFontSizeBox);
     maFontSizeBox.SetMpSubEditAccLableBy(&maFontSizeBox);
-    maToolBoxFont.SetAccRelationLabeledBy(&maToolBoxFont);
-    maToolBoxIncDec.SetAccRelationLabeledBy(&maToolBoxIncDec);
-    maToolBoxFontColor.SetAccRelationLabeledBy(&maToolBoxFontColor);
-    maToolBoxScript.SetAccRelationLabeledBy(&maToolBoxScript);
-    maToolBoxScriptSw.SetAccRelationLabeledBy(&maToolBoxScriptSw);
-    maToolBoxSpacing.SetAccRelationLabeledBy(&maToolBoxSpacing);
-    maToolBoxHighlight.SetAccRelationLabeledBy(&maToolBoxHighlight);
+    mpToolBoxFont.SetAccRelationLabeledBy(&mpToolBoxFont);
+    mpToolBoxIncDec.SetAccRelationLabeledBy(&mpToolBoxIncDec);
+    mpToolBoxFontColor.SetAccRelationLabeledBy(&mpToolBoxFontColor);
+    mpToolBoxScript.SetAccRelationLabeledBy(&mpToolBoxScript);
+    mpToolBoxScriptSw.SetAccRelationLabeledBy(&mpToolBoxScriptSw);
+    mpToolBoxSpacing.SetAccRelationLabeledBy(&mpToolBoxSpacing);
+    mpToolBoxHighlight.SetAccRelationLabeledBy(&mpToolBoxHighlight);
 #endif
 
     //init state
@@ -464,7 +518,15 @@ void TextPropertyPanel::Initialize (void
     //end
 }
 
+void TextPropertyPanel::EndSpacingPopupMode (void)
+{
+    maCharSpacePopup.Hide();
+}
 
+void TextPropertyPanel::EndUnderlinePopupMode (void)
+{
+	maUnderlinePopup.Hide();
+}
 
 
 void TextPropertyPanel::InitToolBoxFont()
@@ -881,30 +943,18 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncD
 
 
 
-
 IMPL_LINK(TextPropertyPanel, ToolBoxUnderlineClickHdl, ToolBox*, pToolBox)
 {
 	const sal_uInt16 nId = pToolBox->GetCurItemId();
+	OSL_ASSERT(nId == TBI_UNDERLINE);
 	if(nId == TBI_UNDERLINE)
 	{
 		pToolBox->SetItemDown( nId, true );
+		maUnderlinePopup.Rearrange(meUnderline);
+		maUnderlinePopup.Show(*pToolBox);
 
-        /**AF
-		SvxTextUnderlinePage* pUnderlinePage = GetUnderlinePage();
-		Size aFloatSz = pUnderlinePage->GetOutputSizePixel();
-		GetUnderlineFloatWin()->SetSizePixel( aFloatSz );
-
-		Point aPos = mpToolBoxFont->GetPosPixel();
-		aPos = OutputToScreenPixel( aPos );
-		Size aSize = mpToolBoxFont->GetSizePixel();
-		Rectangle aRect( aPos, aSize );
-
-		GetUnderlineFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
-		GetUnderlineFloatWin()->SetPopupModeFlags(GetUnderlineFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-		pUnderlinePage->SetUnderlineSelect(meUnderline);
-        */
 	}
-	return 0;
+	return 0L;
 }
 
 
@@ -919,23 +969,9 @@ IMPL_LINK(TextPropertyPanel, ToolBoxFont
 
 		pToolBox->SetItemDown( nId, true );
 
-        /*AF
-		SvxTextFontColorPage* pFontColorPage = GetFontColorPage();
-	
-		Size aFloatSz = pFontColorPage->GetOutputSizePixel();
-		GetFontColorFloatWin()->SetSizePixel( aFloatSz );
-
-		Point aPos = mpToolBoxFontColor->GetPosPixel();
-		aPos = OutputToScreenPixel( aPos );
-		Size aSize = mpToolBoxFontColor->GetSizePixel();
-		Rectangle aRect( aPos, aSize );
-
-		GetFontColorFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
-		GetFontColorFloatWin()->SetPopupModeFlags(GetFontColorFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-
-		pFontColorPage->GetFocus();
-		pFontColorPage->SetCurColorSelect(maColor, mbColorAvailable);
-        */
+		//pToolBox->SetItemDown( nId, true );
+		maFontColorPopup.Show(*pToolBox);
+		maFontColorPopup.SetCurrentColor(maColor, mbColorAvailable);
 	}
 	return 0;
 }
@@ -1015,57 +1051,27 @@ IMPL_LINK(TextPropertyPanel, ToolBoxHigh
 		meColorType = BACK_COLOR;
 
 		pToolBox->SetItemDown( nId, true );
+		maBrushColorPopup.Show(*pToolBox);
+		maBrushColorPopup.SetCurrentColor(maBackColor, mbBackColorAvailable);
 
-        /*AF
-		SvxTextFontColorPage* pFontColorPage = GetFontColorPage();
-
-		Size aFloatSz = pFontColorPage->GetOutputSizePixel();
-		GetFontColorFloatWin()->SetSizePixel( aFloatSz );
-
-		Point aPos = mpToolBoxHighlight->GetPosPixel();
-		aPos = OutputToScreenPixel( aPos );
-		Size aSize = mpToolBoxHighlight->GetSizePixel();
-		Rectangle aRect( aPos, aSize );
-
-		GetFontColorFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
-		GetFontColorFloatWin()->SetPopupModeFlags(GetFontColorFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-
-		pFontColorPage->GetFocus();
-		pFontColorPage->SetCurColorSelect(maBackColor,
-		mbBackColorAvailable);
-        */
 	}
 	return 0;
 }
 
 
 
-
 IMPL_LINK(TextPropertyPanel, SpacingClickHdl, ToolBox*, pToolBox)
 {
 	const sal_uInt16 nId = pToolBox->GetCurItemId();
+	OSL_ASSERT(nId == TBI_SPACING);
 	if(nId == TBI_SPACING)
 	{
 		pToolBox->SetItemDown( nId, true );
+		maCharSpacePopup.Rearrange(mbKernLBAvailable,mbKernAvailable,mlKerning);
+		maCharSpacePopup.Show(*pToolBox);
 
-        /*AF
-		SvxTextSpacingPage* pSpacingPage = GetSpacingPage();
-		pSpacingPage->SetControlState(mbKernLBAvailable,mbKernAvailable,mlKerning);
-
-		Size aFloatSz = pSpacingPage->GetOutputSizePixel();
-		GetSpacingFloatWin()->SetSizePixel( aFloatSz );
-
-		Point aPos = mpToolBoxSpacing->GetPosPixel();
-		aPos = OutputToScreenPixel( aPos );
-		Size aSize = mpToolBoxSpacing->GetSizePixel();
-		Rectangle aRect( aPos, aSize );
-
-		GetSpacingFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN );
-		GetSpacingFloatWin()->SetPopupModeFlags(GetSpacingFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-		pSpacingPage->GetFocus();
-        */
 	}
-	return 0;
+	return 0L;
 }
 
 
@@ -1079,24 +1085,19 @@ IMPL_LINK( TextPropertyPanel, ImplPopupM
 
 
 
-IMPL_LINK( TextPropertyPanel, ImplSpacingPopupModeEndHdl, FloatingWindow*, EMPTYARG )
+/*IMPL_LINK( TextPropertyPanel, ImplSpacingPopupModeEndHdl, FloatingWindow*, EMPTYARG )
 {
-    /*AF
-	if(mpPageSpacing)
+	if( maCharSpacePopup.GetLastCustomState() == SPACING_CLOSE_BY_CUS_EDIT)
 	{
-		if( mpPageSpacing->GetLastCustomState() == SPACING_CLOSE_BY_CUS_EDIT)
-		{
-			SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
-			::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
-			aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Spacing") ); 
-			aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt32( mpPageSpacing->GetLastCustomValue() ));
-			aWinOpt.SetUserData( aSeq );
+		SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
+		::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
+		aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Spacing") ); 
+		aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt32( maCharSpacePopup.GetLastCustomValue() ));
+		aWinOpt.SetUserData( aSeq );
 
-		}
 	}
-    */
 	return 0;
-}
+}*/
 
 
 
@@ -1300,8 +1301,8 @@ void TextPropertyPanel::NotifyItemUpdate
         case SID_ATTR_CHAR_COLOR:
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxColorItem))
             {
-                const SvxBrushItem* pItem =  (const SvxBrushItem*)pState;
-                maColor = pItem->GetColor();
+                const SvxColorItem* pItem =  (const SvxColorItem*)pState;
+                maColor = pItem->GetValue();
                 mbColorAvailable = true;
 				if (mpFontColorUpdater)
 	                mpFontColorUpdater->Update(maColor);
@@ -1574,6 +1575,44 @@ void  TextPropertyPanel::UpdateFontScrip
 	}
 }
 
+Color TextPropertyPanel::GetFontColor (void) const
+{
+    return maColor;
+}
+
+void TextPropertyPanel::SetFontColor (
+    const String& rsColorName,
+    const Color aColor)
+{
+	SvxColorItem aColorItem(aColor, SID_ATTR_CHAR_COLOR);
+	mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L);
+	maColor = aColor;
+}
+
+Color TextPropertyPanel::GetBrushColor (void) const
+{
+    return maBackColor;
+}
+
+void TextPropertyPanel::SetBrushColor (
+    const String& rsColorName,
+    const Color aColor)
+{
+	SvxBrushItem aBrushItem(aColor, SID_ATTR_BRUSH_CHAR);
+	mpBindings->GetDispatcher()->Execute(SID_ATTR_BRUSH_CHAR, SFX_CALLMODE_RECORD, &aBrushItem, 0L);
+	maBackColor = aColor;
+}
+
+Color& TextPropertyPanel::GetUnderlineColor() 
+{
+	return meUnderlineColor;
+}
+
+void TextPropertyPanel::SetUnderline(FontUnderline	eUnderline)
+{
+	meUnderline = eUnderline;
+}
+
 /*
 USHORT TextPropertyPanel::GetCurrColorType()
 {
@@ -1593,10 +1632,7 @@ SfxPropertyPageController TextPropertyPa
 }
 
 //add 
-Color& TextPropertyPanel::GetUnderlineColor() 
-{
-	return meUnderlineColor;
-}
+
 //add end
 void TextPropertyPanel::SetBackColor(Color aCol)
 {
@@ -1606,10 +1642,7 @@ void TextPropertyPanel::SetColor(Color a
 {
 	maColor = aCol;
 }
-void TextPropertyPanel::SetUnderline(FontUnderline	eUnderline)
-{
-	meUnderline = eUnderline;
-}
+
 void TextPropertyPanel::SetSpacing(long nKern)
 {
 	mlKerning = nKern;

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hrc?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hrc (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hrc Thu Mar 21 20:23:16 2013
@@ -26,7 +26,8 @@
 #define CUSTOM_WIDTH			VS_SPACING_WIDTH - 8
 #define CUSTOM_X				POPUPPANEL_MARGIN_LARGE + OFFSET_X + 1
 #define CUSTOM_Y				OFFSET_Y + POPUPPANEL_MARGIN_SMALL * 3 + 15 * 6 + TEXT_HEIGHT
-
+#define VS_UNDERLINE_WIDTH	57
+#define VS_UNDERLINE_HEIGHT	 12 * 10
 //#define FT_TEST					1
 #define CB_SBFONT_FONT			2
 #define MB_SBFONT_FONTSIZE		3
@@ -81,15 +82,11 @@
 
 #define IMG_SPACING_D				71
 
-#define STR_QH_BOLD				72
-#define STR_QH_ITALIC			73
-#define STR_QH_UNDERLINE		74
-
 //popup window underline
 #define	VS_UNDERLINE			1
 #define PB_OPTIONS				2
-// #define BMP_UNDERLINE_MORE		3
-// #define BMP_UNDERLINE_MORE_H	4	
+#define BMP_UNDERLINE_MORE		3
+#define BMP_UNDERLINE_MORE_H	4	
 
 #define IMG_SINGLE				10
 #define IMG_DOUBLE				11
@@ -180,6 +177,9 @@
 #define STR_CUSTOM_C_TIP			72
 #define STR_CUSTOM_E_TIP			73
 #define STR_PT						74
+#define STR_QH_BOLD				75
+#define STR_QH_ITALIC			76
+#define STR_QH_UNDERLINE		77
 
 //help ids
 #define	HID_COMBO_FONT_NAME				"SVX_HID_COMBO_FONT_NAME"

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hxx?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hxx (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.hxx Thu Mar 21 20:23:16 2013
@@ -35,7 +35,10 @@
 #include <com/sun/star/ui/XUIElement.hpp>
 
 #include <boost/scoped_ptr.hpp>
-
+#include "TextCharacterSpacingPopup.hxx"
+#include "TextUnderlinePopup.hxx"
+#include "sidebar/ColorPopup.hxx"
+#include <vcl/vclenum.hxx>
 
 class FloatingWindow;
 class ToolBox;
@@ -43,10 +46,12 @@ class ToolBox;
 namespace svx { namespace sidebar {
 
 class SvxSBFontNameBox;
+class PopupControl;
+class PopupContainer;
 
 class TextPropertyPanel
     : public Control,
-      public ::sfx2::sidebar::IContextChangeReceiver,
+       public ::sfx2::sidebar::IContextChangeReceiver,
       public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
 {
 public:
@@ -56,13 +61,26 @@ public:
         SfxBindings* pBindings);
 
     virtual void DataChanged (const DataChangedEvent& rEvent);
+    SfxBindings* GetBindings();
+    ::sfx2::sidebar::ControllerItem& GetSpaceController();
+    long GetSelFontSize();
+    void SetSpacing(long nKern);
+    void EndSpacingPopupMode (void);
+    void EndUnderlinePopupMode (void);
+	Color GetFontColor (void) const;
+	void SetFontColor (const String& rsColorName,const Color aColor);
+	Color GetBrushColor (void) const;
+	void SetBrushColor (const String& rsColorName,const Color aColor);
+	void SetUnderline(FontUnderline	eUnderline);
+	Color& GetUnderlineColor(); 
+	void SetDefaultUnderline(FontUnderline eUnderline);
 
-    //	void SetDefaultUnderline(FontUnderline eUnderline);
+    //	
     //	USHORT GetCurrColorType();
 
     //	void SetBackColor(Color aCol);
     //	void SetColor(Color aCol);
-    //	void SetUnderline(FontUnderline	eUnderline);
+    //	
     //	void SetSpacing(long nKern);
 
     /*
@@ -78,9 +96,11 @@ public:
     //	long GetSelFontSize();
     //	SfxPropertyPageController GetSpaceController();
 //	ToolBox* GetSpacingTB();		//removed
-    //	Color& GetUnderlineColor();  //
+    //	 //
 //	void FontListChanged();
 
+
+
     enum ColorType
     {
         FONT_COLOR = 1,
@@ -185,6 +205,10 @@ private:
 	const FontList* mpFontList;
 	bool mbMustDelete;
 	bool mbFocusOnFontSizeCtrl;
+	TextCharacterSpacingPopup maCharSpacePopup;
+	TextUnderlinePopup maUnderlinePopup;
+	ColorPopup maFontColorPopup; 
+	ColorPopup maBrushColorPopup; 
 
     cssu::Reference<css::frame::XFrame> mxFrame;
     ::sfx2::sidebar::EnumContext maContext;
@@ -194,7 +218,17 @@ private:
         Window* pParent,
         const cssu::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
-    virtual ~TextPropertyPanel (void);
+	virtual ~TextPropertyPanel (void);
+
+	
+	PopupControl* CreateCharacterSpacingControl (PopupContainer* pParent);
+	DECL_LINK(SpacingClickHdl, ToolBox*);
+	PopupControl* CreateFontColorPopupControl (PopupContainer* pParent);
+	PopupControl* CreateBrushColorPopupControl (PopupContainer* pParent);
+	PopupControl* CreateUnderlinePopupControl (PopupContainer* pParent);
+	DECL_LINK(ToolBoxFontColorDropHdl, ToolBox *); //for new color picker 
+	DECL_LINK(ToolBoxHighlightDropHdl, ToolBox *);
+	DECL_LINK(ToolBoxUnderlineClickHdl, ToolBox* );
 
 	void Initialize (void);
     void SetupIcons (void);
@@ -231,14 +265,11 @@ private:
 	DECL_LINK(FontSizeLoseFocus, FontSizeBox *);
 	DECL_LINK(ToolboxFontSelectHandler, ToolBox *);
 	DECL_LINK(ToolboxIncDecSelectHdl, ToolBox *);
-	DECL_LINK(ToolBoxUnderlineClickHdl, ToolBox* );
 	DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* );
-	DECL_LINK(ImplSpacingPopupModeEndHdl, FloatingWindow* );  //
-	DECL_LINK(ToolBoxFontColorDropHdl, ToolBox *);
 	DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *);
 	DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *);
-	DECL_LINK(SpacingClickHdl, ToolBox*);
-	DECL_LINK(ToolBoxHighlightDropHdl, ToolBox *);
+	
+	
 
 	void TextStyleChanged();
 

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.src?rev=1459509&r1=1459508&r2=1459509&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.src (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/text/TextPropertyPanel.src Thu Mar 21 20:23:16 2013
@@ -388,14 +388,14 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLIN
 	DialogControl = TRUE;
 	Border = FALSE;
 	
-	Size = MAP_APPFONT(  POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH ,  13 + POPUP_BORDER_HEIGHT + POPUPPANEL_MARGIN_SMALL * 2 + POPUPPANEL_MARGIN_LARGE);
+	Size = MAP_APPFONT(  POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_UNDERLINE_WIDTH,  13+ VS_UNDERLINE_HEIGHT + POPUP_BORDER_HEIGHT + POPUPPANEL_MARGIN_SMALL * 2 + POPUPPANEL_MARGIN_LARGE);
 	Control VS_UNDERLINE
 	{
 //		HelpID = HID_UNDERLINE_VS ;
 		HelpID = HID_PPROPERTYPANEL_TEXT_UNDERLINE_VS;
         Hide = TRUE ;
         Pos = MAP_APPFONT(  POPUPPANEL_MARGIN_SMALL + OFFSET_X , POPUPPANEL_MARGIN_SMALL + OFFSET_Y ); 
-        Size = MAP_APPFONT ( 97  , 12 * 10);
+        Size = MAP_APPFONT ( VS_UNDERLINE_WIDTH  ,VS_UNDERLINE_HEIGHT);
 		TabStop = TRUE ;
 		Text = "Underline";
 	};
@@ -403,8 +403,8 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLIN
 	PushButton PB_OPTIONS
 	{
 		HelpID = HID_UNDERLINE_BTN;
-		Pos = MAP_APPFONT (  POPUPPANEL_MARGIN_LARGE  , POPUPPANEL_MARGIN_SMALL * 2 + OFFSET_Y  ); 
-		Size = MAP_APPFONT ( POPUPPANEL_MARGIN_HORIZONTAL * 2 , 13 );
+		Pos = MAP_APPFONT (  POPUPPANEL_MARGIN_SMALL + OFFSET_X  , POPUPPANEL_MARGIN_SMALL * 2 + OFFSET_Y + VS_UNDERLINE_HEIGHT ); 
+		Size = MAP_APPFONT ( VS_UNDERLINE_WIDTH, 13 );
 		TabStop = TRUE;
 		Text [ en-US ] = "~More Options...";
 	};
@@ -536,14 +536,14 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLIN
 	};
 	
 //	//more button bmps
-//	Bitmap	BMP_UNDERLINE_MORE
-//	{
-//		File = "symphony/morebutton.bmp";
-//	};
-//	Bitmap	BMP_UNDERLINE_MORE_H
-//	{
-//		File = "symphony/morebutton_h.bmp";
-//	};	
+	Bitmap	BMP_UNDERLINE_MORE
+	{
+		File = "symphony/__morebutton.bmp";
+	};
+	Bitmap	BMP_UNDERLINE_MORE_H
+	{
+		File = "symphony/__morebutton_h.bmp";
+	};	
 	
 	//tips 
 	String STR_SINGLE