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:47:25 UTC

svn commit: r1459519 [2/2] - in /openoffice/branches/sidebar/main: default_images/svx/res/ sfx2/inc/sfx2/sidebar/ sfx2/source/sidebar/ svx/inc/svx/sidebar/ svx/source/sidebar/ svx/source/sidebar/debug/ svx/source/sidebar/possize/

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Thu Mar 21 20:47:25 2013
@@ -0,0 +1,1182 @@
+/**************************************************************
+ * 
+ * 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 "PosSizePropertyPanel.hxx"
+#include "PosSizePropertyPanel.hrc"
+#include "SidebarDialControl.hxx"
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/objsh.hxx>
+#include <svx/dlgutil.hxx>
+#include <unotools/viewoptions.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/toolbox.hxx>
+#include <svx/svdview.hxx>
+#include <svl/aeitem.hxx>
+
+using namespace css;
+using namespace cssu;
+using ::sfx2::sidebar::Theme;
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+#define USERITEM_NAME rtl::OUString::createFromAscii("FitItem")
+#define NO_SELECT       (65535)
+
+
+
+namespace svx { namespace sidebar {
+
+
+
+PosSizePropertyPanel::PosSizePropertyPanel(
+    Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+:   Control(
+        pParent, 
+        SVX_RES(RID_SIDEBAR_POSSIZE_PANEL)),
+    mpFtPosX(new FixedText(this, SVX_RES(FT_SBSHAPE_HORIZONTAL))),
+    mpMtrPosX(new MetricField(this, SVX_RES(MF_SBSHAPE_HORIZONTAL))),
+    mpFtPosY(new FixedText(this, SVX_RES(FT_SBSHAPE_VERTICAL))),
+    mpMtrPosY(new MetricField(this, SVX_RES(MF_SBSHAPE_VERTICAL))),
+    mpFtWidth(new FixedText(this, SVX_RES(FT_WIDTH))),
+    mpMtrWidth(new MetricField(this, SVX_RES(MTR_FLD_WIDTH))),
+    mpFtHeight(new FixedText(this, SVX_RES(FT_HEIGHT))),
+    mpMtrHeight(new MetricField(this, SVX_RES(MTR_FLD_HEIGHT))),
+    mpCbxScale(new CheckBox(this, SVX_RES(CBX_SCALE))),
+    mpFtAngle(new FixedText(this, SVX_RES(FT_ANGLE))),
+    mpMtrAngle(new MetricBox(this, SVX_RES(MTR_FLD_ANGLE))),
+    mpDial(new SidebarDialControl(this, SVX_RES(DIAL_CONTROL))),
+    mpFtFlip(new FixedText(this, SVX_RES(FT_FLIP))),
+    mpFlipTbxBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
+    mpFlipTbx(sfx2::sidebar::ControlFactory::CreateToolBox(mpFlipTbxBackground.get(), SVX_RES(TBX_FLIP))),
+    maRect(),
+    mpView(0),
+    mlOldWidth(1),
+    mlOldHeight(1),
+    meRP(RP_LT),
+    maAnchorPos(),
+    mlRotX(0),
+    mlRotY(0),
+    maUIScale(),
+    mePoolUnit(),
+    meDlgUnit(),
+    maTransfPosXControl(SID_ATTR_TRANSFORM_POS_X, *pBindings, *this),
+    maTransfPosYControl(SID_ATTR_TRANSFORM_POS_Y, *pBindings, *this),
+    maTransfWidthControl(SID_ATTR_TRANSFORM_WIDTH, *pBindings, *this),
+    maTransfHeightControl(SID_ATTR_TRANSFORM_HEIGHT, *pBindings, *this),
+    maSvxAngleControl( SID_ATTR_TRANSFORM_ANGLE, *pBindings, *this),
+    maRotXControl(SID_ATTR_TRANSFORM_ROT_X, *pBindings, *this),
+    maRotYControl(SID_ATTR_TRANSFORM_ROT_Y, *pBindings, *this),
+    maProPosControl(SID_ATTR_TRANSFORM_PROTECT_POS, *pBindings, *this),
+    maProSizeControl(SID_ATTR_TRANSFORM_PROTECT_SIZE, *pBindings, *this),
+    maAutoWidthControl(SID_ATTR_TRANSFORM_AUTOWIDTH, *pBindings, *this),
+    maAutoHeightControl(SID_ATTR_TRANSFORM_AUTOHEIGHT, *pBindings, *this),
+    m_aMetricCtl(SID_ATTR_METRIC, *pBindings, *this),
+    maImgFlipHori(SVX_RES(IMG_HORI_FLIP)),
+    maImgFlipVert(SVX_RES(IMG_VERT_FLIP)),
+    mxFrame(rxFrame),
+    maContext(),
+    mpBindings(pBindings),
+    mbMtrPosXMirror(false),
+    mbSizeProtected(false),
+    mbPositionProtected(false),
+    mbAutoWidth(false),
+    mbAutoHeight(false),
+    mbAdjustEnabled(false),
+    mbIsFlip(false),
+    mbInDestructor(false)
+{
+	Initialize();
+	FreeResource();	
+}
+
+
+
+PosSizePropertyPanel::~PosSizePropertyPanel()
+{
+    mbInDestructor = true;
+
+    // Destroy the background windows of the toolboxes.
+    mpFlipTbx.reset();
+    mpFlipTbxBackground.reset();
+}
+
+
+
+void PosSizePropertyPanel::ShowMenu (void)
+{
+    if (mpBindings != NULL)
+    {
+        SfxDispatcher* pDispatcher = mpBindings->GetDispatcher();
+        if (pDispatcher != NULL)
+            pDispatcher->Execute(SID_ATTR_TRANSFORM, SFX_CALLMODE_ASYNCHRON);
+    }
+}
+
+
+
+void PosSizePropertyPanel::Initialize()
+{
+	//Position : Horizontal / Vertical
+	mpMtrPosX->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangePosXHdl ) );
+	mpMtrPosY->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangePosYHdl ) );
+	mpMtrPosX->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Horizontal")));	//wj acc
+	mpMtrPosY->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Vertical")));		//wj acc
+	
+    //Size : Width / Height
+	mpMtrWidth->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangeWidthHdl ) );
+	mpMtrHeight->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangeHeightHdl ) );
+	mpMtrWidth->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")));	//wj acc
+	mpMtrHeight->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")));	//wj acc
+	
+    //Size : Keep ratio
+	mpCbxScale->SetClickHdl( LINK( this, PosSizePropertyPanel, ClickAutoHdl ) );
+	
+    //rotation:
+	mpMtrAngle->SetModifyHdl(LINK( this, PosSizePropertyPanel, AngleModifiedHdl));
+	mpMtrAngle->EnableAutocomplete( false );
+	mpMtrAngle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Rotation")));	//wj acc
+	
+    //rotation control
+	mpDial->SetModifyHdl(LINK( this, PosSizePropertyPanel, RotationHdl));
+	
+    //flip:
+	mpFlipTbx->SetSelectHdl( LINK( this, PosSizePropertyPanel, FlipHdl) );
+	mpFlipTbx->SetItemImage(FLIP_HORIZONTAL,maImgFlipHori);
+    mpFlipTbx->SetItemImage(FLIP_VERTICAL,maImgFlipVert);
+	mpFlipTbx->SetQuickHelpText(FLIP_HORIZONTAL,String(SVX_RES(STR_QH_HORI_FLIP))); //Add
+	mpFlipTbx->SetQuickHelpText(FLIP_VERTICAL,String(SVX_RES(STR_QH_VERT_FLIP))); //Add
+	
+	mpMtrPosX->SetAccessibleRelationLabeledBy(mpFtPosX.get());	
+	mpMtrPosY->SetAccessibleRelationLabeledBy(mpFtPosY.get());	
+	mpMtrWidth->SetAccessibleRelationLabeledBy(mpFtWidth.get());	
+	mpMtrHeight->SetAccessibleRelationLabeledBy(mpFtHeight.get());	
+	mpMtrAngle->SetAccessibleRelationLabeledBy(mpFtAngle.get());
+	//mpMtrAngle->SetMpSubEditAccLableBy(mpFtAngle.get());
+	mpFlipTbx->SetAccessibleRelationLabeledBy(mpFtFlip.get());
+
+    mpMtrAngle->InsertValue(0, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(4500, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(9000, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(13500, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(18000, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(22500, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(27000, FUNIT_CUSTOM);
+	mpMtrAngle->InsertValue(31500, FUNIT_CUSTOM);
+    mpMtrAngle->SetDropDownLineCount(8);
+
+    SfxViewShell* pCurSh = SfxViewShell::Current();
+	if ( pCurSh )
+		mpView = pCurSh->GetDrawView();
+	else
+		mpView = NULL;
+
+	if ( mpView != NULL )
+	{
+		maUIScale = mpView->GetModel()->GetUIScale();
+
+		const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+		if(1 == rMarkList.GetMarkCount())
+		{
+			const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+			const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
+
+			if((pObj->GetObjInventor() == SdrInventor) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && ((SdrTextObj*)pObj)->HasText())
+			{
+				mbAdjustEnabled = true;
+			}
+		}
+	}
+	
+    mePoolUnit = maTransfWidthControl.GetCoreMetric();
+	meDlgUnit = GetModuleFieldUnit();
+	SetFieldUnit( *mpMtrPosX, meDlgUnit, true );
+	SetFieldUnit( *mpMtrPosY, meDlgUnit, true );
+	SetFieldUnit( *mpMtrWidth, meDlgUnit, true );
+	SetFieldUnit( *mpMtrHeight, meDlgUnit, true );
+}
+
+
+
+void PosSizePropertyPanel::SetupIcons(void)
+{
+    if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
+    {
+        // todo
+    }
+    else
+    {
+        // todo
+    }
+}
+
+
+
+PosSizePropertyPanel* PosSizePropertyPanel::Create (
+    Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+{
+    if (pParent == NULL)
+        throw lang::IllegalArgumentException(A2S("no parent Window given to PosSizePropertyPanel::Create"), NULL, 0);
+    if ( ! rxFrame.is())
+        throw lang::IllegalArgumentException(A2S("no XFrame given to PosSizePropertyPanel::Create"), NULL, 1);
+    if (pBindings == NULL)
+        throw lang::IllegalArgumentException(A2S("no SfxBindings given to PosSizePropertyPanel::Create"), NULL, 2);
+    
+    return new PosSizePropertyPanel(
+        pParent,
+        rxFrame,
+        pBindings);
+}
+
+
+
+void PosSizePropertyPanel::DataChanged(
+    const DataChangedEvent& rEvent)
+{
+    (void)rEvent;
+    
+    SetupIcons();
+}
+
+
+
+void PosSizePropertyPanel::HandleContextChange(
+    const ::sfx2::sidebar::EnumContext aContext)
+{
+    if(maContext == aContext)
+    {
+        // Nothing to do.
+        return;
+    }
+
+    maContext = aContext;
+
+    sal_Int32 nLayoutMode (0);
+    switch (maContext.GetCombinedContext_DI())
+    {
+        case CombinedEnumContext(Application_Writer, Context_Draw):
+            nLayoutMode = 0;
+            break;
+
+        case CombinedEnumContext(Application_Writer, Context_Graphic):
+		case CombinedEnumContext(Application_Writer, Context_Media):
+		case CombinedEnumContext(Application_Writer, Context_Frame):
+		case CombinedEnumContext(Application_Writer, Context_OLE):
+		case CombinedEnumContext(Application_Writer, Context_Form):
+            nLayoutMode = 1;
+            break;
+
+        case CombinedEnumContext(Application_Calc, Context_Draw):
+		case CombinedEnumContext(Application_Calc, Context_Graphic):
+        case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+        case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+        case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+            nLayoutMode = 2;
+		    break;
+
+        case CombinedEnumContext(Application_Calc, Context_Chart):
+		case CombinedEnumContext(Application_Calc, Context_Form):
+		case CombinedEnumContext(Application_Calc, Context_Media):
+		case CombinedEnumContext(Application_Calc, Context_OLE):
+		case CombinedEnumContext(Application_Calc, Context_MultiObject):
+		case CombinedEnumContext(Application_DrawImpress, Context_Media):
+		case CombinedEnumContext(Application_DrawImpress, Context_Form):
+		case CombinedEnumContext(Application_DrawImpress, Context_OLE):
+		case CombinedEnumContext(Application_DrawImpress, Context_3DObject):
+		case CombinedEnumContext(Application_DrawImpress, Context_MultiObject):
+            nLayoutMode = 3;
+            break;
+    }    
+    switch (nLayoutMode)
+    {
+        case 0:
+		{
+			mpMtrWidth->SetMin( 2 );
+			mpMtrHeight->SetMin( 2 );
+			mpFtPosX->Hide();
+			mpMtrPosX->Hide();
+			mpFtPosY->Hide();
+			mpMtrPosY->Hide();
+			
+            //rotation
+			mpFtAngle->Show();
+			mpMtrAngle->Show();
+			mpDial->Show();
+			
+            //flip
+			mpFtFlip->Show();
+			mpFlipTbx->Show();
+			Size aTbxSize = mpFlipTbx->CalcWindowSizePixel();
+			mpFlipTbx->SetOutputSizePixel( aTbxSize );
+			mbIsFlip = true;
+
+			mpFtWidth->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_X_X,FT_POSITION_X_Y), MAP_APPFONT)));
+			mpMtrWidth->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_X_X,MF_POSITION_X_Y), MAP_APPFONT)));
+			mpFtHeight->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_Y_X,FT_POSITION_Y_Y), MAP_APPFONT)));
+			mpMtrHeight->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_Y_X,MF_POSITION_Y_Y), MAP_APPFONT)));
+			mpCbxScale->SetPosPixel(Point(LogicToPixel(Point(FT_WIDTH_X,FT_WIDTH_Y), MAP_APPFONT)));
+
+			mpFtAngle->SetPosPixel(Point(LogicToPixel(Point(FT_ANGLE_X,FT_ANGLE_Y), MAP_APPFONT)));
+			mpMtrAngle->SetPosPixel(Point(LogicToPixel(Point(MF_ANGLE_X2,MF_ANGLE_Y2), MAP_APPFONT)));
+			mpFlipTbx->SetPosPixel(Point(LogicToPixel(Point(FLIP_HORI_X2,FLIP_HORI_Y2), MAP_APPFONT)));
+			mpDial->SetPosPixel(Point(LogicToPixel(Point(ROTATE_CONTROL_X2,ROTATE_CONTROL_Y2), MAP_APPFONT)));
+			mpFtFlip->SetPosPixel(Point(LogicToPixel(Point(FT_FLIP_X2,FT_FLIP_Y2), MAP_APPFONT)));
+
+			Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT2);
+			aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 
+			SetSizePixel(aSize);
+		}
+		break;
+
+        case 1:		
+		{
+			mpMtrWidth->SetMin( 2 );
+			mpMtrHeight->SetMin( 2 );
+			mpFtPosX->Hide();
+			mpMtrPosX->Hide();
+			mpFtPosY->Hide();
+			mpMtrPosY->Hide();
+        
+			//rotation
+			mpFtAngle->Hide();
+			mpMtrAngle->Hide();
+			mpDial->Hide();
+        
+			//flip
+			mpFlipTbx->Hide();
+			mpFtFlip->Hide();
+			mbIsFlip = false;
+        
+			mpFtWidth->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_X_X,FT_POSITION_X_Y), MAP_APPFONT)));
+			mpMtrWidth->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_X_X,MF_POSITION_X_Y), MAP_APPFONT)));
+			mpFtHeight->SetPosPixel(Point(LogicToPixel(Point(FT_POSITION_Y_X,FT_POSITION_Y_Y), MAP_APPFONT)));
+			mpMtrHeight->SetPosPixel(Point(LogicToPixel(Point(MF_POSITION_Y_X,MF_POSITION_Y_Y), MAP_APPFONT)));
+			mpCbxScale->SetPosPixel(Point(LogicToPixel(Point(FT_WIDTH_X,FT_WIDTH_Y), MAP_APPFONT)));
+        
+			Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT3);
+			aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 
+			SetSizePixel(aSize);
+		}
+		break;
+
+        case 2:
+		{
+			mpMtrWidth->SetMin( 1 );
+			mpMtrHeight->SetMin( 1 );
+			mpFtPosX->Show();
+			mpMtrPosX->Show();
+			mpFtPosY->Show();
+			mpMtrPosY->Show();
+        
+			//rotation
+			mpFtAngle->Show();
+			mpMtrAngle->Show();
+			mpDial->Show();
+        
+            //flip
+			mpFlipTbx->Show();
+			mpFtFlip->Show();
+			Size aTbxSize = mpFlipTbx->CalcWindowSizePixel();
+			mpFlipTbx->SetOutputSizePixel( aTbxSize );
+			mbIsFlip = true;
+        
+			Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT);
+			aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 
+			SetSizePixel(aSize);
+		}
+		break;
+        
+		case 3:
+		{
+			mpMtrWidth->SetMin( 1 );
+			mpMtrHeight->SetMin( 1 );
+			mpFtPosX->Show();
+			mpMtrPosX->Show();
+			mpFtPosY->Show();
+			mpMtrPosY->Show();
+        
+			//rotation
+			mpFtAngle->Hide();
+			mpMtrAngle->Hide();
+			mpDial->Hide();
+        
+			//flip
+			mpFlipTbx->Hide();
+			mpFtFlip->Hide();
+			mbIsFlip = false;
+        
+			Size aSize(GetOutputSizePixel().Width(),PS_SECTIONPAGE_HEIGHT4);
+			aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 
+			SetSizePixel(aSize);
+		}
+		break;
+	}
+
+    //Added for windows classic theme
+	mpFlipTbx->SetBackground(Wallpaper());
+	mpFlipTbx->SetPaintTransparent(true);
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, ChangeWidthHdl, void*, pBox )
+{
+	if( mpCbxScale->IsChecked() &&
+		mpCbxScale->IsEnabled() )
+	{
+		long nHeight = (long) ( ((double) mlOldHeight * (double) mpMtrWidth->GetValue()) / (double) mlOldWidth );
+		if( nHeight <= mpMtrHeight->GetMax( FUNIT_NONE ) )
+		{
+			mpMtrHeight->SetUserValue( nHeight, FUNIT_NONE );
+		}
+		else
+		{
+			nHeight = (long)mpMtrHeight->GetMax( FUNIT_NONE );
+			mpMtrHeight->SetUserValue( nHeight );
+			const long nWidth = (long) ( ((double) mlOldWidth * (double) nHeight) / (double) mlOldHeight );
+			mpMtrWidth->SetUserValue( nWidth, FUNIT_NONE );
+		}
+	}
+	executeSize();
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, ChangeHeightHdl, void *, EMPTYARG )
+{
+	if( mpCbxScale->IsChecked() &&
+		mpCbxScale->IsEnabled() )
+	{
+		long nWidth = (long) ( ((double)mlOldWidth * (double)mpMtrHeight->GetValue()) / (double)mlOldHeight );
+		if( nWidth <= mpMtrWidth->GetMax( FUNIT_NONE ) )
+		{
+			mpMtrWidth->SetUserValue( nWidth, FUNIT_NONE );
+		}
+		else
+		{
+			nWidth = (long)mpMtrWidth->GetMax( FUNIT_NONE );
+			mpMtrWidth->SetUserValue( nWidth );
+			const long nHeight = (long) ( ((double)mlOldHeight * (double)nWidth) / (double)mlOldWidth );
+			mpMtrHeight->SetUserValue( nHeight, FUNIT_NONE );
+		}
+	}
+	executeSize();
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, ChangePosXHdl, void *, EMPTYARG )
+{
+	executePosX();
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, ChangePosYHdl, void *, EMPTYARG )
+{
+	executePosY();
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, ClickAutoHdl, void *, EMPTYARG )
+{
+	if ( mpCbxScale->IsChecked() )
+	{
+		mlOldWidth  = Max( GetCoreValue( *mpMtrWidth,  mePoolUnit ), 1L );
+		mlOldHeight = Max( GetCoreValue( *mpMtrHeight, mePoolUnit ), 1L );
+	}
+
+	// mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog
+	SvtViewOptions	aPageOpt( E_TABPAGE, String::CreateFromInt32( RID_SVXPAGE_POSITION_SIZE ) );
+	aPageOpt.SetUserItem( USERITEM_NAME, ::com::sun::star::uno::makeAny( ::rtl::OUString( String::CreateFromInt32( mpCbxScale->IsChecked() ) ) ) );
+
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, AngleModifiedHdl, void *, EMPTYARG )
+{
+	String sTmp = mpMtrAngle->GetText();
+	bool    bNegative = 0;
+	sal_Unicode nChar = sTmp.GetChar( 0 );
+
+	if( nChar == '-' )
+	{
+		bNegative = 1;
+		nChar = sTmp.GetChar( 1 );
+	}
+
+	if( (nChar < '0') || (nChar > '9') )
+		return 0;
+	double dTmp = sTmp.ToDouble();
+	if(bNegative)
+	{
+		while(dTmp<0)
+			dTmp += 360;
+	}
+	sal_Int64 nTmp = dTmp*100;
+
+	SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,(sal_uInt32) nTmp);
+	SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X,(sal_uInt32) mlRotX);
+	SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y,(sal_uInt32) mlRotY);
+	
+	GetBindings()->GetDispatcher()->Execute(
+		SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aAngleItem, &aRotXItem, &aRotYItem, 0L );
+
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, RotationHdl, void *, EMPTYARG )
+{
+	sal_Int32 nTmp = mpDial->GetRotation();
+
+	SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,(sal_uInt32) nTmp);
+	SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X,(sal_uInt32) mlRotX);
+	SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y,(sal_uInt32) mlRotY);
+	
+	GetBindings()->GetDispatcher()->Execute(
+		SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aAngleItem, &aRotXItem, &aRotYItem, 0L );
+
+	return 0;
+}
+
+
+
+IMPL_LINK( PosSizePropertyPanel, FlipHdl, ToolBox*, pBox )
+{
+	switch (pBox->GetCurItemId())
+	{
+		case FLIP_HORIZONTAL:
+		{
+			SfxVoidItem aHoriItem (SID_FLIP_HORIZONTAL);
+			GetBindings()->GetDispatcher()->Execute(
+				SID_FLIP_HORIZONTAL, SFX_CALLMODE_RECORD, &aHoriItem, 0L );
+		}
+		break;
+		case FLIP_VERTICAL:
+		{
+			SfxVoidItem aVertItem (SID_FLIP_VERTICAL );
+			GetBindings()->GetDispatcher()->Execute(
+				SID_FLIP_VERTICAL, SFX_CALLMODE_RECORD, &aVertItem, 0L );
+		}
+		break;
+	}
+	return 0;
+}
+
+
+
+void PosSizePropertyPanel::NotifyItemUpdate( 
+    sal_uInt16 nSID, 
+    SfxItemState eState, 
+    const SfxPoolItem* pState)
+{  
+	mpFtAngle->Enable();
+	mpMtrAngle->Enable();
+	mpDial->Enable();
+	mpFtFlip->Enable();
+	mpFlipTbx->Enable();
+
+    const SfxUInt32Item*	pWidthItem;
+	const SfxUInt32Item*	pHeightItem;		
+	
+	SfxViewShell* pCurSh = SfxViewShell::Current();
+	if ( pCurSh )
+		mpView = pCurSh->GetDrawView();
+	else
+		mpView = NULL;
+
+	if ( mpView == NULL )
+		return;
+
+	const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+
+	if(1 == rMarkList.GetMarkCount())
+	{
+		const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+		const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
+
+		if((pObj->GetObjInventor() == SdrInventor) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && ((SdrTextObj*)pObj)->HasText())
+			mbAdjustEnabled = true;
+		else
+			mbAdjustEnabled = false;
+	}
+	else
+		mbAdjustEnabled = false;
+
+	switch (nSID)
+    {
+        case SID_ATTR_TRANSFORM_WIDTH:
+            if ( SFX_ITEM_AVAILABLE == eState )
+            {
+                pWidthItem = dynamic_cast< const SfxUInt32Item* >(pState);
+
+                if (pWidthItem)
+                {				
+                    long mlOldWidth1 = pWidthItem->GetValue();
+
+                    mlOldWidth1 = Fraction( mlOldWidth1 ) / maUIScale;
+                    SetMetricValue( *mpMtrWidth, mlOldWidth1, mePoolUnit );
+                    mlOldWidth = mlOldWidth1;
+                }
+            }
+            else
+            {
+                mpMtrWidth->SetText( String());
+            }
+            break;
+            
+        case SID_ATTR_TRANSFORM_HEIGHT:
+            if ( SFX_ITEM_AVAILABLE == eState )
+            {
+                pHeightItem = dynamic_cast< const SfxUInt32Item* >(pState);
+
+                if(pHeightItem)
+                {
+                    long mlOldHeight1 = pHeightItem->GetValue();
+
+                    mlOldHeight1 = Fraction( mlOldHeight1 ) / maUIScale;
+                    SetMetricValue( *mpMtrHeight, mlOldHeight1, mePoolUnit );
+                    mlOldHeight = mlOldHeight1;
+                }
+            }
+            else
+            {
+                mpMtrHeight->SetText( String());
+            }
+            break;
+
+        case SID_ATTR_TRANSFORM_POS_X:
+        {
+            const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            {
+                long nTmp = pItem->GetValue(); 
+                nTmp = Fraction( nTmp ) / maUIScale;
+                SetMetricValue( *mpMtrPosX, nTmp, mePoolUnit );
+            }
+            else
+            {
+                mpMtrPosX->SetText( String());
+            }
+            break;
+        }
+        
+        case SID_ATTR_TRANSFORM_POS_Y:
+        {
+            const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState);
+
+            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            {
+                long nTmp = pItem->GetValue(); 
+                nTmp = Fraction( nTmp ) / maUIScale;
+                SetMetricValue( *mpMtrPosY, nTmp, mePoolUnit );
+            }
+            else
+            {
+                mpMtrPosY->SetText( String());
+            }
+            break;
+        }
+        
+        case SID_ATTR_TRANSFORM_ROT_X:
+            if (SFX_ITEM_AVAILABLE == eState)
+            {
+                mlRotX = ((const SfxInt32Item*)pState)->GetValue(); 
+                mlRotX = Fraction( mlRotX ) / maUIScale;
+            }
+            break;
+
+        case SID_ATTR_TRANSFORM_ROT_Y:
+            if (SFX_ITEM_AVAILABLE == eState)
+            {
+                mlRotY = ((const SfxInt32Item*)pState)->GetValue(); 
+                mlRotY = Fraction( mlRotY ) / maUIScale;
+            }
+            break;
+
+        case SID_ATTR_TRANSFORM_PROTECT_POS:
+        {
+            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            {
+                // record the state of position protect
+                mbPositionProtected = pItem->GetValue();
+            }
+            else
+            {
+                mbPositionProtected = false;
+            }
+            break;
+        }
+
+        case SID_ATTR_TRANSFORM_PROTECT_SIZE:
+        {
+            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            {
+                // record the state of size protect
+                mbSizeProtected = pItem->GetValue();
+            }
+            else
+            {
+                mbSizeProtected = false;
+            }
+            break;
+        }
+
+        case SID_ATTR_TRANSFORM_AUTOWIDTH:
+        {
+            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            {
+                mbAutoWidth = pItem->GetValue();
+            }
+            break;
+        }
+
+        case SID_ATTR_TRANSFORM_AUTOHEIGHT:
+        {
+            const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >(pState);
+
+            if (SFX_ITEM_AVAILABLE == eState && pItem)
+            {
+                mbAutoHeight = pItem->GetValue();
+            }
+            break;
+        }
+
+        case SID_ATTR_TRANSFORM_ANGLE:
+            if (eState >= SFX_ITEM_AVAILABLE)
+            {
+                long nTmp = ((const SfxInt32Item*)pState)->GetValue(); 
+                mpMtrAngle->SetValue( nTmp );
+                mpDial->SetRotation( nTmp );
+                switch(nTmp)
+                {
+                    case 0:
+                        mpMtrAngle->SelectEntryPos(0);
+                        break;
+                    case 4500:
+                        mpMtrAngle->SelectEntryPos(1);
+                        break;
+                    case 9000:
+                        mpMtrAngle->SelectEntryPos(2);
+                        break;
+                    case 13500:
+                        mpMtrAngle->SelectEntryPos(3);
+                        break;
+                    case 18000:
+                        mpMtrAngle->SelectEntryPos(4);
+                        break;
+                    case 22500:
+                        mpMtrAngle->SelectEntryPos(5);
+                        break;
+                    case 27000:
+                        mpMtrAngle->SelectEntryPos(6);
+                        break;
+                    case 315000:
+                        mpMtrAngle->SelectEntryPos(7);
+                }
+            }
+            else
+            {
+                mpMtrAngle->SetText( String() );
+                mpDial->SetRotation( 0 );
+            }
+            break;
+            
+        case SID_ATTR_METRIC:
+            MetricState( eState, pState );
+            break;
+
+        default:
+            break;
+    }
+
+    const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
+
+    switch (rMarkList.GetMarkCount())
+    {
+        case 0:
+            break;
+
+        case 1:
+        {
+            const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+            const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
+
+            if(((nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_Draw) 
+                        || nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_TextObject)
+                        ) && OBJ_EDGE == eKind)
+                || OBJ_CAPTION == eKind)
+            {
+                mpFtAngle->Disable();
+                mpMtrAngle->Disable();
+                mpDial->Disable();
+                mpFlipTbx->Disable();
+                mpFtFlip->Disable();
+            }
+            break;
+        }
+        
+        default:
+        {
+            sal_uInt16 nMarkObj = 0;
+            bool isNoEdge = true;
+            while(rMarkList.GetMark(nMarkObj))
+            {
+                const SdrObject* pObj = rMarkList.GetMark(nMarkObj)->GetMarkedSdrObj();
+                const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
+
+                if(((nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_Draw)
+                            || nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_TextObject)
+                            ) && OBJ_EDGE == eKind) 
+                    || OBJ_CAPTION == eKind)
+                {
+                    isNoEdge = false;
+                    break;
+                }
+                nMarkObj++;
+            }
+            if(!isNoEdge)
+            {
+                mpFtAngle->Disable();
+                mpMtrAngle->Disable();
+                mpDial->Disable();
+                mpFlipTbx->Disable();
+                mpFtFlip->Disable();
+            }
+            break;
+        }
+    }
+
+    if(nCombinedContext == CombinedEnumContext(Application_DrawImpress, Context_TextObject))
+	{
+		mpFlipTbx->Disable();
+		mpFtFlip->Disable();
+	}
+
+    DisableControls();
+
+	// mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog
+	SvtViewOptions	aPageOpt( E_TABPAGE, String::CreateFromInt32( RID_SVXPAGE_POSITION_SIZE ) );
+	String	sUserData;
+	::com::sun::star::uno::Any	aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
+	::rtl::OUString	aTemp;
+	if ( aUserItem >>= aTemp )
+		sUserData = String( aTemp );
+	mpCbxScale->Check( (bool)sUserData.ToInt32() );
+}
+
+
+
+SfxBindings* PosSizePropertyPanel::GetBindings() 
+{ 
+    return mpBindings; 
+}
+
+
+
+void PosSizePropertyPanel::executeSize()
+{
+	if ( mpMtrWidth->IsValueModified() || mpMtrHeight->IsValueModified())
+	{
+		Fraction aUIScale = mpView->GetModel()->GetUIScale();
+
+		// get Width
+		double nWidth = (double)mpMtrWidth->GetValue( meDlgUnit );
+		nWidth = MetricField::ConvertDoubleValue( nWidth, mpMtrWidth->GetBaseValue(), mpMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
+		long lWidth = (long)(nWidth * (double)aUIScale);
+		lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
+		lWidth = (long)mpMtrWidth->Denormalize( lWidth );
+
+		// get Height
+		double nHeight = (double)mpMtrHeight->GetValue( meDlgUnit );
+		nHeight = MetricField::ConvertDoubleValue( nHeight, mpMtrHeight->GetBaseValue(), mpMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
+		long lHeight = (long)(nHeight * (double)aUIScale);
+		lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
+		lHeight = (long)mpMtrWidth->Denormalize( lHeight );
+
+		// put Width & Height to itemset
+		SfxUInt32Item aWidthItem( SID_ATTR_TRANSFORM_WIDTH, (sal_uInt32) lWidth);
+		SfxUInt32Item aHeightItem( SID_ATTR_TRANSFORM_HEIGHT, (sal_uInt32) lHeight);
+		SfxAllEnumItem aPointItem (SID_ATTR_TRANSFORM_SIZE_POINT, (sal_uInt16)meRP);
+        const sal_Int32 nCombinedContext(maContext.GetCombinedContext());
+
+        if( nCombinedContext == CombinedEnumContext(Application_Writer, Context_Graphic) // mnContextId == PROPERTY_CONTEXT_SW_GRAPHIC 
+            || nCombinedContext == CombinedEnumContext(Application_Writer, Context_OLE) //mnContextId == PROPERTY_CONTEXT_SW_OLE
+            )
+        // if( mnContextId == PROPERTY_CONTEXT_SW_GRAPHIC || mnContextId == PROPERTY_CONTEXT_SW_OLE )
+        {
+			GetBindings()->GetDispatcher()->Execute(SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aWidthItem, &aHeightItem, &aPointItem, 0L );
+        }
+		else
+		{
+			if ( (mpMtrWidth->IsValueModified()) && (mpMtrHeight->IsValueModified()))
+				GetBindings()->GetDispatcher()->Execute(SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aWidthItem, &aHeightItem, &aPointItem, 0L );
+			else if( mpMtrWidth->IsValueModified())
+				GetBindings()->GetDispatcher()->Execute(SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aWidthItem, &aPointItem, 0L );
+			else if ( mpMtrHeight->IsValueModified())
+				GetBindings()->GetDispatcher()->Execute(SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aHeightItem, &aPointItem, 0L );
+		}		
+	}
+}
+
+
+
+void PosSizePropertyPanel::executePosX()
+{
+	if ( mpMtrPosX->IsValueModified())
+	{
+		long lX = GetCoreValue( *mpMtrPosX, mePoolUnit );
+		if( mbMtrPosXMirror )
+			lX = -lX;
+		long lY = GetCoreValue( *mpMtrPosY, mePoolUnit );
+
+		Size aPageSize;
+		Rectangle aRect;
+		maRect = mpView->GetAllMarkedRect();	
+		aRect = mpView->GetAllMarkedRect();
+
+		Fraction aUIScale = mpView->GetModel()->GetUIScale();
+		lX += maAnchorPos.X();
+		lX = Fraction( lX ) * aUIScale;
+		lY += maAnchorPos.Y();
+		lY = Fraction( lY ) * aUIScale;
+		
+		SfxInt32Item aPosXItem( SID_ATTR_TRANSFORM_POS_X,(sal_uInt32) lX);
+		SfxInt32Item aPosYItem( SID_ATTR_TRANSFORM_POS_Y,(sal_uInt32) lY);
+	
+		GetBindings()->GetDispatcher()->Execute(
+			SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aPosXItem, 0L );	
+	}
+}
+
+
+
+void PosSizePropertyPanel::executePosY()
+{
+	if ( mpMtrPosY->IsValueModified() )
+	{
+		long lX = GetCoreValue( *mpMtrPosX, mePoolUnit );
+		long lY = GetCoreValue( *mpMtrPosY, mePoolUnit );
+
+		Size aPageSize;
+		Rectangle aRect;
+		maRect = mpView->GetAllMarkedRect();	
+		aRect = mpView->GetAllMarkedRect();
+
+		Fraction aUIScale = mpView->GetModel()->GetUIScale();
+		lX += maAnchorPos.X();
+		lX = Fraction( lX ) * aUIScale;
+		lY += maAnchorPos.Y();
+		lY = Fraction( lY ) * aUIScale;
+		
+		SfxInt32Item aPosXItem( SID_ATTR_TRANSFORM_POS_X,(sal_uInt32) lX);
+		SfxInt32Item aPosYItem( SID_ATTR_TRANSFORM_POS_Y,(sal_uInt32) lY);
+	
+		GetBindings()->GetDispatcher()->Execute(
+			SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aPosYItem, 0L );	
+	}
+}
+
+
+
+void PosSizePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pState )
+{
+	bool bPosXBlank = false;
+	bool bPosYBlank = false;
+	bool bWidthBlank = false;
+	bool bHeightBlank = false;
+	String sNull = String::CreateFromAscii("");
+	meDlgUnit = GetCurrentUnit(eState,pState);
+
+	if( mpMtrPosX->GetText() == sNull )
+		bPosXBlank = true;
+	SetFieldUnit( *mpMtrPosX, meDlgUnit, true );
+	if(bPosXBlank)
+		mpMtrPosX->SetText(String());
+
+	if( mpMtrPosY->GetText() == sNull )
+		bPosYBlank = true;
+	SetFieldUnit( *mpMtrPosY, meDlgUnit, true );
+	if(bPosYBlank)
+		mpMtrPosY->SetText(String());
+
+	if( mpMtrWidth->GetText() == sNull )
+		bWidthBlank = true;
+	SetFieldUnit( *mpMtrWidth, meDlgUnit, true );
+	if(bWidthBlank)
+		mpMtrWidth->SetText(String());
+
+	if( mpMtrHeight->GetText() == sNull )
+		bHeightBlank = true;
+	SetFieldUnit( *mpMtrHeight, meDlgUnit, true );
+	if(bHeightBlank)
+		mpMtrHeight->SetText(String());
+}
+
+
+
+FieldUnit PosSizePropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState )
+{
+	FieldUnit eUnit = FUNIT_NONE;
+
+	if ( pState && eState >= SFX_ITEM_DEFAULT )
+		eUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue();
+	else
+	{
+		SfxViewFrame* pFrame = SfxViewFrame::Current();
+		SfxObjectShell* pSh = NULL;
+		if ( pFrame )
+			pSh = pFrame->GetObjectShell();
+		if ( pSh )
+		{
+			SfxModule* pModule = pSh->GetModule();
+			if ( pModule )
+			{
+				const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
+				if ( pItem )
+					eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+			}
+			else
+			{
+				DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" );
+			}
+		}
+	}
+	
+	return eUnit;
+}
+
+
+
+void PosSizePropertyPanel::DisableControls()
+{
+    if( mbPositionProtected )
+	{	
+		// the position is protected("Position protect" option in modal dialog is checked),
+		// disable all the Position controls in sidebar
+		mpFtPosX->Disable();
+		mpMtrPosX->Disable();
+		mpFtPosY->Disable();
+		mpMtrPosY->Disable();
+		mpFtAngle->Disable();
+		mpMtrAngle->Disable();
+		mpDial->Disable();
+		mpFtFlip->Disable();
+		mpFlipTbx->Disable();
+
+		mpFtWidth->Disable();
+		mpMtrWidth->Disable();
+		mpFtHeight->Disable();
+		mpMtrHeight->Disable();
+        mpCbxScale->Disable();
+	}
+	else
+	{
+		mpFtPosX->Enable();
+		mpMtrPosX->Enable();
+		mpFtPosY->Enable();
+		mpMtrPosY->Enable();
+
+        //mpFtAngle->Enable();
+		//mpMtrAngle->Enable();
+		//mpDial->Enable();
+		//mpFtFlip->Enable();
+		//mpFlipTbx->Enable();
+
+		if( mbSizeProtected )
+		{
+			mpFtWidth->Disable();
+			mpMtrWidth->Disable();
+			mpFtHeight->Disable();
+			mpMtrHeight->Disable();
+			mpCbxScale->Disable();
+		}
+		else
+		{
+			if(	mbAdjustEnabled )
+			{
+				if( mbAutoWidth )
+				{
+					mpFtWidth->Disable();
+					mpMtrWidth->Disable();
+					mpCbxScale->Disable();
+				}
+				else
+				{
+					mpFtWidth->Enable();
+					mpMtrWidth->Enable();
+				}
+				if( mbAutoHeight )
+				{
+					mpFtHeight->Disable();
+					mpMtrHeight->Disable();
+					mpCbxScale->Disable();
+				}
+				else
+				{
+					mpFtHeight->Enable();
+					mpMtrHeight->Enable();
+				}
+				if( !mbAutoWidth && !mbAutoHeight )
+					mpCbxScale->Enable();
+			}
+			else
+			{
+				mpFtWidth->Enable();
+				mpMtrWidth->Enable();
+				mpFtHeight->Enable();
+				mpMtrHeight->Enable();
+				mpCbxScale->Enable();
+			}
+		}
+	}
+}
+
+
+} } // end of namespace svx::sidebar

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

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc Thu Mar 21 20:47:25 2013
@@ -0,0 +1,111 @@
+/**************************************************************
+ * 
+ * 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_POSSIZE_PANEL--------------------------------------------------------------
+#define FT_WIDTH                                            1
+#define MTR_FLD_WIDTH										2
+#define FT_HEIGHT                                           3
+#define MTR_FLD_HEIGHT										4
+#define CBX_SCALE										    5
+#define FT_SBSHAPE_HORIZONTAL                               7
+#define MF_SBSHAPE_HORIZONTAL                               8
+#define FT_SBSHAPE_VERTICAL                                 9
+#define MF_SBSHAPE_VERTICAL                                 10
+#define FT_SBSHAPE_POSREFERENCE                             11
+#define CTL_SBSHAPE_POSREFERENCE                            12
+#define FT_ANGLE											13
+#define MTR_FLD_ANGLE										14
+#define TBX_FLIP                                            15
+#define DIAL_CONTROL										17
+#define FLIP_HORIZONTAL										18
+#define FLIP_VERTICAL										19
+#define IMG_HORI_FLIP										20
+#define IMG_VERT_FLIP									    21
+#define FT_FLIP												22
+#define STR_QH_HORI_FLIP									23
+#define STR_QH_VERT_FLIP									24
+
+#define IMG_DIACONTROL_NORMAL		                        25
+#define IMG_DIACONTROL_H			                        26
+
+#define MBOX_WIDTH						50
+#define TEXT_WIDTH                      40
+#define FLIP_BUTTON_SIZE                13
+#define ALIGNMENT_TBX_HEIGHT  17
+#define ALIGNMENT_TBX_WIDTH   13
+
+#define FT_POSITION_X_X							SECTIONPAGE_MARGIN_HORIZONTAL
+#define FT_POSITION_X_Y							SECTIONPAGE_MARGIN_VERTICAL_TOP
+#define MF_POSITION_X_X							FT_POSITION_X_X
+#define MF_POSITION_X_Y							FT_POSITION_X_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+#define FT_POSITION_Y_X							FT_POSITION_X_X + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL
+#define FT_POSITION_Y_Y							FT_POSITION_X_Y
+#define MF_POSITION_Y_X							FT_POSITION_Y_X
+#define MF_POSITION_Y_Y							MF_POSITION_X_Y
+
+#define FT_WIDTH_X								SECTIONPAGE_MARGIN_HORIZONTAL
+#define FT_WIDTH_Y								MF_POSITION_X_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+#define FLD_WIDTH_X								FT_WIDTH_X
+#define FLD_WIDTH_Y								FT_WIDTH_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+#define FT_HEIGHT_X								FT_WIDTH_X + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL				
+#define FT_HEIGHT_Y								FT_WIDTH_Y
+#define FLD_HEIGHT_X							FT_HEIGHT_X
+#define FLD_HEIGHT_Y							FLD_WIDTH_Y
+#define CBX_X                                   FT_WIDTH_X
+#define CBX_Y									FLD_WIDTH_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+/////////////////////
+#define FT_ROTATION_X							FT_WIDTH_X			
+#define FT_ROTATION_Y							CBX_Y + CONTROL_SPACING_VERTICAL + TEXT_HEIGHT
+
+#define MF_ROTATION_X							FT_ROTATION_X + 40 + CONTROL_SPACING_HORIZONTAL
+#define MF_ROTATION_Y							FT_ROTATION_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+
+#define ROTATE_CONTROL_X						FT_ROTATION_X
+#define ROTATE_CONTROL_Y						MF_ROTATION_Y + 4
+
+#define FT_FLIP_X                               MF_ROTATION_X
+#define FT_FLIP_Y								MF_ROTATION_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 5
+
+#define BTN_FLIP_HORI_X                         PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2 - 1   // wj for 7926
+#define BTN_FLIP_HORI_Y							FT_FLIP_Y - 5
+////////////////////////////////
+
+#define FT_ANGLE_X                              FLD_WIDTH_X
+#define FT_ANGLE_Y								FLD_WIDTH_Y + 4
+
+#define MF_ANGLE_X2								MF_ROTATION_X
+#define MF_ANGLE_Y2								FT_ANGLE_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+
+#define ROTATE_CONTROL_X2						FT_ANGLE_X
+#define ROTATE_CONTROL_Y2						MF_ANGLE_Y2 + 4
+
+#define FT_FLIP_X2                              MF_ANGLE_X2
+#define FT_FLIP_Y2								MF_ANGLE_Y2 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 5
+
+#define FLIP_HORI_X2							PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2		//FT_FLIP_X2 + 22
+#define FLIP_HORI_Y2							FT_FLIP_Y2 - 5
+
+#define PS_SECTIONPAGE_HEIGHT                   BTN_FLIP_HORI_Y + ALIGNMENT_TBX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT + 2
+#define PS_SECTIONPAGE_HEIGHT2                  FLIP_HORI_Y2 + ALIGNMENT_TBX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT + 2
+#define PS_SECTIONPAGE_HEIGHT3                  FT_WIDTH_Y + TEXT_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
+#define PS_SECTIONPAGE_HEIGHT4                  CBX_Y + CBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
+
+// eof

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx Thu Mar 21 20:47:25 2013
@@ -0,0 +1,176 @@
+/**************************************************************
+ * 
+ * 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_POSIZEPAGE_HXX
+#define SVX_PROPERTYPANEL_POSIZEPAGE_HXX
+
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <boost/scoped_ptr.hpp>
+#include <svx/rectenum.hxx>
+#include <svl/poolitem.hxx>
+#include <tools/fldunit.hxx>
+
+
+class DialControl;
+class SdrView;
+class FixedText;
+class MetricField;
+class CheckBox;
+class MetricBox;
+
+
+namespace svx { namespace sidebar {
+
+class SidebarDialControl;
+
+class PosSizePropertyPanel
+:   public Control,
+    public ::sfx2::sidebar::IContextChangeReceiver,
+    public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+public:
+    static PosSizePropertyPanel* 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);
+
+private:
+    //Position
+    ::boost::scoped_ptr< FixedText >        mpFtPosX;
+    ::boost::scoped_ptr< MetricField >      mpMtrPosX;
+    ::boost::scoped_ptr< FixedText >        mpFtPosY;
+    ::boost::scoped_ptr< MetricField >      mpMtrPosY;
+
+    // size
+    ::boost::scoped_ptr< FixedText >        mpFtWidth;
+    ::boost::scoped_ptr< MetricField >      mpMtrWidth;
+    ::boost::scoped_ptr< FixedText >        mpFtHeight;
+    ::boost::scoped_ptr< MetricField >      mpMtrHeight;
+    ::boost::scoped_ptr< CheckBox >         mpCbxScale;
+
+    //rotation
+    ::boost::scoped_ptr< FixedText >        mpFtAngle;
+    ::boost::scoped_ptr< MetricBox >        mpMtrAngle;
+
+    //rotation control
+    ::boost::scoped_ptr<SidebarDialControl> mpDial;
+
+    //flip
+    ::boost::scoped_ptr< FixedText >        mpFtFlip;
+    ::boost::scoped_ptr< Window >           mpFlipTbxBackground;
+    ::boost::scoped_ptr< ToolBox >          mpFlipTbx;
+
+    // Internal variables
+    Rectangle                               maRect;
+    const SdrView*                          mpView;
+    sal_uInt32                              mlOldWidth;
+    sal_uInt32                              mlOldHeight;
+    RECT_POINT                              meRP;
+    Point                                   maAnchorPos;    //anchor position
+    long                                    mlRotX;
+    long                                    mlRotY;
+    Fraction                                maUIScale;
+    SfxMapUnit                              mePoolUnit;
+    FieldUnit                               meDlgUnit;
+
+    // Controller Items
+    ::sfx2::sidebar::ControllerItem         maTransfPosXControl;
+    ::sfx2::sidebar::ControllerItem         maTransfPosYControl;
+    ::sfx2::sidebar::ControllerItem         maTransfWidthControl;
+    ::sfx2::sidebar::ControllerItem         maTransfHeightControl;
+
+    ::sfx2::sidebar::ControllerItem         maSvxAngleControl;
+    ::sfx2::sidebar::ControllerItem         maRotXControl;
+    ::sfx2::sidebar::ControllerItem         maRotYControl;
+    ::sfx2::sidebar::ControllerItem         maProPosControl;
+    ::sfx2::sidebar::ControllerItem         maProSizeControl;
+    ::sfx2::sidebar::ControllerItem         maAutoWidthControl;
+    ::sfx2::sidebar::ControllerItem         maAutoHeightControl;
+    ::sfx2::sidebar::ControllerItem         m_aMetricCtl;
+
+    // images from ressource
+    Image                                   maImgFlipHori;
+    Image                                   maImgFlipVert;
+
+    cssu::Reference< css::frame::XFrame >   mxFrame;
+    ::sfx2::sidebar::EnumContext            maContext;
+    SfxBindings*                            mpBindings;
+
+    /// bitfield
+    bool                                    mbMtrPosXMirror : 1;
+    bool                                    mbSizeProtected : 1;
+    bool                                    mbPositionProtected : 1;
+    bool                                    mbAutoWidth : 1;
+    bool                                    mbAutoHeight : 1;
+    bool                                    mbAdjustEnabled : 1;
+    bool                                    mbIsFlip : 1;
+    bool                                    mbInDestructor : 1;
+
+    DECL_LINK( ChangePosXHdl, void * );
+    DECL_LINK( ChangePosYHdl, void * );
+    DECL_LINK( ChangeWidthHdl, void * );
+    DECL_LINK( ChangeHeightHdl, void * );
+    DECL_LINK( ClickAutoHdl, void * );
+    DECL_LINK( AngleModifiedHdl, void * );
+    DECL_LINK( RotationHdl, void * );
+    DECL_LINK( FlipHdl, ToolBox * );
+
+    void SetupIcons(void);
+    void Initialize();
+    void executePosX();
+    void executePosY();
+    void executeSize();
+
+    // constructor/destuctor
+    PosSizePropertyPanel(
+        Window* pParent,
+        const cssu::Reference<css::frame::XFrame>& rxFrame,
+        SfxBindings* pBindings);
+    virtual ~PosSizePropertyPanel();
+
+    void MetricState( SfxItemState eState, const SfxPoolItem* pState );
+    FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
+    void DisableControls();
+};
+
+
+} } // end of namespace svx::sidebar
+
+
+
+#endif // SVX_PROPERTYPANEL_POSIZEPAGE_HXX

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

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.src?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.src (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.src Thu Mar 21 20:47:25 2013
@@ -0,0 +1,236 @@
+/**************************************************************
+ * 
+ * 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 "PosSizePropertyPanel.hrc"
+#include <sfx2/sidebar/propertypanel.hrc>
+#include <svx/dialogs.hrc>
+#include "helpid.hrc"
+
+#define TOOLBOX_HEIGHT		14
+
+Control RID_SIDEBAR_POSSIZE_PANEL
+{
+	OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+
+	Size = MAP_APPFONT(
+         PROPERTYPAGE_WIDTH,
+         BTN_FLIP_HORI_Y + TOOLBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT);
+	HelpID = HID_PROPERTYPANEL_POSIZE_SECTION ;
+	Text  = "Position and Size";
+	
+	FixedText FT_WIDTH
+	{
+	    Pos = MAP_APPFONT ( FT_WIDTH_X, FT_WIDTH_Y );
+        Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Width:";
+	};
+	MetricField MTR_FLD_WIDTH
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( FLD_WIDTH_X, FLD_WIDTH_Y );
+        Size = MAP_APPFONT ( MBOX_WIDTH, MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "Enter a width for the selected object.";
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Maximum = 9999 ;
+		StrictFormat = TRUE ;
+		Unit = FUNIT_INCH;
+		Last = 9999 ;
+		SpinSize = 2 ;
+		HelpID = HID_PROPERTY_PANEL_POSIZE_MTR_FLD_WIDTH;
+	};
+	FixedText FT_HEIGHT
+	{
+	    Pos = MAP_APPFONT ( FT_HEIGHT_X, FT_HEIGHT_Y );
+        Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT) ;
+		Text [ en-US ] = "H~eight:";
+	};
+	MetricField MTR_FLD_HEIGHT
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( FLD_HEIGHT_X, FLD_HEIGHT_Y );
+        Size = MAP_APPFONT ( MBOX_WIDTH + 1, MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "Enter a height for the selected object.";
+		Repeat = TRUE ;
+		Spin = TRUE ;
+		Maximum = 9999 ;
+		StrictFormat = TRUE ;
+		Unit = FUNIT_INCH;
+		Last = 9999 ;
+		SpinSize = 2 ;
+		HelpID = HID_PROPERTY_PANEL_POSIZE_MTR_FLD_HEIGHT;
+	};
+	CheckBox CBX_SCALE
+	{
+		Pos = MAP_APPFONT ( CBX_X , CBX_Y ) ;
+        Size = MAP_APPFONT ( MBOX_WIDTH + 30 , CBOX_HEIGHT ) ;
+		TabStop = TRUE ;
+		Text [ en-US ] = "~Keep ratio" ;
+		QuickHelpText [ en-US ] = "Maintain proportions when you resize the selected object.";
+		HelpID = HID_PROPERTY_PANEL_POSIZE_CBX_SCALE;
+	};
+	//------------ Position ------------
+	FixedText FT_SBSHAPE_HORIZONTAL
+	{
+		Pos = MAP_APPFONT ( FT_POSITION_X_X, FT_POSITION_X_Y );
+		Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Horizontal:";
+	};
+	MetricField MF_SBSHAPE_HORIZONTAL
+	{
+		Border = TRUE;
+		Pos = MAP_APPFONT ( MF_POSITION_X_X , MF_POSITION_X_Y );
+		Size = MAP_APPFONT ( MBOX_WIDTH, MBOX_HEIGHT ) ;
+		QuickHelpText [ en-US ] = "Enter the value for the horizontal position.";
+		TabStop = TRUE;
+		Repeat = TRUE;
+		Spin = TRUE;
+		Minimum = -120000;
+		Maximum = 240000;
+		StrictFormat = TRUE;
+		DecimalDigits = 2;
+		Unit = FUNIT_MM;
+		SpinSize = 10;
+		HelpID = HID_PROPERTY_PANEL_POSIZE_MF_HORIZONTAL;
+	};
+	FixedText FT_SBSHAPE_VERTICAL
+	{
+		Pos = MAP_APPFONT ( FT_POSITION_Y_X , FT_POSITION_Y_Y );
+		Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Vertical:";
+	};	
+	MetricField MF_SBSHAPE_VERTICAL
+	{
+		Border = TRUE;
+		Pos = MAP_APPFONT ( MF_POSITION_Y_X , MF_POSITION_Y_Y );
+		Size = MAP_APPFONT ( MBOX_WIDTH, MBOX_HEIGHT ) ;
+		QuickHelpText [ en-US ] = "Enter the value for the vertical position.";
+		TabStop = TRUE;
+		Repeat = TRUE;
+		Spin = TRUE;
+		Minimum = -120000;
+		Maximum = 240000;
+		StrictFormat = TRUE;
+		DecimalDigits = 2;
+		Unit = FUNIT_MM;
+		SpinSize = 10;
+		HelpID = HID_PROPERTY_PANEL_POSIZE_MF_VERTICAL;
+	};
+	FixedText FT_ANGLE
+	{
+		Pos = MAP_APPFONT ( FT_ROTATION_X , FT_ROTATION_Y );
+		Size = MAP_APPFONT ( TEXT_WIDTH + 50, TEXT_HEIGHT) ;
+		Text [ en-US ] = "~Rotation:";
+	};	
+	
+	MetricBox MTR_FLD_ANGLE
+	{
+		Border = TRUE ;
+        Pos = MAP_APPFONT ( MF_ROTATION_X , MF_ROTATION_Y );
+        Size = MAP_APPFONT ( MBOX_WIDTH + 10, MBOX_HEIGHT ) ;
+        QuickHelpText [ en-US ] = "Select the angle for rotation.";
+		Unit = FUNIT_CUSTOM ;
+		CustomUnitText [ en-US ] = " degrees";
+		DecimalDigits = 2;
+		Minimum = -18000;		// set minmun value or it will be 0 as default
+		TabStop = TRUE ;
+		DropDown = TRUE ;
+		HelpID = HID_PROPERTY_PANEL_POSIZE_MTR_FLD_ANGLE;
+	};
+	
+	FixedText FT_FLIP
+	{
+		Pos = MAP_APPFONT ( FT_FLIP_X , FT_FLIP_Y );
+		Size = MAP_APPFONT ( PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL*2  - 40 - CONTROL_SPACING_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2 , TEXT_HEIGHT) ;//20     wj
+		Text [ en-US ] = "~Flip:";
+	};
+	
+	ToolBox TBX_FLIP
+	{
+        Pos = MAP_APPFONT ( BTN_FLIP_HORI_X , BTN_FLIP_HORI_Y );
+        Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 2, TOOLBOX_HEIGHT);
+		SVLook = TRUE ;
+		Border = FALSE ;
+		HelpID = HID_PROPERTY_PANEL_POSIZE_TBX_FLIP;
+		Text = "Flip";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = FLIP_VERTICAL ;
+				Text [ en-US ] = "Flip Vertically" ;
+				HelpID = HID_PROPERTY_PANEL_POSIZE_FLIP_VERTICAL;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/FlipVertically_16x16.png";
+				};
+			};
+			ToolBoxItem
+			{
+				Identifier = FLIP_HORIZONTAL ;
+				Text [ en-US ] = "Flip Horizontally" ;
+				HelpID = HID_PROPERTY_PANEL_POSIZE_FLIP_HORIZONTAL;
+				ItemBitmap = Bitmap
+				{
+					File = "symphony/FlipHorizontally_16x16.png";
+				};
+			};
+		};
+	};
+	
+	String STR_QH_HORI_FLIP
+	{
+		Text [ en-US ] = "Flip the selected object horizontally.";
+	};
+	String STR_QH_VERT_FLIP
+	{
+		Text [ en-US ] = "Flip the selected object vertically.";
+	};
+	
+	Image IMG_HORI_FLIP
+	{
+		ImageBitmap = Bitmap{File = "symphony/FlipHorizontally_16x16.png";};
+	};
+	Image IMG_VERT_FLIP
+	{
+		ImageBitmap = Bitmap{File = "symphony/FlipVertically_16x16.png";};
+	};
+
+	Control	DIAL_CONTROL
+	{
+		Pos = MAP_APPFONT ( ROTATE_CONTROL_X , ROTATE_CONTROL_Y );
+		Size = MAP_PIXEL( 50, 50 );
+		HelpID = HID_PROPERTY_PANEL_POSIZE_DIAL_CONTROL;
+	};
+
+	Image IMG_DIACONTROL_NORMAL
+	{
+		ImageBitmap = Bitmap{File = "rotation.png";};
+	};
+	Image IMG_DIACONTROL_H
+	{
+		ImageBitmap = Bitmap{File = "rotation_h.png";};
+	};
+};
+
+// eof

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

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.cxx?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.cxx Thu Mar 21 20:47:25 2013
@@ -0,0 +1,84 @@
+/**************************************************************
+ * 
+ * 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 "SidebarDialControl.hxx"
+#include "SidebarDialControlBmp.hxx"
+
+#include <vcl/svapp.hxx>
+
+namespace svx { namespace sidebar {
+
+SidebarDialControl::SidebarDialControl (
+    Window* pParent,
+    const ResId& rResId)
+    : svx::DialControl(pParent, rResId)
+{
+    mpImpl->mpBmpEnabled.reset(new SidebarDialControlBmp(*this));
+    mpImpl->mpBmpDisabled.reset(new SidebarDialControlBmp(*this));
+    mpImpl->mpBmpBuffered.reset(new SidebarDialControlBmp(*this));
+    Init(GetOutputSizePixel());
+}
+
+
+
+
+SidebarDialControl::~SidebarDialControl (void)
+{
+}
+
+
+
+
+void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt )
+{
+    if( rMEvt.IsLeft() )
+    {
+        GrabFocus();
+        CaptureMouse();
+        mpImpl->mnOldAngle = mpImpl->mnAngle;
+        HandleMouseEvent( rMEvt.GetPosPixel(), true );
+    }
+}
+
+
+
+
+void SidebarDialControl::HandleMouseEvent( const Point& rPos, bool bInitial )
+{
+    long nX = rPos.X() - mpImpl->mnCenterX;
+    long nY = mpImpl->mnCenterY - rPos.Y();
+    double fH = sqrt( static_cast< double >( nX ) * nX + static_cast< double >( nY ) * nY );
+    if( fH != 0.0 )
+    {
+        double fAngle = acos( nX / fH );
+        sal_Int32 nAngle = static_cast< sal_Int32 >( fAngle / F_PI180 * 100.0 );
+        if( nY < 0 )
+            nAngle = 36000 - nAngle;
+        if( bInitial )  // round to entire 15 degrees
+            nAngle = ((nAngle + 750) / 1500) * 1500;
+
+		if (Application::GetSettings().GetLayoutRTL())
+			nAngle = 18000 - nAngle;
+        SetRotation( nAngle, true );
+    }
+}
+
+} } // end of namespace svx::sidebar

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

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.hxx?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.hxx Thu Mar 21 20:47:25 2013
@@ -0,0 +1,45 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SVX_SIDEBAR_POSSIZE_DIAL_CONTROL_HXX
+#define SVX_SIDEBAR_POSSIZE_DIAL_CONTROL_HXX
+
+#include <svx/dialcontrol.hxx>
+
+namespace svx { namespace sidebar {
+
+/** Provide some improvements over the standard DialControl.
+*/
+class SidebarDialControl : public svx::DialControl
+{
+public:
+    SidebarDialControl (Window* pParent, const ResId& rResId);
+    virtual ~SidebarDialControl (void);
+
+    virtual void MouseButtonDown (const MouseEvent& rMEvt);
+
+protected:
+    virtual void HandleMouseEvent (const Point& rPos, bool bInitial);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif

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

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.cxx?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.cxx Thu Mar 21 20:47:25 2013
@@ -0,0 +1,92 @@
+/**************************************************************
+ * 
+ * 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 "SidebarDialControlBmp.hxx"
+
+#include <sfx2/sidebar/Theme.hxx>
+
+#include <vcl/svapp.hxx>
+
+#include "PosSizePropertyPanel.hrc"
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+
+
+namespace svx { namespace sidebar {
+
+SidebarDialControlBmp::SidebarDialControlBmp (Window& rParent)
+    : DialControlBmp(rParent)
+{
+}
+
+
+
+
+SidebarDialControlBmp::~SidebarDialControlBmp (void)
+{
+}
+
+
+
+
+void SidebarDialControlBmp::DrawElements (
+    const String& rText,
+    sal_Int32 nAngle)
+{
+    if (Application::GetSettings().GetLayoutRTL())		
+        nAngle = 18000 - nAngle;
+    double fAngle = nAngle * F_PI180 / 100.0;
+    double fSin = sin( fAngle );
+    double fCos = cos( fAngle );
+    DrawText( maRect, String(), mbEnabled ? 0 : TEXT_DRAW_DISABLE );
+    const sal_Int32 nDx (fCos * (maRect.GetWidth()-4) / 2);
+    const sal_Int32 nDy (-fSin * (maRect.GetHeight()-4) / 2); 
+    Point pt1( maRect.Center() );
+    Point pt2( pt1.X() + nDx, pt1.Y() + nDy);
+    if ( ! sfx2::sidebar::Theme::IsHighContrastMode())
+        SetLineColor( Color( 60, 93, 138 ) );
+    else
+        SetLineColor(COL_BLACK);//Application::GetSettings().GetStyleSettings().GetFieldTextColor()
+    DrawLine( pt1, pt2 );
+}
+
+
+
+
+void SidebarDialControlBmp::DrawBackground()
+{
+    SetLineColor();
+    SetFillColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Paint_PanelBackground));
+    DrawRect(maRect);
+
+    const Image aImage (
+        sfx2::sidebar::Theme::IsHighContrastMode()
+            ? SVX_RES(IMG_DIACONTROL_H)
+            : SVX_RES(IMG_DIACONTROL_NORMAL));
+    Size aImageSize (aImage.GetSizePixel());
+    //    aImageSize.Width() -= 1;
+    //    aImageSize.Height() -= 1;
+    SetAntialiasing(ANTIALIASING_ENABLE_B2DDRAW |  ANTIALIASING_PIXELSNAPHAIRLINE);
+    DrawImage(maRect.TopLeft(), aImageSize, aImage);
+}
+
+
+} } // end of namespace svx::sidebar

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

Added: openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.hxx?rev=1459519&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.hxx Thu Mar 21 20:47:25 2013
@@ -0,0 +1,69 @@
+/**************************************************************
+ * 
+ * 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_POSSIZE_DIAL_CONTROL_BMP_HXX
+#define SVX_SIDEBAR_POSSIZE_DIAL_CONTROL_BMP_HXX
+
+#include <svx/dialcontrol.hxx>
+/*
+    
+#include <sfx2/sidebar/propertypanel.hrc>
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include <TransformationPropertyPanel.hxx>
+#include <TransformationPropertyPanel.hrc>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/objsh.hxx>
+#include <svx/dlgutil.hxx>
+#include <unotools/viewoptions.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/toolbox.hxx>
+#include <svx/svdview.hxx>
+#include <svl/aeitem.hxx>
+
+*/
+
+namespace svx { namespace sidebar {
+
+
+class SidebarDialControlBmp
+    : public svx::DialControlBmp
+{
+public:
+    explicit SidebarDialControlBmp( Window& rParent);
+    virtual ~SidebarDialControlBmp (void);
+
+    virtual void DrawElements( const String& rText, sal_Int32 nAngle );
+    virtual void DrawBackground();
+
+private:
+};
+
+} } // end of namespace svx::sidebar
+
+#endif

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