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

svn commit: r1452760 [3/5] - in /openoffice/branches/sidebar/main: default_images/sfx2/res/symphony/ officecfg/registry/data/org/openoffice/Office/UI/ sd/source/ui/sidebar/ sfx2/inc/sfx2/sidebar/ sfx2/source/sidebar/ svx/ svx/inc/sidebar/ svx/inc/svx/s...

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx Tue Mar  5 12:17:09 2013
@@ -0,0 +1,1190 @@
+/**************************************************************
+ * 
+ * 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 <sfx2/sidebar/propertypanel.hrc>
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include <LinePropertyPanel.hxx>
+#include <LinePropertyPanel.hrc>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xtable.hxx>
+#include <svx/xdash.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/svxitems.hrc>
+#include <svtools/valueset.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/viewoptions.hxx>
+#include <comphelper/processfactory.hxx>
+#include <i18npool/mslangid.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xlndsit.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/xlnwtit.hxx>
+#include <vcl/lstbox.hxx>
+#include <svx/tbxcolorupdate.hxx>
+#include <vcl/toolbox.hxx>
+#include <svx/xlntrit.hxx>
+#include <svx/xlnstit.hxx>
+#include <svx/xlnedit.hxx>
+#include <svx/xlncapit.hxx>
+#include <svx/xlinjoit.hxx>
+#include "svx/sidebar/PopupContainer.hxx"
+#include "svx/sidebar/PopupControl.hxx"
+#include "sidebar/ColorControl.hxx"
+#include "LineStyleControl.hxx"
+#include "LineWidthControl.hxx"
+#include <boost/bind.hpp>
+
+using namespace css;
+using namespace cssu;
+using ::sfx2::sidebar::Theme;
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
+namespace {
+    short GetItemId_Impl_line( ValueSet& rValueSet, const Color& rCol )
+    {
+        if(rCol == COL_AUTO)
+            return 0;
+
+        bool	bFound = false;
+        sal_uInt16 nCount = rValueSet.GetItemCount();
+        sal_uInt16	n	   = 1;
+
+        while ( !bFound && n <= nCount )
+        {
+            Color aValCol = rValueSet.GetItemColor(n);
+
+            bFound = (   aValCol.GetRed()   == rCol.GetRed()
+                && aValCol.GetGreen() == rCol.GetGreen()
+                && aValCol.GetBlue()  == rCol.GetBlue() );
+
+            if ( !bFound )
+                n++;
+        }
+        return bFound ? n : -1;
+    }
+
+    Color GetTransparentColor (void)
+    {
+        return COL_TRANSPARENT;
+    }
+
+} // end of anonymous namespace
+
+
+class LineEndLB_LPP : public ListBox
+{
+
+public:
+		 LineEndLB_LPP( Window* pParent, ResId Id ) : ListBox( pParent, Id ) {}
+		 LineEndLB_LPP( Window* pParent, WinBits aWB ) : ListBox( pParent, aWB ) {}
+
+	void Fill( const XLineEndList* pList, bool bStart = true );
+
+	void	Append( XLineEndEntry* pEntry, Bitmap* pBmp = NULL,
+					bool bStart = true );
+	void	Modify( XLineEndEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL,
+					bool bStart = true );
+};
+
+void LineEndLB_LPP::Fill( const XLineEndList* pList, bool bStart )
+{
+	long nCount = pList->Count();
+	XLineEndEntry* pEntry;
+	VirtualDevice aVD;
+	SetUpdateMode( false );
+
+	for( long i = 0; i < nCount; i++ )
+	{
+        pEntry = pList->GetLineEnd( i );
+		Bitmap* pBitmap = const_cast<XLineEndList*>(pList)->CreateBitmapForUI( i );
+		if( pBitmap )
+		{
+			Size aBmpSize( pBitmap->GetSizePixel() );
+			aVD.SetOutputSizePixel( aBmpSize, false );
+			aVD.DrawBitmap( Point(), *pBitmap );
+			InsertEntry( pEntry->GetName(),
+				aVD.GetBitmap( bStart ? Point() : Point( aBmpSize.Width() / 2, 0 ),
+					Size( aBmpSize.Width() / 2, aBmpSize.Height() ) ) );
+
+			delete pBitmap;
+		}
+		else
+			InsertEntry( pEntry->GetName() );
+	}
+	SetUpdateMode( true );
+}
+
+void LineEndLB_LPP::Append( XLineEndEntry* pEntry, Bitmap* pBmp, bool bStart )
+{
+	if( pBmp )
+	{
+		VirtualDevice aVD;
+		Size aBmpSize( pBmp->GetSizePixel() );
+
+		aVD.SetOutputSizePixel( aBmpSize, false );
+		aVD.DrawBitmap( Point(), *pBmp );
+		InsertEntry( pEntry->GetName(),
+			aVD.GetBitmap( bStart ? Point() : Point( aBmpSize.Width() / 2, 0 ),
+				Size( aBmpSize.Width() / 2, aBmpSize.Height() ) ) );
+	}
+	else
+		InsertEntry( pEntry->GetName() );
+}
+
+void LineEndLB_LPP::Modify( XLineEndEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp, bool bStart )
+{
+	RemoveEntry( nPos );
+
+	if( pBmp )
+	{
+		VirtualDevice aVD;
+		Size aBmpSize( pBmp->GetSizePixel() );
+
+		aVD.SetOutputSizePixel( aBmpSize, false );
+		aVD.DrawBitmap( Point(), *pBmp );
+		InsertEntry( pEntry->GetName(),
+			aVD.GetBitmap( bStart ? Point() : Point( aBmpSize.Width() / 2, 0 ),
+				Size( aBmpSize.Width() / 2, aBmpSize.Height() ) ), nPos );
+	}
+	else
+		InsertEntry( pEntry->GetName(), nPos );
+}
+
+
+// namespace open
+
+namespace svx { namespace sidebar {
+
+
+
+LinePropertyPanel::LinePropertyPanel(
+    Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+:   Control(
+        pParent, 
+        SVX_RES(RID_SIDEBAR_LINE_PANEL)),
+    mpFTWidth(new FixedText(this, SVX_RES(FT_WIDTH))),
+    mpTBWidthBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
+    mpTBWidth(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBWidthBackground.get(), SVX_RES(TB_WIDTH))),
+    mpFTColor(new FixedText(this, SVX_RES(FT_COLOR))),
+    mpTBColorBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
+    mpTBColor(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBColorBackground.get(), SVX_RES(TB_COLOR))),
+    mpFTStyle(new FixedText(this, SVX_RES(FT_STYLE))),
+    mpTBStyleBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
+    mpTBStyle(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBStyleBackground.get(), SVX_RES(TB_STYLE))),
+    mpFTTrancparency(new FixedText(this, SVX_RES(FT_TRANSPARENT))),
+    mpMFTransparent(new MetricField(this, SVX_RES(MF_TRANSPARENT))),
+    mpFTArrow(new FixedText(this, SVX_RES(FT_ARROW))),
+    mpLBStart(new LineEndLB_LPP(this, SVX_RES(LB_START))),
+    mpLBEnd(new LineEndLB_LPP(this, SVX_RES(LB_END))),
+    mpFTEdgeStyle(new FixedText(this, SVX_RES(FT_EDGESTYLE))),
+    mpLBEdgeStyle(new ListBox(this, SVX_RES(LB_EDGESTYLE))),
+    mpFTCapStyle(new FixedText(this, SVX_RES(FT_CAPSTYLE))),
+    mpLBCapStyle(new ListBox(this, SVX_RES(LB_CAPSTYLE))),
+    maStyleControl(SID_ATTR_LINE_STYLE, *pBindings, *this),             // ( SID_SVX_START + 169 )
+    maDashControl (SID_ATTR_LINE_DASH, *pBindings, *this),              // ( SID_SVX_START + 170 )
+    maWidthControl(SID_ATTR_LINE_WIDTH, *pBindings, *this),             // ( SID_SVX_START + 171 )
+    maColorControl(SID_ATTR_LINE_COLOR, *pBindings, *this),             // ( SID_SVX_START + 172 )
+    maStartControl(SID_ATTR_LINE_START, *pBindings, *this),             // ( SID_SVX_START + 173 )
+    maEndControl(SID_ATTR_LINE_END, *pBindings, *this),                 // ( SID_SVX_START + 174 )
+    maLineEndListControl(SID_LINEEND_LIST, *pBindings, *this),          // ( SID_SVX_START + 184 )
+    maTransControl(SID_ATTR_LINE_TRANSPARENCE, *pBindings, *this),      // (SID_SVX_START+1107)
+    maEdgeStyle(SID_ATTR_LINE_JOINT, *pBindings, *this),                // (SID_SVX_START+1110)
+    maCapStyle(SID_ATTR_LINE_CAP, *pBindings, *this),                   // (SID_SVX_START+1111)
+    maColor(COL_BLACK),
+    mpColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_LINE_COLOR, TBI_COLOR, mpTBColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)),
+    mpStyleItem(),
+    mpDashItem(),
+    mnTrans(0),
+    meMapUnit(SFX_MAPUNIT_MM),
+    mnWidthCoreValue(0),
+    mpLineEndList(0),
+    mpStartItem(0),
+    mpEndItem(0),
+    maColorPopup(this, ::boost::bind(&LinePropertyPanel::CreateColorPopupControl, this, _1)),
+    maLineStylePopup(this, ::boost::bind(&LinePropertyPanel::CreateLineStylePopupControl, this, _1)),
+    maLineWidthPopup(this, ::boost::bind(&LinePropertyPanel::CreateLineWidthPopupControl, this, _1)),
+    maIMGColor(SVX_RES(IMG_COLOR)),
+    maIMGNone(SVX_RES(IMG_NONE_ICON)),
+    mpIMGStyleIcon(),
+    mpIMGWidthIcon(),
+    mpIMGStyleIconH(),
+    mpIMGWidthIconH(),
+    mxFrame(rxFrame),
+    maContext(),
+    mpBindings(pBindings),
+    mbColorAvailable(true),
+    mbStyleAvailable(false),
+    mbDashAvailable(false),
+    mbTransAvailable(true),
+    mbWidthValuable(true),
+    mbStartAvailable(true),
+    mbEndAvailable(true)
+{
+    Initialize();
+    FreeResource();
+}
+
+
+
+LinePropertyPanel::~LinePropertyPanel()
+{
+    // Destroy the toolboxes, then their background windows.
+    mpTBWidth.reset();
+    mpTBColor.reset();
+    mpTBStyle.reset();
+    mpTBWidthBackground.reset();
+    mpTBColorBackground.reset();
+    mpTBStyleBackground.reset();
+}
+
+
+
+void LinePropertyPanel::ShowMenu (void)
+{
+    if (mpBindings != NULL)
+    {
+        SfxDispatcher* pDispatcher = mpBindings->GetDispatcher();
+        if (pDispatcher != NULL)
+            pDispatcher->Execute(SID_ATTRIBUTES_LINE, SFX_CALLMODE_ASYNCHRON);
+    }
+}
+
+
+
+void LinePropertyPanel::Initialize()
+{
+    mpIMGStyleIcon.reset(new Image[11]);
+	mpIMGStyleIcon[0] = Image(SVX_RES(IMG_LINE1_ICON));
+	mpIMGStyleIcon[1] = Image(SVX_RES(IMG_LINE2_ICON));
+	mpIMGStyleIcon[2] = Image(SVX_RES(IMG_LINE3_ICON));
+	mpIMGStyleIcon[3] = Image(SVX_RES(IMG_LINE4_ICON));
+	mpIMGStyleIcon[4] = Image(SVX_RES(IMG_LINE5_ICON));
+	mpIMGStyleIcon[5] = Image(SVX_RES(IMG_LINE6_ICON));
+	mpIMGStyleIcon[6] = Image(SVX_RES(IMG_LINE7_ICON));
+	mpIMGStyleIcon[7] = Image(SVX_RES(IMG_LINE8_ICON));
+	mpIMGStyleIcon[8] = Image(SVX_RES(IMG_LINE9_ICON));
+	mpIMGStyleIcon[9] = Image(SVX_RES(IMG_LINE10_ICON));
+	mpIMGStyleIcon[10] = Image(SVX_RES(IMG_LINE11_ICON));
+
+    mpIMGWidthIcon.reset(new Image[8]);
+	mpIMGWidthIcon[0] = Image(SVX_RES(IMG_WIDTH1_ICON));
+	mpIMGWidthIcon[1] = Image(SVX_RES(IMG_WIDTH2_ICON));
+	mpIMGWidthIcon[2] = Image(SVX_RES(IMG_WIDTH3_ICON));
+	mpIMGWidthIcon[3] = Image(SVX_RES(IMG_WIDTH4_ICON));
+	mpIMGWidthIcon[4] = Image(SVX_RES(IMG_WIDTH5_ICON));
+	mpIMGWidthIcon[5] = Image(SVX_RES(IMG_WIDTH6_ICON));
+	mpIMGWidthIcon[6] = Image(SVX_RES(IMG_WIDTH7_ICON));
+	mpIMGWidthIcon[7] = Image(SVX_RES(IMG_WIDTH8_ICON));
+
+	//high contrast
+    mpIMGStyleIconH.reset(new Image[11]);
+	mpIMGStyleIconH[0] = Image(SVX_RES(IMG_LINE1_ICON_H));
+	mpIMGStyleIconH[1] = Image(SVX_RES(IMG_LINE2_ICON_H));
+	mpIMGStyleIconH[2] = Image(SVX_RES(IMG_LINE3_ICON_H));
+	mpIMGStyleIconH[3] = Image(SVX_RES(IMG_LINE4_ICON_H));
+	mpIMGStyleIconH[4] = Image(SVX_RES(IMG_LINE5_ICON_H));
+	mpIMGStyleIconH[5] = Image(SVX_RES(IMG_LINE6_ICON_H));
+	mpIMGStyleIconH[6] = Image(SVX_RES(IMG_LINE7_ICON_H));
+	mpIMGStyleIconH[7] = Image(SVX_RES(IMG_LINE8_ICON_H));
+	mpIMGStyleIconH[8] = Image(SVX_RES(IMG_LINE9_ICON_H));
+	mpIMGStyleIconH[9] = Image(SVX_RES(IMG_LINE10_ICON_H));
+	mpIMGStyleIconH[10] = Image(SVX_RES(IMG_LINE11_ICON_H));
+
+    mpIMGWidthIconH.reset(new Image[8]);
+	mpIMGWidthIconH[0] = Image(SVX_RES(IMG_WIDTH1_ICON_H));
+	mpIMGWidthIconH[1] = Image(SVX_RES(IMG_WIDTH2_ICON_H));
+	mpIMGWidthIconH[2] = Image(SVX_RES(IMG_WIDTH3_ICON_H));
+	mpIMGWidthIconH[3] = Image(SVX_RES(IMG_WIDTH4_ICON_H));
+	mpIMGWidthIconH[4] = Image(SVX_RES(IMG_WIDTH5_ICON_H));
+	mpIMGWidthIconH[5] = Image(SVX_RES(IMG_WIDTH6_ICON_H));
+	mpIMGWidthIconH[6] = Image(SVX_RES(IMG_WIDTH7_ICON_H));
+	mpIMGWidthIconH[7] = Image(SVX_RES(IMG_WIDTH8_ICON_H));
+	//end
+
+	meMapUnit = maWidthControl.GetCoreMetric();
+
+	mpTBColor->SetItemImage(TBI_COLOR, maIMGColor);
+	Size aTbxSize( mpTBColor->CalcWindowSizePixel() );
+	mpTBColor->SetOutputSizePixel( aTbxSize );
+	mpTBColor->SetItemBits( TBI_COLOR, mpTBColor->GetItemBits( TBI_COLOR ) | TIB_DROPDOWNONLY );
+	mpTBColor->SetQuickHelpText(TBI_COLOR,String(SVX_RES(STR_QH_TB_COLOR))); //Add
+	mpTBColor->SetBackground(Wallpaper());
+	mpTBColor->SetPaintTransparent(true);
+	Link aLink = LINK(this, LinePropertyPanel, ToolboxColorSelectHdl);
+	mpTBColor->SetDropdownClickHdl ( aLink );
+	mpTBColor->SetSelectHdl ( aLink );
+
+	mpTBStyle->SetItemImage(TBI_STYLE, mpIMGStyleIcon[0]);
+	aTbxSize = mpTBStyle->CalcWindowSizePixel() ;
+	mpTBStyle->SetOutputSizePixel( aTbxSize );
+	mpTBStyle->SetItemBits( TBI_STYLE, mpTBStyle->GetItemBits( TBI_STYLE ) | TIB_DROPDOWNONLY );
+	mpTBStyle->SetQuickHelpText(TBI_STYLE,String(SVX_RES(STR_QH_TB_STYLE))); //Add
+	mpTBStyle->SetBackground(Wallpaper());
+	mpTBStyle->SetPaintTransparent(true);
+	aLink = LINK(this, LinePropertyPanel, ToolboxStyleSelectHdl);
+	mpTBStyle->SetDropdownClickHdl ( aLink );
+	mpTBStyle->SetSelectHdl ( aLink );
+
+	mpTBWidth->SetItemImage(TBI_WIDTH, mpIMGWidthIcon[0]);
+	aTbxSize = mpTBWidth->CalcWindowSizePixel() ;
+	mpTBWidth->SetOutputSizePixel( aTbxSize );
+	mpTBWidth->SetItemBits( TBI_WIDTH, mpTBWidth->GetItemBits( TBI_WIDTH ) | TIB_DROPDOWNONLY );
+	mpTBWidth->SetQuickHelpText(TBI_WIDTH,String(SVX_RES(STR_QH_TB_WIDTH))); //Add
+	mpTBWidth->SetBackground(Wallpaper());
+	mpTBWidth->SetPaintTransparent(true);
+	aLink = LINK(this, LinePropertyPanel, ToolboxWidthSelectHdl);
+	mpTBWidth->SetDropdownClickHdl ( aLink );
+	mpTBWidth->SetSelectHdl ( aLink );
+
+	FillLineEndList();
+	SelectEndStyle(true);
+	SelectEndStyle(false);
+	aLink = LINK( this, LinePropertyPanel, ChangeStartHdl );
+	mpLBStart->SetSelectHdl( aLink );
+	mpLBStart->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Beginning Style")));	//wj acc
+	aLink = LINK( this, LinePropertyPanel, ChangeEndHdl );
+	mpLBEnd->SetSelectHdl( aLink );
+	mpLBEnd->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Ending Style")));	//wj acc
+
+	aLink = LINK(this, LinePropertyPanel, ChangeTransparentHdl);
+	mpMFTransparent->SetModifyHdl(aLink);
+	mpMFTransparent->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Transparency")));	//wj acc
+	
+	mpTBWidth->SetAccessibleRelationLabeledBy(mpFTWidth.get());
+	mpTBColor->SetAccessibleRelationLabeledBy(mpFTColor.get());
+	mpTBStyle->SetAccessibleRelationLabeledBy(mpFTStyle.get());
+	mpMFTransparent->SetAccessibleRelationLabeledBy(mpFTTrancparency.get());
+	mpLBStart->SetAccessibleRelationLabeledBy(mpFTArrow.get());
+	mpLBEnd->SetAccessibleRelationLabeledBy(mpLBEnd.get());
+
+    aLink = LINK( this, LinePropertyPanel, ChangeEdgeStyleHdl );
+    mpLBEdgeStyle->SetSelectHdl( aLink );
+    mpLBEdgeStyle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Corner Style")));
+
+    aLink = LINK( this, LinePropertyPanel, ChangeCapStyleHdl );
+    mpLBCapStyle->SetSelectHdl( aLink );
+    mpLBCapStyle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cap Style")));
+}
+
+
+
+void LinePropertyPanel::SetupIcons(void)
+{
+    if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
+    {
+        // todo
+    }
+    else
+    {
+        // todo
+    }
+}
+
+
+
+LinePropertyPanel* LinePropertyPanel::Create (
+    Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+{
+    if (pParent == NULL)
+        throw lang::IllegalArgumentException(A2S("no parent Window given to LinePropertyPanel::Create"), NULL, 0);
+    if ( ! rxFrame.is())
+        throw lang::IllegalArgumentException(A2S("no XFrame given to LinePropertyPanel::Create"), NULL, 1);
+    if (pBindings == NULL)
+        throw lang::IllegalArgumentException(A2S("no SfxBindings given to LinePropertyPanel::Create"), NULL, 2);
+    
+    return new LinePropertyPanel(
+        pParent,
+        rxFrame,
+        pBindings);
+}
+
+
+
+void LinePropertyPanel::DataChanged(
+    const DataChangedEvent& rEvent)
+{
+    (void)rEvent;
+    
+    SetupIcons();
+}
+
+
+
+void LinePropertyPanel::HandleContextChange(
+    const ::sfx2::sidebar::EnumContext aContext)
+{
+    if(maContext == aContext)
+    {
+        // Nothing to do.
+        return;
+    }
+
+    maContext = aContext;
+
+
+
+    // todo
+}
+
+
+
+void LinePropertyPanel::NotifyItemUpdate( 
+    sal_uInt16 nSID, 
+    SfxItemState eState, 
+    const SfxPoolItem* pState)
+{
+	switch(nSID)
+	{
+    	case SID_ATTR_LINE_COLOR:
+        {
+		    if( eState == SFX_ITEM_DISABLED)
+		    { 
+			    mpFTColor->Disable();
+			    mpTBColor->Disable();
+			    mbColorAvailable = false;
+			    mpColorUpdater->Update(COL_WHITE);
+		    }
+		    else
+		    {
+			    mpFTColor->Enable();
+			    mpTBColor->Enable();
+                const XLineColorItem* pItem = dynamic_cast< const XLineColorItem* >(pState);
+
+			    if(eState >= SFX_ITEM_DEFAULT && pItem)
+			    {
+				    maColor = pItem->GetColorValue();
+				    mbColorAvailable = true;
+				    mpColorUpdater->Update(maColor);
+			    }
+			    else
+			    {
+				    mbColorAvailable = false;
+				    mpColorUpdater->Update(COL_WHITE);
+			    }	
+		    }
+		    break;
+        }
+	    case SID_ATTR_LINE_STYLE:
+	    case SID_ATTR_LINE_DASH:
+        {
+		    if( eState == SFX_ITEM_DISABLED)
+		    {
+			    mpFTStyle->Disable();
+			    mpTBStyle->Disable();
+			    mpTBStyle->SetItemImage(TBI_STYLE,maIMGNone);
+		    }
+		    else
+		    {
+			    mpFTStyle->Enable();
+			    mpTBStyle->Enable();
+			    if( eState  >= SFX_ITEM_DEFAULT )
+			    {
+				    if(nSID == SID_ATTR_LINE_STYLE)
+				    {
+                        const XLineStyleItem* pItem = dynamic_cast< const XLineStyleItem* >(pState);
+
+                        if(pItem)
+                        {
+					        mbStyleAvailable =true;
+    					    mpStyleItem.reset(pState ? (XLineStyleItem*)pItem->Clone() : 0);
+                        }
+				    }
+				    else if(nSID == SID_ATTR_LINE_DASH)
+				    {
+                        const XLineDashItem* pItem = dynamic_cast< const XLineDashItem* >(pState);
+
+                        if(pItem)
+                        {
+    					    mbDashAvailable = true;
+	    				    mpDashItem.reset(pState ? (XLineDashItem*)pItem->Clone() : 0);
+                        }
+				    }
+			    }
+			    else
+			    {
+				    if(nSID == SID_ATTR_LINE_STYLE)
+					    mbStyleAvailable = false;
+				    else 
+					    mbDashAvailable = false;
+			    }
+			    SetStyleIcon();
+		    }
+		    break;
+        }
+    	case SID_ATTR_LINE_TRANSPARENCE:
+        {
+		    if( eState == SFX_ITEM_DISABLED )
+		    {
+			    mpFTTrancparency->Disable();
+			    mpMFTransparent->Disable();
+			    mpMFTransparent->SetValue(0);//add 
+			    mpMFTransparent->SetText(String());
+			    mbTransAvailable = false;
+		    }
+		    else
+		    {
+			    mpFTTrancparency->Enable();
+			    mpMFTransparent->Enable();
+			    mbTransAvailable = true;
+                const XLineTransparenceItem* pItem = dynamic_cast< const XLineTransparenceItem* >(pState);
+
+                if(eState != SFX_ITEM_DONTCARE && pItem)
+			    {
+				    mnTrans = pItem->GetValue();
+				    mpMFTransparent->SetValue(mnTrans);
+			    }
+			    else
+			    {
+				    mpMFTransparent->SetValue(0);//add 
+				    mpMFTransparent->SetText(String());
+			    }
+		    }
+		    break;
+        }
+    	case SID_ATTR_LINE_WIDTH:
+        {
+		    if(eState == SFX_ITEM_DISABLED)
+		    {
+			    mpTBWidth->Disable();
+			    mpFTWidth->Disable();
+		    }
+		    else
+		    {
+			    //enable
+			    mpTBWidth->Enable();
+			    mpFTWidth->Enable();
+                const XLineWidthItem* pItem = dynamic_cast< const XLineWidthItem* >(pState);
+
+			    if(eState >= SFX_ITEM_AVAILABLE && pItem)
+			    {
+				    mnWidthCoreValue = pItem->GetValue();
+				    mbWidthValuable = true;
+			    }
+			    else
+			    {
+				    mbWidthValuable = false;
+			    }
+		    }
+		    SetWidthIcon();
+		    break;
+        }
+    	case SID_ATTR_LINE_START:
+        {
+            const XLineStartItem* pItem = dynamic_cast< const XLineStartItem* >(pState);
+
+		    if(eState != SFX_ITEM_DONTCARE && pItem)
+		    {
+			    mbStartAvailable = true;	//add 
+			    mpStartItem.reset(pItem ? (XLineStartItem*)pItem->Clone() : 0);
+			    SelectEndStyle(true);
+		    }
+		    else
+		    {
+			    mpLBStart->SetNoSelection();
+			    mbStartAvailable = false;	//add 
+		    }
+		    break;
+        }
+    	case SID_ATTR_LINE_END:
+        {
+		    mpFTArrow->Enable();
+		    mpLBEnd->Enable();
+            const XLineEndItem* pItem = dynamic_cast< const XLineEndItem* >(pState);
+
+		    if(eState != SFX_ITEM_DONTCARE && pItem)
+		    {
+			    mbEndAvailable = true;		//add 
+			    mpEndItem.reset(pItem ? (XLineEndItem*)pItem->Clone() : 0);
+			    SelectEndStyle(false);		
+		    }
+		    else
+		    {
+			    mpLBEnd->SetNoSelection();
+			    mbEndAvailable = false;		//add 
+		    }	
+		    break;
+        }
+    	case SID_LINEEND_LIST:
+        {
+		    FillLineEndList();
+		    SelectEndStyle(true);
+		    SelectEndStyle(false);
+		    break;
+        }
+        case SID_ATTR_LINE_JOINT:
+        {
+            if(eState == SFX_ITEM_DISABLED)
+            {
+                mpLBEdgeStyle->Disable();
+            }
+            else
+            {
+                mpLBEdgeStyle->Enable();
+                const XLineJointItem* pItem = dynamic_cast< const XLineJointItem* >(pState);
+                sal_uInt16 nEntryPos(0);
+
+                if(eState >= SFX_ITEM_AVAILABLE && pItem)
+                {
+                    switch(pItem->GetValue())
+                    {
+                        case com::sun::star::drawing::LineJoint_MIDDLE:
+                        case com::sun::star::drawing::LineJoint_ROUND:
+                        {
+                            nEntryPos = 1;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineJoint_NONE:
+                        {
+                            nEntryPos = 2;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineJoint_MITER:
+                        {
+                            nEntryPos = 3;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineJoint_BEVEL:
+                        {
+                            nEntryPos = 4;
+                            break;
+                        }
+
+                        default:
+                            break;
+                    }
+                }
+
+                if(nEntryPos)
+                {
+                    mpLBEdgeStyle->SelectEntryPos(nEntryPos - 1);
+                }
+                else
+                {
+                    mpLBEdgeStyle->SetNoSelection();
+                }
+            }
+            break;
+        }
+        case SID_ATTR_LINE_CAP:
+        {
+            if(eState == SFX_ITEM_DISABLED)
+            {
+                mpLBCapStyle->Disable();
+            }
+            else
+            {
+                mpLBCapStyle->Enable();
+                const XLineCapItem* pItem = dynamic_cast< const XLineCapItem* >(pState);
+                sal_uInt16 nEntryPos(0);
+
+                if(eState >= SFX_ITEM_AVAILABLE && pItem)
+                {
+                    switch(pItem->GetValue())
+                    {
+                        case com::sun::star::drawing::LineCap_BUTT:
+                        {
+                            nEntryPos = 1;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineCap_ROUND:
+                        {
+                            nEntryPos = 2;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineCap_SQUARE:
+                        {
+                            nEntryPos = 3;
+                            break;
+                        }
+
+                        default:
+                            break;
+                    }
+                }
+
+                if(nEntryPos)
+                {
+                    mpLBCapStyle->SelectEntryPos(nEntryPos - 1);
+                }
+                else
+                {
+                    mpLBCapStyle->SetNoSelection();
+                }
+            }
+            break;
+        }
+    }
+}
+
+
+
+SfxBindings* LinePropertyPanel::GetBindings() 
+{ 
+    return mpBindings; 
+}
+
+
+
+IMPL_LINK( LinePropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG )
+{	
+	return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ToolboxColorSelectHdl,ToolBox*, pToolBox)
+{
+	sal_uInt16 nId = pToolBox->GetCurItemId();
+	if(nId == TBI_COLOR)
+	{
+        maColorPopup.Show(*pToolBox);
+        maColorPopup.SetCurrentColor(maColor, mbColorAvailable);
+	}
+	return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ToolboxStyleSelectHdl,ToolBox*, pToolBox)
+{
+	if (pToolBox->GetCurItemId() == TBI_STYLE)
+	{
+        maLineStylePopup.SetStyleSelect(mpStyleItem.get(), mpDashItem.get(), mbStyleAvailable, mbDashAvailable);
+        maLineStylePopup.Show(*pToolBox);
+	}
+	return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ChangeStartHdl, void*, EMPTYARG)
+{
+	sal_uInt16	nPos = mpLBStart->GetSelectEntryPos();
+	if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != mpLBStart->GetSavedValue() )
+	{
+		XLineStartItem* pItem = NULL;
+		if( nPos == 0 )
+			pItem = new XLineStartItem();
+		else if( mpLineEndList && mpLineEndList->Count() > (long) ( nPos - 1 ) )
+			pItem = new XLineStartItem( mpLBStart->GetSelectEntry(),mpLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() );
+		GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINEEND_STYLE, SFX_CALLMODE_RECORD, pItem,  0L);
+		delete pItem;
+	}
+	return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ChangeEndHdl, void*, EMPTYARG)
+{
+	sal_uInt16	nPos = mpLBEnd->GetSelectEntryPos();
+	if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != mpLBEnd->GetSavedValue() )
+	{
+		XLineEndItem* pItem = NULL;
+		if( nPos == 0 )
+			pItem = new XLineEndItem();
+		else if( mpLineEndList && mpLineEndList->Count() > (long) ( nPos - 1 ) )
+			pItem = new XLineEndItem( mpLBEnd->GetSelectEntry(), mpLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() );
+		GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINEEND_STYLE, SFX_CALLMODE_RECORD, pItem,  0L);
+		delete pItem;
+	}
+	return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ChangeEdgeStyleHdl, void*, EMPTYARG)
+{
+    const sal_uInt16 nPos(mpLBEdgeStyle->GetSelectEntryPos());
+
+    if(LISTBOX_ENTRY_NOTFOUND != nPos && nPos != mpLBEdgeStyle->GetSavedValue())
+    {
+        XLineJointItem* pItem = 0;
+
+        switch(nPos)
+        {
+            case 0: // rounded
+            {
+                pItem = new XLineJointItem(com::sun::star::drawing::LineJoint_ROUND);
+                break;
+            }
+            case 1: // none
+            {
+                pItem = new XLineJointItem(com::sun::star::drawing::LineJoint_NONE);
+                break;
+            }
+            case 2: // mitered
+            {
+                pItem = new XLineJointItem(com::sun::star::drawing::LineJoint_MITER);
+                break;
+            }
+            case 3: // beveled
+            {
+                pItem = new XLineJointItem(com::sun::star::drawing::LineJoint_BEVEL);
+                break;
+            }
+        }
+
+        GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_JOINT, SFX_CALLMODE_RECORD, pItem,  0L);
+        delete pItem;
+    }
+    return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ChangeCapStyleHdl, void*, EMPTYARG)
+{
+    const sal_uInt16 nPos(mpLBCapStyle->GetSelectEntryPos());
+
+    if(LISTBOX_ENTRY_NOTFOUND != nPos && nPos != mpLBCapStyle->GetSavedValue())
+    {
+        XLineCapItem* pItem = 0;
+
+        switch(nPos)
+        {
+            case 0: // flat
+            {
+                pItem = new XLineCapItem(com::sun::star::drawing::LineCap_BUTT);
+                break;
+            }
+            case 1: // round
+            {
+                pItem = new XLineCapItem(com::sun::star::drawing::LineCap_ROUND);
+                break;
+            }
+            case 2: // square
+            {
+                pItem = new XLineCapItem(com::sun::star::drawing::LineCap_SQUARE);
+                break;
+            }
+        }
+
+        GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_CAP, SFX_CALLMODE_RECORD, pItem,  0L);
+        delete pItem;
+    }
+    return 0;
+}
+
+
+
+
+IMPL_LINK(LinePropertyPanel, ToolboxWidthSelectHdl,ToolBox*, pToolBox)
+{
+	if (pToolBox->GetCurItemId() == TBI_WIDTH)
+	{
+		maLineWidthPopup.SetWidthSelect(mnWidthCoreValue, mbWidthValuable, meMapUnit);
+        maLineWidthPopup.Show(*pToolBox);
+	}
+	return 0;
+}
+
+
+
+
+IMPL_LINK( LinePropertyPanel, ChangeTransparentHdl, void *, EMPTYARG )
+{
+	sal_uInt16 nVal = (sal_uInt16)mpMFTransparent->GetValue();
+	XLineTransparenceItem aItem( nVal );
+
+	GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SFX_CALLMODE_RECORD, &aItem, 0L);
+	return( 0L );
+}
+
+
+
+
+PopupControl* LinePropertyPanel::CreateColorPopupControl (PopupContainer* pParent)
+{
+    return new ColorControl(
+        pParent,
+        mpBindings,
+        SVX_RES(RID_POPUPPANEL_LINEPAGE_COLOR),
+        SVX_RES(VS_COLOR),
+        ::boost::bind(GetTransparentColor),
+        ::boost::bind(&LinePropertyPanel::SetColor, this, _1, _2),
+        pParent,
+        STR_AUTOMATICE);
+}
+
+
+
+
+PopupControl* LinePropertyPanel::CreateLineStylePopupControl (PopupContainer* pParent)
+{
+    return new LineStyleControl (pParent, *this);
+}
+
+
+
+
+PopupControl* LinePropertyPanel::CreateLineWidthPopupControl (PopupContainer* pParent)
+{
+    return new LineWidthControl(pParent, *this);
+}
+
+
+
+
+void LinePropertyPanel::EndLineStylePopupMode (void)
+{
+    maLineStylePopup.Hide();
+}
+
+
+
+
+void LinePropertyPanel::EndLineWidthPopupMode (void)
+{
+    maLineWidthPopup.Hide();
+}
+
+
+
+
+void  LinePropertyPanel::SetStyleIcon()
+{
+	if(!mbStyleAvailable)
+	{	//custome style that not listed in panel
+		mpTBStyle->SetItemImage(TBI_STYLE,maIMGNone);
+		return;
+	}
+
+    const XLineStyle eXLS(mpStyleItem ? (XLineStyle)mpStyleItem->GetValue() : XLINE_NONE);
+
+	switch(eXLS)
+	{
+	case XLINE_NONE:
+		mpTBStyle->SetItemImage(TBI_STYLE,maIMGNone);
+		break;
+	case XLINE_SOLID:
+		mpTBStyle->SetItemImage(TBI_STYLE, GetDisplayBackground().GetColor().IsDark() ? mpIMGStyleIconH[0] : mpIMGStyleIcon[0]);
+		break;
+	case XLINE_DASH:
+		if(mpDashItem && mbDashAvailable)
+		{
+			XDash aDash = mpDashItem->GetDashValue();
+			sal_uInt16 n = 0;
+			for( ; n < 10; n++ )
+			{
+				if( Dash_Set[n] == aDash )
+				{
+					mpTBStyle->SetItemImage(TBI_STYLE, GetDisplayBackground().GetColor().IsDark() ? mpIMGStyleIconH[n+1] :mpIMGStyleIcon[n+1]);
+					break;
+				}
+			}
+			if(n == 10)
+				mpTBStyle->SetItemImage(TBI_STYLE,maIMGNone);
+		}
+		else
+		{
+			mpTBStyle->SetItemImage(TBI_STYLE,maIMGNone);
+		}
+		break;
+	}
+}
+
+
+
+void LinePropertyPanel::SetWidthIcon(int n)
+{
+	if(n==0)
+		mpTBWidth->SetItemImage( TBI_WIDTH, maIMGNone);
+	else
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[n-1] : mpIMGWidthIcon[n-1]);
+}
+
+
+
+void LinePropertyPanel::SetWidthIcon()
+{
+	if(!mbWidthValuable)
+	{
+		mpTBWidth->SetItemImage( TBI_WIDTH, maIMGNone);
+		return;
+	}
+
+	long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MAP_POINT);
+
+	if(nVal <= 6)	
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[0] : mpIMGWidthIcon[0]); 
+	else if(nVal > 6 && nVal <= 9)	
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[1] : mpIMGWidthIcon[1]);  
+	else if(nVal > 9 && nVal <= 12)	
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[2] : mpIMGWidthIcon[2]); 
+	else if(nVal > 12 && nVal <= 19)	
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[3] : mpIMGWidthIcon[3]); 
+	else if(nVal > 19 && nVal <= 26)		
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[4] : mpIMGWidthIcon[4]); 
+	else if(nVal > 26 && nVal <= 37)	
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[5] : mpIMGWidthIcon[5]); 
+	else if(nVal > 37 && nVal <=52)		
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[6] : mpIMGWidthIcon[6]); 
+	else if(nVal > 52)		
+		mpTBWidth->SetItemImage( TBI_WIDTH, GetDisplayBackground().GetColor().IsDark() ? mpIMGWidthIconH[7] : mpIMGWidthIcon[7]); 
+
+}
+
+
+
+void LinePropertyPanel::SetLineStyleItem(XLineStyleItem* pStyle)
+{
+    mpStyleItem.reset(pStyle ? (XLineStyleItem*)pStyle->Clone() : 0);
+}
+
+
+
+void LinePropertyPanel::SetLineDashItem(XLineDashItem* pDash)
+{
+    mpDashItem.reset(pDash ? (XLineDashItem*)pDash->Clone() : 0);
+}
+
+
+
+void LinePropertyPanel::SetColor (
+    const String& rsColorName,
+    const Color aColor)
+{
+    XLineColorItem aColorItem(rsColorName, aColor);
+    mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L);
+    maColor = aColor;
+}
+
+
+
+void LinePropertyPanel::SetWidth(long nWidth)
+{
+    mnWidthCoreValue = nWidth;
+    mbWidthValuable = true;
+}
+
+
+
+void  LinePropertyPanel::FillLineEndList()
+{
+	SfxObjectShell* pSh = SfxObjectShell::Current();
+	if ( pSh && pSh->GetItem( SID_LINEEND_LIST ) )
+	{
+		mpLBStart->Enable();
+		SvxLineEndListItem aItem( *(const SvxLineEndListItem*)(pSh->GetItem( SID_LINEEND_LIST ) ) );		
+		mpLineEndList = aItem.GetLineEndList();
+		String sNone( SVX_RES( RID_SVXSTR_NONE ) );
+		//
+		mpLBStart->Clear();
+		mpLBEnd->Clear();
+		
+        if(mpLineEndList)
+		{
+			mpLBStart->InsertEntry( sNone );
+			mpLBStart->Fill( mpLineEndList );
+			mpLBStart->SelectEntryPos(0);
+
+			mpLBEnd->InsertEntry( sNone );
+			mpLBEnd->Fill( mpLineEndList, false);
+			mpLBEnd->SelectEntryPos(0);
+		}
+	}
+	else
+	{
+		mpLBStart->Disable();
+		mpLBEnd->Disable();
+	}
+}
+
+
+
+void LinePropertyPanel::SelectEndStyle(bool bStart)
+{
+	sal_Bool bSelected(false);
+
+	if(bStart)
+	{
+		//<<add 
+		if( !mbStartAvailable )
+		{
+			mpLBStart->SetNoSelection();
+			return;
+		}
+		//add end>>
+		if(mpStartItem && mpLineEndList)
+		{
+			const basegfx::B2DPolyPolygon& rItemPolygon = mpStartItem->GetLineStartValue();
+			for(sal_Int32 a(0);!bSelected &&  a < mpLineEndList->Count(); a++)
+			{
+				XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(a);
+				const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
+				if(rItemPolygon == rEntryPolygon)
+				{
+					mpLBStart->SelectEntryPos((sal_uInt16)a + 1);
+					bSelected = true;
+				}
+			}
+		}
+		if(!bSelected)
+			mpLBStart->SelectEntryPos( 0 );
+	}
+	else
+	{
+		//<<add 
+		if( !mbEndAvailable )
+		{
+			mpLBEnd->SetNoSelection();
+			return;
+		}
+		//add end>>
+		if(mpEndItem && mpLineEndList)
+		{
+			const basegfx::B2DPolyPolygon& rItemPolygon = mpEndItem->GetLineEndValue();
+			for(sal_Int32 a(0);!bSelected &&  a < mpLineEndList->Count(); a++)
+			{
+				XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(a);
+				const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
+				if(rItemPolygon == rEntryPolygon)
+				{
+					mpLBEnd->SelectEntryPos((sal_uInt16)a + 1);
+					bSelected = true;
+				}
+			}
+		}
+		if(!bSelected)
+			mpLBEnd->SelectEntryPos( 0 );
+	}
+}
+
+
+} } // end of namespace svx::sidebar

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hrc?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hrc (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hrc Tue Mar  5 12:17:09 2013
@@ -0,0 +1,162 @@
+/**************************************************************
+ * 
+ * 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.
+ * 
+ *************************************************************/
+
+//  RID_SIDEBAR_LINE_PANEL--------------------------------------------------------------
+#define CUSTOM_X	POPUPPANEL_MARGIN_LARGE + OFFSET_X 
+#define CUSTOM_Y	POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 12 * 9 + POPUPPANEL_MARGIN_SMALL * 2 + TEXT_HEIGHT
+#define CUSTOM_W	74  
+#define CUSTOM_H	POPUPPANEL_MARGIN_LARGE * 2 +  TEXT_HEIGHT + 12 +  TEXT_CONTROL_SPACING_VERTICAL
+
+#define FT_COLOR            1
+#define TB_COLOR            2
+#define FT_WIDTH            3
+#define TB_WIDTH            4
+#define FT_STYLE            5
+#define TB_STYLE            6
+#define FT_ARROW            7
+#define FT_TRANSPARENT      8
+#define MF_TRANSPARENT      9
+#define LB_START            10
+#define LB_END              11
+#define TBI_COLOR           12
+#define TBI_WIDTH           13
+#define TBI_STYLE           14
+#define STR_QH_TB_WIDTH     15
+#define STR_QH_TB_COLOR     16
+#define STR_QH_TB_STYLE     17
+
+#define FT_EDGESTYLE        18
+#define LB_EDGESTYLE        19
+#define FT_CAPSTYLE         20
+#define LB_CAPSTYLE         21
+
+#define IMG_COLOR           23
+#define IMG_COLOR_NO        24
+#define IMG_LINE1_ICON      25
+#define IMG_LINE2_ICON      26
+#define IMG_LINE3_ICON      27
+#define IMG_LINE4_ICON      28
+#define IMG_LINE5_ICON      29
+#define IMG_LINE6_ICON      30
+#define IMG_LINE7_ICON      31
+#define IMG_LINE8_ICON      32
+#define IMG_LINE9_ICON      33
+#define IMG_LINE10_ICON     34
+#define IMG_LINE11_ICON     35
+#define IMG_NONE_ICON       36
+
+#define IMG_WIDTH1_ICON     41
+#define IMG_WIDTH2_ICON     42
+#define IMG_WIDTH3_ICON     43
+#define IMG_WIDTH4_ICON     44
+#define IMG_WIDTH5_ICON     45
+#define IMG_WIDTH6_ICON     46
+#define IMG_WIDTH7_ICON     47
+#define IMG_WIDTH8_ICON     48
+
+#define IMG_LINE1_ICON_H    51
+#define IMG_LINE2_ICON_H    52
+#define IMG_LINE3_ICON_H    53
+#define IMG_LINE4_ICON_H    54
+#define IMG_LINE5_ICON_H    55
+#define IMG_LINE6_ICON_H    56
+#define IMG_LINE7_ICON_H    57
+#define IMG_LINE8_ICON_H    58
+#define IMG_LINE9_ICON_H    59
+#define IMG_LINE10_ICON_H   60
+#define IMG_LINE11_ICON_H   50
+
+#define IMG_WIDTH1_ICON_H   61
+#define IMG_WIDTH2_ICON_H   62
+#define IMG_WIDTH3_ICON_H   63
+#define IMG_WIDTH4_ICON_H   64
+#define IMG_WIDTH5_ICON_H   65
+#define IMG_WIDTH6_ICON_H   66
+#define IMG_WIDTH7_ICON_H   67
+#define IMG_WIDTH8_ICON_H   68
+
+//color popup page
+#define VS_COLOR		1
+#define STR_AUTOMATICE	2
+
+//style popup page
+#define VS_STYLE				1
+#define PB_OPTIONS				2
+
+#define IMG_LINE1			5
+#define IMG_LINE1_S			6
+#define IMG_LINE2				7
+#define IMG_LINE2_S			8
+#define IMG_LINE3			9
+#define IMG_LINE3_S			10
+#define IMG_LINE4			11
+#define IMG_LINE4_S			12
+#define IMG_LINE5				13
+#define IMG_LINE5_S			14
+#define IMG_LINE6			15
+#define IMG_LINE6_S		16
+#define IMG_LINE7			17
+#define IMG_LINE7_S			18
+#define IMG_LINE8				19
+#define IMG_LINE8_S				20
+#define IMG_LINE9			21
+#define IMG_LINE9_S			22
+#define IMG_LINE10				23
+#define IMG_LINE10_S			24
+#define IMG_LINE11			25
+#define IMG_LINE11_S			26
+
+// #define STR_STYLE_NONE_TIP		30
+#define STR_STYLE_NONE			31
+#define STR_STYLE_LINE1			32
+#define STR_STYLE_LINE2			33
+#define STR_STYLE_LINE3			34	
+#define STR_STYLE_LINE4			35
+#define STR_STYLE_LINE5			36
+#define STR_STYLE_LINE6			37
+#define STR_STYLE_LINE7			38
+#define STR_STYLE_LINE8			39
+#define STR_STYLE_LINE9			40
+#define STR_STYLE_LINE10		41
+#define STR_STYLE_LINE11		42
+
+#define IMG_LINE1_H			43
+#define IMG_LINE2_H			44
+#define IMG_LINE3_H			45
+#define IMG_LINE4_H			46
+#define IMG_LINE5_H			47
+#define IMG_LINE6_H			48
+#define IMG_LINE7_H			49
+#define IMG_LINE8_H			50
+#define IMG_LINE9_H			51
+#define IMG_LINE10_H			52
+#define IMG_LINE11_H		53
+
+//width popup page
+#define VS_WIDTH		1
+#define MF_WIDTH		2
+#define FT_CUSTOME		3
+#define FT_LINE_WIDTH	4
+#define IMG_WIDTH_CUSTOM			5
+#define IMG_WIDTH_CUSTOM_GRAY		6
+#define CT_BORDER		7
+#define STR_WIDTH_LAST_CUSTOM		8
+#define STR_PT			9

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hxx?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.hxx Tue Mar  5 12:17:09 2013
@@ -0,0 +1,242 @@
+/**************************************************************
+ * 
+ * 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_PROPERTYPANEL_LINEPAGE_HXX
+#define SVX_PROPERTYPANEL_LINEPAGE_HXX
+
+#include <svx/xdash.hxx>
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <boost/scoped_ptr.hpp>
+#include <boost/scoped_array.hpp>
+#include "sidebar/ColorPopup.hxx"
+#include "LineStylePopup.hxx"
+#include "LineWidthPopup.hxx"
+
+
+namespace svx { class ToolboxButtonColorUpdater; }
+class SvxLineColorPage;
+class SvxLineStylePage;
+class SvxLineWidthPage;
+class XLineStyleItem;
+class XLineDashItem;
+class XLineStartItem;
+class XLineEndItem;
+class LineEndLB_LPP;
+class XLineEndList;
+class ListBox;
+class ToolBox;
+class FloatingWindow;
+
+namespace {
+    const String Dash_Name[] =
+    {
+        String("Ultrafine dashed", 16,  RTL_TEXTENCODING_ASCII_US),				//0
+        String("Dashed (variable)", 17,RTL_TEXTENCODING_ASCII_US ),				//6
+        String("Fine dashed (variable)",22,  RTL_TEXTENCODING_ASCII_US),		//5	
+        String("Fine dashed", 11, RTL_TEXTENCODING_ASCII_US),					//1
+        String("Fine dotted", 11, RTL_TEXTENCODING_ASCII_US),					//3	
+        String("Ultrafine dotted (variable)",27, RTL_TEXTENCODING_ASCII_US),	//8
+        String("3 dashes 3 dots (variable)", 26, RTL_TEXTENCODING_ASCII_US),	//7
+        String("2 dots 1 dash",13,RTL_TEXTENCODING_ASCII_US  )	,				//9
+        String("Ultrafine 2 dots 3 dashes",  25, RTL_TEXTENCODING_ASCII_US),	//2
+        String("Line with fine dots", 19, RTL_TEXTENCODING_ASCII_US)			//4
+    };
+
+
+    const XDash Dash_Set[] =
+    {
+        //Dash, dots, dotlen, dash, dashlen, distance	
+        XDash(XDASH_RECT, 1, 51, 1, 51, 51),									//0
+        XDash(XDASH_RECTRELATIVE, 1, 197, 0,0, 127),							//6
+        XDash(XDASH_RECTRELATIVE, 1, 197,0,0,197),								//5
+        XDash(XDASH_RECT, 1,508, 1,508, 508),									//1
+        XDash(XDASH_RECT, 1,  0, 0,  0, 457),									//3
+        XDash(XDASH_RECTRELATIVE, 1,  0, 0, 0, 50),								//8
+        XDash(XDASH_RECTRELATIVE, 3, 197, 3, 0, 100),							//7
+        XDash(XDASH_RECT, 2, 0, 1, 203,203)	,									//9
+        XDash(XDASH_RECT, 2, 51, 3,254, 127),									//2
+        XDash(XDASH_RECT, 1,2007,10, 0, 152)									//4
+    };
+
+    #define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE String("PopupPanel_LineWidth", 20, RTL_TEXTENCODING_ASCII_US)
+
+} //end of anonymous namespace
+
+
+namespace svx { namespace sidebar {
+
+class PopupContainer;
+class ColorPopup;
+class LineStyleControl;
+class LineWidthControl;
+
+
+class LinePropertyPanel
+:   public Control,
+    public ::sfx2::sidebar::SidebarPanelBase::ContextChangeReceiverInterface,
+    public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+private:
+    friend class ::SvxLineStylePage;
+    friend class ::SvxLineWidthPage;
+
+public:
+    static LinePropertyPanel* 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();
+    void ShowMenu (void);
+
+    void SetLineDashItem(XLineDashItem* pDash);
+    void SetLineStyleItem(XLineStyleItem* pStyle);
+
+    void SetWidth(long nWidth);
+    void SetWidthIcon(int n);
+    void SetWidthIcon();
+
+    void EndLineStylePopupMode (void);
+    void EndLineWidthPopupMode (void);
+
+private:
+    //ui controls
+    ::boost::scoped_ptr< FixedText >                        mpFTWidth;
+    ::boost::scoped_ptr< Window >                           mpTBWidthBackground;
+    ::boost::scoped_ptr< ToolBox >                          mpTBWidth;
+    ::boost::scoped_ptr< FixedText >                        mpFTColor;
+    ::boost::scoped_ptr< Window >                           mpTBColorBackground;
+    ::boost::scoped_ptr< ToolBox >                          mpTBColor;
+    ::boost::scoped_ptr< FixedText >                        mpFTStyle;
+    ::boost::scoped_ptr< Window >                           mpTBStyleBackground;
+    ::boost::scoped_ptr< ToolBox >                          mpTBStyle;
+    ::boost::scoped_ptr< FixedText >                        mpFTTrancparency;
+    ::boost::scoped_ptr< MetricField >                      mpMFTransparent;
+    ::boost::scoped_ptr< FixedText >                        mpFTArrow;
+    ::boost::scoped_ptr< LineEndLB_LPP >                    mpLBStart;
+    ::boost::scoped_ptr< LineEndLB_LPP >                    mpLBEnd;
+    ::boost::scoped_ptr< FixedText >                        mpFTEdgeStyle;
+    ::boost::scoped_ptr< ListBox >                          mpLBEdgeStyle;
+    ::boost::scoped_ptr< FixedText >                        mpFTCapStyle;
+    ::boost::scoped_ptr< ListBox >                          mpLBCapStyle;
+
+    //ControllerItem
+    ::sfx2::sidebar::ControllerItem                         maStyleControl;
+    ::sfx2::sidebar::ControllerItem                         maDashControl;
+    ::sfx2::sidebar::ControllerItem                         maWidthControl;
+    ::sfx2::sidebar::ControllerItem                         maColorControl;
+    ::sfx2::sidebar::ControllerItem                         maStartControl;
+    ::sfx2::sidebar::ControllerItem                         maEndControl;
+    ::sfx2::sidebar::ControllerItem                         maLineEndListControl;
+    ::sfx2::sidebar::ControllerItem                         maTransControl;
+    ::sfx2::sidebar::ControllerItem                         maEdgeStyle;
+    ::sfx2::sidebar::ControllerItem                         maCapStyle;
+
+    Color                                                   maColor;
+    ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
+    ::boost::scoped_ptr< XLineStyleItem >                   mpStyleItem;
+    ::boost::scoped_ptr< XLineDashItem >                    mpDashItem;
+    sal_uInt16                                              mnTrans;
+    SfxMapUnit                                              meMapUnit;
+    sal_Int32                                               mnWidthCoreValue;
+    XLineEndList*                                           mpLineEndList;
+    ::boost::scoped_ptr< XLineStartItem >                   mpStartItem;
+    ::boost::scoped_ptr< XLineEndItem >                     mpEndItem;
+
+    //popup windows
+    ColorPopup maColorPopup;
+    LineStylePopup maLineStylePopup;
+    LineWidthPopup maLineWidthPopup;
+
+    // images from ressource
+    Image                                                   maIMGColor;
+    Image                                                   maIMGNone;
+
+    // multi-images
+    ::boost::scoped_array<Image>                            mpIMGStyleIcon;
+    ::boost::scoped_array<Image>                            mpIMGWidthIcon;
+    ::boost::scoped_array<Image>                            mpIMGStyleIconH;	//high contrast
+    ::boost::scoped_array<Image>                            mpIMGWidthIconH;	//high contrast
+
+    cssu::Reference< css::frame::XFrame >                   mxFrame;
+    ::sfx2::sidebar::EnumContext                            maContext;
+    SfxBindings*                                            mpBindings;
+
+    /// bitfield
+	bool				mbColorAvailable : 1;
+	bool				mbStyleAvailable : 1;
+	bool				mbDashAvailable : 1;
+	bool				mbTransAvailable : 1;
+	bool				mbWidthValuable : 1;
+	bool				mbStartAvailable : 1;
+	bool				mbEndAvailable : 1;
+
+    void SetupIcons(void);
+	void Initialize();	
+	void FillLineEndList();
+	void SelectEndStyle(bool bStart);
+
+	DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* );
+	DECL_LINK(ImplWidthPopupModeEndHdl, FloatingWindow* );
+	DECL_LINK(ToolboxColorSelectHdl, ToolBox*);
+	DECL_LINK(ToolboxStyleSelectHdl, ToolBox*);
+	DECL_LINK(ToolboxWidthSelectHdl, ToolBox*);
+	DECL_LINK(ChangeTransparentHdl , void *);
+	DECL_LINK(ChangeStartHdl, void *);
+	DECL_LINK(ChangeEndHdl, void *);
+	DECL_LINK(ChangeEdgeStyleHdl, void *);
+	DECL_LINK(ChangeCapStyleHdl, void *);
+
+    // constructor/destuctor
+    LinePropertyPanel(
+        Window* pParent,
+        const cssu::Reference<css::frame::XFrame>& rxFrame,
+        SfxBindings* pBindings);
+    virtual ~LinePropertyPanel(void);
+
+    void SetStyleIcon();
+    void SetColor(
+        const String& rsColorName,
+        const Color aColor);
+
+    PopupControl* CreateColorPopupControl (PopupContainer* pParent);
+    PopupControl* CreateLineStylePopupControl (PopupContainer* pParent);
+    PopupControl* CreateLineWidthPopupControl (PopupContainer* pParent);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.src?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.src (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.src Tue Mar  5 12:17:09 2013
@@ -0,0 +1,711 @@
+/**************************************************************
+ * 
+ * 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 "LinePropertyPanel.hrc"
+#include <sfx2/sidebar/propertypanel.hrc>
+#include <svx/dialogs.hrc>
+#include "helpid.hrc"
+
+#define TOOLBOX_WIDTH		50
+#define TOOLBOX_HEIGHT		14
+
+Control RID_SIDEBAR_LINE_PANEL
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+	Text = "Line";
+
+    Size = MAP_APPFONT( 
+        PROPERTYPAGE_WIDTH, 
+        SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*4 + TEXT_CONTROL_SPACING_VERTICAL*4 + TOOLBOX_HEIGHT*3  + CONTROL_SPACING_VERTICAL*3 + CBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT );
+	HelpID = HID_PROPERTYPANEL_LINE_SECTION ;
+	
+	FixedText FT_WIDTH
+	{
+        Pos = MAP_APPFONT( SECTIONPAGE_MARGIN_HORIZONTAL , SECTIONPAGE_MARGIN_VERTICAL_TOP ) ; 
+        Size = MAP_APPFONT (TOOLBOX_WIDTH  , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "~Width:" ;        
+	};
+	ToolBox TB_WIDTH 
+	{
+		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_PPROPERTYPANEL_LINE_TBX_WIDTH ;
+		Text = "Width";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = TBI_WIDTH ;
+				DropDown = TRUE ;
+				Text [ en-US ] = "Width" ;
+				HelpID = HID_PPROPERTYPANEL_LINE_TBI_WIDTH;
+			};
+		};
+	};
+	String STR_QH_TB_WIDTH
+	{
+		Text [ en-US ] = "Select the width of the line.";
+	};
+	
+	FixedText FT_COLOR
+	{
+        Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 3, SECTIONPAGE_MARGIN_VERTICAL_TOP ) ;
+        Size = MAP_APPFONT (TOOLBOX_WIDTH  , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "~Color:" ;        
+	};
+	ToolBox TB_COLOR
+	{
+		SVLook = TRUE ;
+		Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 4, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL) ;
+		Size = MAP_APPFONT (TOOLBOX_WIDTH ,TOOLBOX_HEIGHT ) ;
+		TabStop = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_LINE_TBX_COLOR;
+		Text = "Color";
+		ItemList =
+		{
+			ToolBoxItem
+			{ 
+				Identifier = TBI_COLOR ;
+				DropDown = TRUE ;
+				Text [ en-US ] = "Color" ;
+				HelpID = HID_PPROPERTYPANEL_LINE_TBI_COLOR;
+			};
+		};
+	};
+	String STR_QH_TB_COLOR
+	{
+		Text [ en-US ] = "Select the color of the line.";
+	};
+
+	FixedText FT_STYLE
+	{
+        Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL , SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL + TOOLBOX_HEIGHT  + CONTROL_SPACING_VERTICAL) ;
+        Size = MAP_APPFONT (TOOLBOX_WIDTH  , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "~Style:" ;        
+	};
+	ToolBox TB_STYLE
+	{
+		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 ,TOOLBOX_HEIGHT ) ;
+		TabStop = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_LINE_TBX_STYLE;
+		Text = "Style";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = TBI_STYLE ;
+				DropDown = TRUE ;
+				Text [ en-US ] = "Style" ;
+				HelpID = HID_PPROPERTYPANEL_LINE_TBI_STYLE;
+			};
+		};
+	};
+	String STR_QH_TB_STYLE
+	{
+		Text [ en-US ] = "Select the style of the line.";
+	};
+	
+	FixedText FT_TRANSPARENT
+	{
+        Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 3 , SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL + TOOLBOX_HEIGHT  + CONTROL_SPACING_VERTICAL) ;
+        Size = MAP_APPFONT (TOOLBOX_WIDTH  , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "~Transparency:" ;        
+	};
+	MetricField MF_TRANSPARENT
+	{
+		Border = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_LINE_MTR_TRANCEPARENCE;
+		Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 3 , SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*2 + TEXT_CONTROL_SPACING_VERTICAL*2 + TOOLBOX_HEIGHT  + CONTROL_SPACING_VERTICAL) ;
+		Size = MAP_APPFONT ( TOOLBOX_WIDTH + 1 , 12 ) ;
+		TabStop = TRUE ;
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Maximum = 100 ;
+		StrictFormat = TRUE ;
+		Unit = FUNIT_CUSTOM ;
+		CustomUnitText = "%" ;
+		Last = 100 ;
+		SpinSize = 5 ;
+		QuickHelpText [ en-US ] = "Specify the transparency of the line.";
+	};
+	
+	FixedText FT_ARROW
+	{
+        Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL, SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*2 + TEXT_CONTROL_SPACING_VERTICAL*2 + TOOLBOX_HEIGHT*2  + CONTROL_SPACING_VERTICAL*2) ;
+        Size = MAP_APPFONT (TOOLBOX_WIDTH * 2 + 3 , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "~Arrow:" ;        
+	};
+	ListBox LB_START
+	{
+		Border = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_LINE_LB_START;
+		Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL , SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*3 + TEXT_CONTROL_SPACING_VERTICAL*3 + TOOLBOX_HEIGHT*2  + CONTROL_SPACING_VERTICAL*2 ) ;
+		Size = MAP_APPFONT ( TOOLBOX_WIDTH , 99 ) ;
+		TabStop = TRUE ;
+		DropDown = TRUE ;
+		DDExtraWidth = TRUE ;
+		QuickHelpText [ en-US ] = "Select the style of the beginning arrowhead.";
+	};
+	ListBox LB_END
+	{
+		Border = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_LINE_LB_END;
+		Pos = MAP_APPFONT ( SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 3 , SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*3 + TEXT_CONTROL_SPACING_VERTICAL*3 + TOOLBOX_HEIGHT*2  + CONTROL_SPACING_VERTICAL*2 ) ;
+		Size = MAP_APPFONT ( TOOLBOX_WIDTH + 1, 100 ) ;
+		TabStop = TRUE ;
+		DropDown = TRUE ;
+		DDExtraWidth = TRUE ;
+		QuickHelpText [ en-US ] = "Select the style of the ending arrowhead.";
+	};
+
+	FixedText FT_EDGESTYLE
+	{
+        Pos = MAP_APPFONT ( 
+            SECTIONPAGE_MARGIN_HORIZONTAL, 
+            SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*3 + TEXT_CONTROL_SPACING_VERTICAL*3 + TOOLBOX_HEIGHT*3  + CONTROL_SPACING_VERTICAL*3) ;
+        Size = MAP_APPFONT (TOOLBOX_WIDTH * 2 + 3 , TEXT_HEIGHT ) ;
+		Text [ en-US ] = "~Corner style" ;
+	};
+	ListBox LB_EDGESTYLE
+	{
+		HelpID = HID_PPROPERTYPANEL_LINE_LB_EDGESTYLE;
+		Border = TRUE ;
+		Pos = MAP_APPFONT ( 
+            SECTIONPAGE_MARGIN_HORIZONTAL , 
+            SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*4 + TEXT_CONTROL_SPACING_VERTICAL*4 + TOOLBOX_HEIGHT*3  + CONTROL_SPACING_VERTICAL*3 ) ;
+		Size = MAP_APPFONT ( TOOLBOX_WIDTH , 99 ) ;
+		TabStop = TRUE ;
+		DropDown = TRUE ;
+		DDExtraWidth = TRUE ;
+		QuickHelpText [ en-US ] = "Select the style of the edge connections.";
+		StringList [ en-US ] =
+		{
+			< "Rounded" ; Default ; > ;
+			< "- none -" ; > ;
+			< "Mitered" ; > ;
+			< "Beveled" ; > ;
+		};
+	};
+    FixedText FT_CAPSTYLE
+    {
+        Pos = MAP_APPFONT ( 
+            SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 3, 
+            SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*3 + TEXT_CONTROL_SPACING_VERTICAL*3 + TOOLBOX_HEIGHT*3  + CONTROL_SPACING_VERTICAL*3) ;
+        Size = MAP_APPFONT (TOOLBOX_WIDTH * 2 + 3 , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "Ca~p style" ;
+    };
+    ListBox LB_CAPSTYLE
+    {
+		HelpID = HID_PPROPERTYPANEL_LINE_LB_CAPSTYLE;
+        Border = TRUE ;
+		Pos = MAP_APPFONT ( 
+            SECTIONPAGE_MARGIN_HORIZONTAL + TOOLBOX_WIDTH + 3, 
+            SECTIONPAGE_MARGIN_VERTICAL_TOP + TEXT_HEIGHT*4 + TEXT_CONTROL_SPACING_VERTICAL*4 + TOOLBOX_HEIGHT*3  + CONTROL_SPACING_VERTICAL*3 ) ;
+		Size = MAP_APPFONT ( TOOLBOX_WIDTH , 99 ) ;
+        TabStop = TRUE ;
+        DropDown = TRUE ;
+		DDExtraWidth = TRUE ;
+		QuickHelpText [ en-US ] = "Select the style of the line caps.";
+        StringList [ en-US ] =
+        {
+            < "Flat" ; Default ; > ; // Same string as in Excel
+            < "Round" ; > ;
+            < "Square" ; > ;
+        };
+    };
+
+	Image IMG_COLOR
+	{
+		ImageBitmap = Bitmap{File = "symphony/Line_color.png";};
+	};
+	Image IMG_COLOR_NO
+	{
+		ImageBitmap = Bitmap{File = "symphony/no color.png";};
+	};
+	
+	Image IMG_LINE1_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line1_s.png";};
+	};
+	Image IMG_LINE2_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line2_s.png";};
+	};
+	Image IMG_LINE3_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line3_s.png";};
+	};
+	Image IMG_LINE4_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line4_s.png";};
+	};
+	Image IMG_LINE5_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line5_s.png";};
+	};
+	Image IMG_LINE6_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line6_s.png";};
+	};
+	Image IMG_LINE7_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line7_s.png";};
+	};
+	Image IMG_LINE8_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line8_s.png";};
+	};
+	Image IMG_LINE9_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line9_s.png";};
+	};
+	Image IMG_LINE10_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line10_s.png";};
+	};
+	Image IMG_LINE11_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line11_s.png";};
+	};
+	Image IMG_NONE_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/blank.png";};
+	};
+	
+	//high contrast for line style icon
+	Image IMG_LINE1_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line1_s_h.png";};
+	};
+	Image IMG_LINE2_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line2_s_h.png";};
+	};
+	Image IMG_LINE3_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line3_s_h.png";};
+	};
+	Image IMG_LINE4_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line4_s_h.png";};
+	};
+	Image IMG_LINE5_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line5_s_h.png";};
+	};
+	Image IMG_LINE6_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line6_s_h.png";};
+	};
+	Image IMG_LINE7_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line7_s_h.png";};
+	};
+	Image IMG_LINE8_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line8_s_h.png";};
+	};
+	Image IMG_LINE9_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line9_s_h.png";};
+	};
+	Image IMG_LINE10_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line10_s_h.png";};
+	};
+	Image IMG_LINE11_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line11_s_h.png";};
+	};
+	
+	//WIDTH ICON
+	Image IMG_WIDTH1_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width1.png";};
+	};
+	Image IMG_WIDTH2_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width2.png";};
+	};
+	Image IMG_WIDTH3_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width3.png";};
+	};
+	Image IMG_WIDTH4_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width4.png";};
+	};
+	Image IMG_WIDTH5_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width5.png";};
+	};
+	Image IMG_WIDTH6_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width6.png";};
+	};
+	Image IMG_WIDTH7_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width7.png";};
+	};
+	Image IMG_WIDTH8_ICON
+	{
+		ImageBitmap = Bitmap{File = "symphony/width8.png";};
+	};	
+	
+	//high contrast for line width
+	//WIDTH ICON
+	Image IMG_WIDTH1_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width1_h.png";};
+	};
+	Image IMG_WIDTH2_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width2_h.png";};
+	};
+	Image IMG_WIDTH3_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width3_h.png";};
+	};
+	Image IMG_WIDTH4_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width4_h.png";};
+	};
+	Image IMG_WIDTH5_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width5_h.png";};
+	};
+	Image IMG_WIDTH6_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width6_h.png";};
+	};
+	Image IMG_WIDTH7_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width7_h.png";};
+	};
+	Image IMG_WIDTH8_ICON_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/width8_h.png";};
+	};	
+};
+Control RID_POPUPPANEL_LINEPAGE_COLOR
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+	Size = MAP_APPFONT(  POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT  );
+	
+	Control VS_COLOR
+	{
+		HelpId = HID_PPROPERTYPANEL_LINE_VS_COLOR ;
+        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 = "Color";
+	};
+	String STR_AUTOMATICE
+	{
+		Text [ en-US ] = "No Color";
+	};
+};
+Control RID_POPUPPANEL_LINEPAGE_STYLE
+{
+	OutputSize = TRUE;
+	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);
+	
+	Control VS_STYLE
+	{
+		HelpId = HID_PPROPERTYPANEL_LINE_VS_STYLE ;
+        Hide = TRUE ;
+        Pos = MAP_APPFONT(  POPUPPANEL_MARGIN_SMALL + OFFSET_X , POPUPPANEL_MARGIN_SMALL + OFFSET_Y ); 
+        Size = MAP_APPFONT ( 93  , 13 * 12);
+		TabStop = TRUE ;
+		Text = "Style";
+	};
+
+	PushButton PB_OPTIONS
+	{
+		HelpId = HID_PPROPERTYPANEL_LINE_BTN_STYLE;
+		Pos = MAP_APPFONT (  POPUPPANEL_MARGIN_LARGE + OFFSET_X , POPUPPANEL_MARGIN_SMALL * 2 + OFFSET_Y  );
+		Size = MAP_APPFONT ( 93 , 13 );
+		TabStop = TRUE;
+		Text [ en-US ] = "~More Options...";
+	};
+	
+	String STR_STYLE_NONE
+	{
+		Text [ en-US ] = "None";
+	};
+	String STR_STYLE_LINE1
+	{
+		Text [ en-US ] = "Continuous";
+	};
+	String STR_STYLE_LINE2
+	{
+		Text [ en-US ] = "Ultrafine dashed";
+	};
+	String STR_STYLE_LINE3
+	{
+		Text [ en-US ] = "Dashed (variable)";
+	};
+	String STR_STYLE_LINE4
+	{
+		Text [ en-US ] = "Fine dashed (variable)";
+	};
+	String STR_STYLE_LINE5
+	{
+		Text [ en-US ] = "Fine dashed";
+	};
+	String STR_STYLE_LINE6
+	{
+		Text [ en-US ] = "Fine dotted";
+	};
+	String STR_STYLE_LINE7
+	{
+		Text [ en-US ] = "Ultrafine dotted (variable)";
+	};
+	String STR_STYLE_LINE8
+	{
+		Text [ en-US ] = "3 dashes 3 dots (variable)";
+	};
+	String STR_STYLE_LINE9
+	{
+		Text [ en-US ] = "2 dots 1 dash";
+	};
+	String STR_STYLE_LINE10
+	{
+		Text [ en-US ] = "Ultrafine 2 dots 3 dashes";
+	};
+	String STR_STYLE_LINE11
+	{
+		Text [ en-US ] = "Line with fine dots";
+	};
+	
+	Image IMG_LINE1
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line1.png";};
+	};
+	Image IMG_LINE1_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line1_h.png";};
+	};
+	Image IMG_LINE2
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line2.png";};
+	};
+	Image IMG_LINE2_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line2_h.png";};
+	};
+	Image IMG_LINE3
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line3.png";};
+	};
+	Image IMG_LINE3_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line3_h.png";};
+	};
+	Image IMG_LINE4
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line4.png";};
+	};
+	Image IMG_LINE4_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line4_h.png";};
+	};
+	Image IMG_LINE5
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line5.png";};
+	};
+	Image IMG_LINE5_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line5_h.png";};
+	};
+	Image IMG_LINE6
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line6.png";};
+	};
+	Image IMG_LINE6_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line6_h.png";};
+	};
+	Image IMG_LINE7
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line7.png";};
+	};
+	Image IMG_LINE7_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line7_h.png";};
+	};
+	Image IMG_LINE8
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line8.png";};
+	};
+	Image IMG_LINE8_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line8_h.png";};
+	};
+	Image IMG_LINE9
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line9.png";};
+	};
+	Image IMG_LINE9_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line9_h.png";};
+	};
+	Image IMG_LINE10
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line10.png";};
+	};
+	Image IMG_LINE10_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line10_h.png";};
+	};
+	Image IMG_LINE11
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line11.png";};
+	};
+	Image IMG_LINE11_S
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line11_h.png";};
+	};
+	
+	//high contrast
+	Image IMG_LINE1_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line1_hh.png";};
+	};
+	Image IMG_LINE2_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line2_hh.png";};
+	};
+	Image IMG_LINE3_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line3_hh.png";};
+	};
+	Image IMG_LINE4_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line4_hh.png";};
+	};
+	Image IMG_LINE5_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line5_hh.png";};
+	};
+	Image IMG_LINE6_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line6_hh.png";};
+	};
+	Image IMG_LINE7_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line7_hh.png";};
+	};
+	Image IMG_LINE8_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line8_hh.png";};
+	};
+	Image IMG_LINE9_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line9_hh.png";};
+	};
+	Image IMG_LINE10_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line10_hh.png";};
+	};
+	Image IMG_LINE11_H
+	{
+		ImageBitmap = Bitmap{File = "symphony/style_line11_hh.png";};
+	};
+};
+Control RID_POPUPPANEL_LINEPAGE_WIDTH
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+	
+	Size = MAP_APPFONT(  POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH  + 80,    POPUPPANEL_MARGIN_SMALL + POPUPPANEL_MARGIN_LARGE + POPUP_BORDER_WIDTH + 12 * 9 + POPUPPANEL_MARGIN_SMALL * 2 + TEXT_HEIGHT + (POPUPPANEL_MARGIN_LARGE * 2 +  TEXT_HEIGHT + 12 +  TEXT_CONTROL_SPACING_VERTICAL));
+	
+	Control VS_WIDTH
+	{
+		HelpId = HID_PPROPERTYPANEL_LINE_VS_WIDTH ;
+        Hide = TRUE ;
+        Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X , POPUPPANEL_MARGIN_SMALL + OFFSET_Y ); 
+        Size = MAP_APPFONT ( 80  , 12 * 9);
+		TabStop = TRUE ;
+		Text = "Width";
+	};
+	FixedText FT_CUSTOME
+	{
+        Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_LARGE + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 12 * 9 + POPUPPANEL_MARGIN_SMALL ) ;
+        Size = MAP_APPFONT ( 80  , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "Custom:" ;        
+	};
+	FixedText FT_LINE_WIDTH
+	{
+        Pos = MAP_APPFONT ( CUSTOM_X + POPUPPANEL_MARGIN_LARGE, CUSTOM_Y + POPUPPANEL_MARGIN_LARGE) ;
+        Size = MAP_APPFONT (  74 - POPUPPANEL_MARGIN_LARGE * 2   , TEXT_HEIGHT ) ;
+        Text [ en-US ] = "Line ~width:" ;        
+	};
+	MetricField MF_WIDTH
+	{
+		Border = TRUE ;
+		HelpID = HID_PPROPERTYPANEL_LINE_MTR_WIDTH ;
+		Pos = MAP_APPFONT (  CUSTOM_X + POPUPPANEL_MARGIN_LARGE  , CUSTOM_Y + POPUPPANEL_MARGIN_LARGE + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL) ;
+		Size = MAP_APPFONT ( 40 , 12 ) ;
+		TabStop = TRUE ;
+		Right = TRUE ;
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Maximum = 5000 ;
+		StrictFormat = TRUE ;
+		DecimalDigits = 2 ;
+		Value = 1 ;
+		Unit = FUNIT_MM ;
+		Last = 5000 ;
+		SpinSize = 10 ;
+		QuickHelpText [ en-US ] = "Specify the width of the line.";
+	};
+
+	Image IMG_WIDTH_CUSTOM
+	{
+		ImageBitmap = Bitmap{File = "symphony/last_custom_common.png";};
+	};
+	Image IMG_WIDTH_CUSTOM_GRAY
+	{
+		ImageBitmap = Bitmap{File = "symphony/last_custom_common_grey.png";};
+	};
+	String STR_WIDTH_LAST_CUSTOM
+	{
+		Text [ en-US ] = "Last Custom Value";
+	};
+	String STR_PT
+	{
+		Text [ en-US ] = "pt";
+	};
+};	

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.cxx?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.cxx Tue Mar  5 12:17:09 2013
@@ -0,0 +1,327 @@
+/**************************************************************
+ * 
+ * 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 "LineStyleControl.hxx"
+
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <LinePropertyPanel.hxx>
+#include <LinePropertyPanel.hrc>
+#include <svx/xlnstit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/xenum.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include "svx/sidebar/PopupContainer.hxx"
+
+
+namespace svx { namespace sidebar {
+
+LineStyleControl::LineStyleControl(Window* pParent, svx::sidebar::LinePropertyPanel& rPanel)
+    : PopupControl(pParent,SVX_RES(RID_POPUPPANEL_LINEPAGE_STYLE)),
+      mrLinePropertyPanel(rPanel),
+      mpBindings(NULL),
+      maVSStyle( this, SVX_RES(VS_STYLE)),
+      maPBOptions	(this, SVX_RES(PB_OPTIONS)),
+      mbVS(true)
+{
+	Initialize();
+	FreeResource();
+	mpBindings = mrLinePropertyPanel.GetBindings();
+}
+
+
+
+
+LineStyleControl::~LineStyleControl()
+{
+	delete[] maIMG;
+	delete[] maIMGSel;
+	delete[] maIMGH;
+}
+
+
+
+
+void LineStyleControl::Paint (const Rectangle& rect)
+{
+	svx::sidebar::PopupControl::Paint(rect);
+
+	Color aOldLineColor = GetLineColor();
+	Color aOldFillColor = GetFillColor();
+
+	Point aPos = maPBOptions.GetPosPixel();	
+	Size aSize = maPBOptions.GetSizePixel();
+	Rectangle aRect( aPos, aSize );
+	aRect.Left() -= 1;
+	aRect.Top() -= 1;
+	aRect.Right() += 1;
+	aRect.Bottom() += 1;
+
+	Color aLineColor(159,173,199);
+	if(!GetSettings().GetStyleSettings().GetHighContrastMode())
+		SetLineColor(aLineColor);
+	else
+		SetLineColor(GetSettings().GetStyleSettings().GetShadowColor());
+	SetFillColor(COL_TRANSPARENT);
+	DrawRect(aRect);
+
+	SetLineColor(aOldLineColor);
+	SetFillColor(aOldFillColor);
+}
+
+
+
+
+void LineStyleControl::Initialize()
+{
+	maIMG = new Image[11];
+	maIMG[0] = Image(SVX_RES(IMG_LINE1));
+	maIMG[1] = Image(SVX_RES(IMG_LINE2));
+	maIMG[2] = Image(SVX_RES(IMG_LINE3));
+	maIMG[3] = Image(SVX_RES(IMG_LINE4));
+	maIMG[4] = Image(SVX_RES(IMG_LINE5));
+	maIMG[5] = Image(SVX_RES(IMG_LINE6));
+	maIMG[6] = Image(SVX_RES(IMG_LINE7));
+	maIMG[7] = Image(SVX_RES(IMG_LINE8));
+	maIMG[8] = Image(SVX_RES(IMG_LINE9));
+	maIMG[9] = Image(SVX_RES(IMG_LINE10));
+	maIMG[10] = Image(SVX_RES(IMG_LINE11));
+	
+	maIMGSel = new Image[11];
+	maIMGSel[0] = Image(SVX_RES(IMG_LINE1_S));
+	maIMGSel[1] = Image(SVX_RES(IMG_LINE2_S));
+	maIMGSel[2] = Image(SVX_RES(IMG_LINE3_S));
+	maIMGSel[3] = Image(SVX_RES(IMG_LINE4_S));
+	maIMGSel[4] = Image(SVX_RES(IMG_LINE5_S));
+	maIMGSel[5] = Image(SVX_RES(IMG_LINE6_S));
+	maIMGSel[6] = Image(SVX_RES(IMG_LINE7_S));
+	maIMGSel[7] = Image(SVX_RES(IMG_LINE8_S));
+	maIMGSel[8] = Image(SVX_RES(IMG_LINE9_S));
+	maIMGSel[9] = Image(SVX_RES(IMG_LINE10_S));
+	maIMGSel[10] = Image(SVX_RES(IMG_LINE11_S));
+
+	//for high contrast
+	maIMGH = new Image[11];
+	maIMGH[0] = Image(SVX_RES(IMG_LINE1_H));
+	maIMGH[1] = Image(SVX_RES(IMG_LINE2_H));
+	maIMGH[2] = Image(SVX_RES(IMG_LINE3_H));
+	maIMGH[3] = Image(SVX_RES(IMG_LINE4_H));
+	maIMGH[4] = Image(SVX_RES(IMG_LINE5_H));
+	maIMGH[5] = Image(SVX_RES(IMG_LINE6_H));
+	maIMGH[6] = Image(SVX_RES(IMG_LINE7_H));
+	maIMGH[7] = Image(SVX_RES(IMG_LINE8_H));
+	maIMGH[8] = Image(SVX_RES(IMG_LINE9_H));
+	maIMGH[9] = Image(SVX_RES(IMG_LINE10_H));
+	maIMGH[10] = Image(SVX_RES(IMG_LINE11_H));
+
+// SymCustomButton::HoverButton not available in AOO, use PushButton instead
+//	//high contrast
+//	if(!GetSettings().GetStyleSettings().GetHighContrastMode())
+//	{
+//		maPBOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetPopupPanelBackgroundColor());//Color(244,245,249)
+//		maPBOptions.SetHoverBkColor( GetSettings().GetStyleSettings().GetCustButtonHoverColor() );//Color( 93, 120, 163 )
+//		maPBOptions.SetHoverTxtColor( GetSettings().GetStyleSettings().GetCustButtonTextHoverColor() );//Color( 255, 255, 255 )
+//	}
+//	else
+//	{
+//		maPBOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetMenuColor());//Color(244,245,249)
+//		maPBOptions.SetHoverBkColor( GetSettings().GetStyleSettings().GetMenuColor() );//Color( 93, 120, 163 )
+//		maPBOptions.SetHoverTxtColor( GetSettings().GetStyleSettings().GetCustButtonTextHoverColor() );//Color( 255, 255, 255 )
+//	}
+//
+//	maPBOptions.SetIcoPosX( 2 ); //POPUPPANEL_MARGIN_LARGE  * 2
+
+	Link aLink = LINK( this, LineStyleControl, PBStyleClickHdl ) ;
+	maPBOptions.SetClickHdl(aLink);
+
+	maVSStyle.SetStyle( maVSStyle.GetStyle()| WB_3DLOOK |  WB_NO_DIRECTSELECT  );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD |
+	//maVSStyle.SetControlBackground(COL_WHITE);
+	maVSStyle.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+
+	for(sal_uInt16 i = 1 ; i <= 12 ; i++)
+		maVSStyle.InsertItem(i);
+
+//	maVSStyle.SetItemHelpText(1, String( SVX_RES( STR_STYLE_NONE_TIP ) )); // not supported on AOO
+	maVSStyle.SetItemText(1, String( SVX_RES( STR_STYLE_NONE  ) ));
+	maVSStyle.SetItemText(2, String( SVX_RES( STR_STYLE_LINE1 ) ));
+	maVSStyle.SetItemText(3, String( SVX_RES( STR_STYLE_LINE2 ) ));
+	maVSStyle.SetItemText(4, String( SVX_RES( STR_STYLE_LINE3 ) ));
+	maVSStyle.SetItemText(5, String( SVX_RES( STR_STYLE_LINE4 ) ));
+	maVSStyle.SetItemText(6, String( SVX_RES( STR_STYLE_LINE5 ) ));
+	maVSStyle.SetItemText(7, String( SVX_RES( STR_STYLE_LINE6 ) ));
+	maVSStyle.SetItemText(8, String( SVX_RES( STR_STYLE_LINE7 ) ));
+	maVSStyle.SetItemText(9, String( SVX_RES( STR_STYLE_LINE8 ) ));
+	maVSStyle.SetItemText(10, String( SVX_RES( STR_STYLE_LINE9 ) ));
+	maVSStyle.SetItemText(11, String( SVX_RES( STR_STYLE_LINE10 ) ));
+	maVSStyle.SetItemText(12, String( SVX_RES( STR_STYLE_LINE11 ) ));
+	SetAllNoSel();
+	maVSStyle.SetFirstString(String( SVX_RES( STR_STYLE_NONE) ));
+	
+	aLink =  LINK( this, LineStyleControl, VSSelectHdl ) ;
+    maVSStyle.SetSelectHdl(aLink);
+
+	maVSStyle.StartSelection();
+	maVSStyle.Show();
+}
+
+
+
+
+void LineStyleControl::GetFocus()
+{
+	if(mbVS)
+		maVSStyle.GrabFocus();
+	else
+		maPBOptions.GrabFocus();
+}
+
+
+
+
+Control& LineStyleControl::GetPB()
+{
+	return maPBOptions;
+}
+
+
+
+
+ValueSet& LineStyleControl::GetValueSet()
+{
+	return maVSStyle;
+}
+
+
+
+
+void LineStyleControl::SetStyleSelect(XLineStyleItem* pStyle, XLineDashItem* pDash, bool bAvailable, bool bDashAvailable)
+{
+	mbVS = false;
+	SetAllNoSel();
+	if( !bAvailable)
+	{
+		maVSStyle.Format();
+		maVSStyle.StartSelection();
+		return;
+	}
+
+    const XLineStyle eXLS(pStyle ? (XLineStyle)pStyle->GetValue() : XLINE_NONE);
+
+	switch(eXLS)
+	{
+	case XLINE_NONE:
+		maVSStyle.SetFirstSelect(true);
+		maVSStyle.SelectItem(1); //add 
+		mbVS = true;
+		break;
+	case XLINE_SOLID:
+		maVSStyle.SetItemImage(2, maIMGSel[0]);
+		maVSStyle.SelectItem(2);		//add 
+		mbVS = true;
+		break;
+	case XLINE_DASH:
+		if(pDash && bDashAvailable)
+		{
+			String aDashName = pDash->GetName() ;
+			for( sal_uInt16 n = 0; n < 10; n++ )
+			{
+				if( Dash_Name[n] == aDashName )
+				{
+					maVSStyle.SetItemImage( n + 3, maIMGSel[n+1]);
+					maVSStyle.SelectItem( n + 3 );		//add 
+					mbVS = true;
+					break;
+				}
+			}
+		}
+		break;
+	}
+	maVSStyle.Format();
+	maVSStyle.StartSelection();
+//	GetFocus(mbVS);
+}
+
+
+
+
+void LineStyleControl::SetAllNoSel()
+{
+	maVSStyle.SelectItem(1); // ,false);		//modified // 'false' nut supported by AOO
+	maVSStyle.SetNoSelection();
+	maVSStyle.SetFirstSelect(false);
+	for(sal_uInt16 i = 2; i <= 12; i++)
+		maVSStyle.SetItemImage(i, GetDisplayBackground().GetColor().IsDark() ? maIMGH[i-2] : maIMG[i-2]);
+}
+
+
+
+
+IMPL_LINK(LineStyleControl, VSSelectHdl, void *, pControl)
+{
+	if(pControl == &maVSStyle)  
+	{
+		XLineStyleItem* pStyleItem = NULL;
+		sal_uInt16 iPos = maVSStyle.GetSelectItemId();
+		if(iPos == 1)
+		{
+			pStyleItem = new XLineStyleItem( XLINE_NONE);
+		}
+		else if(iPos == 2)
+		{
+			pStyleItem = new XLineStyleItem( XLINE_SOLID);
+		}
+		else
+		{
+			pStyleItem = new XLineStyleItem( XLINE_DASH );
+			XLineDashItem aDashItem( Dash_Name[iPos - 3], Dash_Set[iPos - 3]);
+			mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_DASH, SFX_CALLMODE_RECORD, &aDashItem, 0L);
+			mrLinePropertyPanel.SetLineDashItem(&aDashItem);
+		}
+		mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SFX_CALLMODE_RECORD, pStyleItem, 0L);
+		mrLinePropertyPanel.SetLineStyleItem(pStyleItem);
+		delete pStyleItem;
+
+		mrLinePropertyPanel.EndLineStylePopupMode();
+	}
+	return( 0L );
+}
+
+
+
+
+IMPL_LINK(LineStyleControl, PBStyleClickHdl, PushButton *, pPBtn)
+{
+	if(pPBtn == &maPBOptions)  
+	{
+		if (mpBindings)
+		{
+			SfxDispatcher* pDisp = mpBindings->GetDispatcher();
+			pDisp->Execute( SID_ATTRIBUTES_LINE, SFX_CALLMODE_ASYNCHRON );
+		}
+		mrLinePropertyPanel.EndLineStylePopupMode();
+	}
+	return 0;
+}
+
+
+} } // end of namespace svx::sidebar

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.hxx?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStyleControl.hxx Tue Mar  5 12:17:09 2013
@@ -0,0 +1,67 @@
+/**************************************************************
+ * 
+ * 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 "svx/sidebar/PopupControl.hxx"
+#include <vcl/button.hxx>
+#include "LineStyleValueSet.hxx"
+
+
+class XLineStyleItem;
+class XLineDashItem;
+class SfxBindings;
+class Image;
+
+
+namespace svx { namespace sidebar {
+
+class LinePropertyPanel;
+
+class LineStyleControl
+    : public svx::sidebar::PopupControl
+{
+public:
+	LineStyleControl (Window* pParent, svx::sidebar::LinePropertyPanel& rPanel);
+	virtual ~LineStyleControl (void);
+    
+	void GetFocus();
+	void SetStyleSelect(XLineStyleItem* pStyle, XLineDashItem* pDash, bool bStyleAvailable, bool bDashAvailable);
+	virtual void Paint(const Rectangle& rect);
+	ValueSet& GetValueSet();
+	Control& GetPB();
+
+private:	
+	svx::sidebar::LinePropertyPanel&    mrLinePropertyPanel;
+	SfxBindings*		                mpBindings;
+	LineStyleValueSet maVSStyle;
+    PushButton                          maPBOptions;
+	Image*	                            maIMG;
+	Image*	                            maIMGSel;
+	Image*	                            maIMGH;		// high contrast
+	bool	                            mbVS;
+
+	void Initialize();
+	void SetAllNoSel();
+
+	DECL_LINK( PBStyleClickHdl, PushButton *);
+	DECL_LINK(VSSelectHdl, void *);
+};
+
+} } // end of namespace svx::sidebar

Added: openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStylePopup.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStylePopup.cxx?rev=1452760&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStylePopup.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/line/LineStylePopup.cxx Tue Mar  5 12:17:09 2013
@@ -0,0 +1,91 @@
+/**************************************************************
+ * 
+ * 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 "LineStylePopup.hxx"
+#include "LineStyleControl.hxx"
+
+
+namespace svx { namespace sidebar {
+
+LineStylePopup::LineStylePopup (
+    Window* pParent,
+    const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator)
+    : Popup(
+        pParent,
+        rControlCreator, 
+        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Style")))
+{
+}
+
+
+
+
+LineStylePopup::~LineStylePopup (void)
+{
+}
+
+
+
+
+void LineStylePopup::CreateContainerAndControl (void)
+{
+
+    Popup::CreateContainerAndControl();
+
+    LineStyleControl* pControl = dynamic_cast<LineStyleControl*>(mpControl.get());
+    if (pControl != NULL)
+    {
+        Size aSize = pControl->GetSizePixel();
+        Size aSizeVS(182, 23*12);
+
+        pControl->GetValueSet().SetSizePixel(aSizeVS);
+        aSize.setWidth (aSize.Width() + aSizeVS.Width());
+        aSize.setHeight (aSize.Height() + aSizeVS.Height());
+        pControl->SetSizePixel(aSize);
+        pControl->GetPB().SetSizePixel(
+            Size(
+                aSizeVS.Width() - 15 ,
+                pControl->GetPB().GetSizePixel().Height()) );
+        pControl->GetPB().SetPosPixel(
+            Point(
+                pControl->GetPB().GetPosPixel().X(),
+                pControl->GetPB().GetPosPixel().Y() + aSizeVS.Height()));
+    }
+}
+
+
+
+
+void LineStylePopup::SetStyleSelect (
+	XLineStyleItem* pStyleItem,
+    XLineDashItem* pDashItem,
+    const bool bIsStyleItemAvailable,
+    const bool bIsDashItemAvailable)
+{
+    ProvideContainerAndControl();
+
+    LineStyleControl* pControl = dynamic_cast<LineStyleControl*>(mpControl.get());
+    if (pControl != NULL)
+        pControl->SetStyleSelect(pStyleItem, pDashItem, bIsStyleItemAvailable, bIsDashItemAvailable);
+}
+
+
+} } // end of namespace svx::sidebar