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/11 15:44:41 UTC
svn commit: r1455165 [2/3] - in /openoffice/branches/sidebar/main:
chart2/source/controller/drawinglayer/ default_images/svx/res/
officecfg/registry/data/org/openoffice/Office/UI/ sc/sdi/
sc/source/ui/drawfunc/ sc/source/ui/inc/ sc/source/ui/view/ sd/s...
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Mon Mar 11 14:44:39 2013
@@ -0,0 +1,1155 @@
+/**************************************************************
+ *
+ * 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;
+
+ switch (maContext.GetCombinedContext())
+ {
+ case CombinedEnumContext(Application_Writer, Context_Draw): //case PROPERTY_CONTEXT_SW_DRAW:
+ {
+ 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 CombinedEnumContext(Application_Writer, Context_Graphic): //case PROPERTY_CONTEXT_SW_GRAPHIC:
+ case CombinedEnumContext(Application_Writer, Context_Media): //case PROPERTY_CONTEXT_SW_MEDIA:
+ case CombinedEnumContext(Application_Writer, Context_Frame): //case PROPERTY_CONTEXT_SW_FRAME:
+ case CombinedEnumContext(Application_Writer, Context_OLE): //case PROPERTY_CONTEXT_SW_OLE:
+ case CombinedEnumContext(Application_Writer, Context_Form): //case PROPERTY_CONTEXT_SW_FORM:
+ {
+ 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 CombinedEnumContext(Application_Calc, Context_Draw): //case PROPERTY_CONTEXT_SC_DRAW:
+ case CombinedEnumContext(Application_Draw, Context_Draw): //case PROPERTY_CONTEXT_SD_DRAW:
+ case CombinedEnumContext(Application_Calc, Context_Graphic): //case PROPERTY_CONTEXT_SC_GRAPHIC:
+ case CombinedEnumContext(Application_Draw, Context_TextObject): //case PROPERTY_CONTEXT_SD_TEXTOBJ:
+ case CombinedEnumContext(Application_Draw, Context_Graphic): //case PROPERTY_CONTEXT_SD_GRAPHIC:
+ {
+ 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 CombinedEnumContext(Application_Calc, Context_Chart): //case PROPERTY_CONTEXT_SC_CHART:
+ case CombinedEnumContext(Application_Calc, Context_Form): //case PROPERTY_CONTEXT_SC_FORM:
+ case CombinedEnumContext(Application_Calc, Context_Media): //case PROPERTY_CONTEXT_SC_MEDIA:
+ case CombinedEnumContext(Application_Calc, Context_OLE): //case PROPERTY_CONTEXT_SC_OLE:
+ case CombinedEnumContext(Application_Calc, Context_Multiobj): //case PROPERTY_CONTEXT_SC_MULTIOBJ:
+ case CombinedEnumContext(Application_Draw, Context_Media): //case PROPERTY_CONTEXT_SD_MEDIA:
+ case CombinedEnumContext(Application_Draw, Context_Form): //case PROPERTY_CONTEXT_SD_FORM:
+ case CombinedEnumContext(Application_Draw, Context_OLE): //case PROPERTY_CONTEXT_SD_OLE:
+ case CombinedEnumContext(Application_Draw, Context_3DObj): //case PROPERTY_CONTEXT_SD_3DOBJ:
+ case CombinedEnumContext(Application_Draw, Context_Multiobj): //case PROPERTY_CONTEXT_SD_MULTIOBJ:
+ {
+ 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());
+
+ if(1 == rMarkList.GetMarkCount())
+ {
+ const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
+
+ if(((nCombinedContext == CombinedEnumContext(Application_Draw, Context_Draw) // mnContextId == PROPERTY_CONTEXT_SD_DRAW
+ || nCombinedContext == CombinedEnumContext(Application_Draw, Context_TextObject) // mnContextId == PROPERTY_CONTEXT_SD_TEXTOBJ
+ ) && OBJ_EDGE == eKind)
+ || OBJ_CAPTION == eKind)
+ // if((((mnContextId == PROPERTY_CONTEXT_SD_DRAW) || (mnContextId == PROPERTY_CONTEXT_SD_TEXTOBJ)) && OBJ_EDGE == eKind) || OBJ_CAPTION == eKind)
+ {
+ mpFtAngle->Disable();
+ mpMtrAngle->Disable();
+ mpDial->Disable();
+ mpFlipTbx->Disable();
+ mpFtFlip->Disable();
+ }
+ }
+ else
+ {
+ 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_Draw, Context_Draw) // mnContextId == PROPERTY_CONTEXT_SD_DRAW
+ || nCombinedContext == CombinedEnumContext(Application_Draw, Context_TextObject) // mnContextId == PROPERTY_CONTEXT_SD_TEXTOBJ
+ ) && OBJ_EDGE == eKind)
+ || OBJ_CAPTION == eKind)
+ // if((((mnContextId == PROPERTY_CONTEXT_SD_DRAW) || (mnContextId == PROPERTY_CONTEXT_SD_TEXTOBJ)) && OBJ_EDGE == eKind) ||OBJ_CAPTION == eKind)
+ {
+ isNoEdge = false;
+ break;
+ }
+ nMarkObj++;
+ }
+ if(!isNoEdge)
+ {
+ mpFtAngle->Disable();
+ mpMtrAngle->Disable();
+ mpDial->Disable();
+ mpFlipTbx->Disable();
+ mpFtFlip->Disable();
+ }
+ }
+
+ if(nCombinedContext == CombinedEnumContext(Application_Draw, Context_TextObject)) // mnContextId == PROPERTY_CONTEXT_SD_TEXTOBJ
+ //if(mnContextId == PROPERTY_CONTEXT_SD_TEXTOBJ)
+ {
+ 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hrc Mon Mar 11 14:44:39 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx Mon Mar 11 14:44:39 2013
@@ -0,0 +1,175 @@
+/**************************************************************
+ *
+ * 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 <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::SidebarPanelBase::ContextChangeReceiverInterface,
+ 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.src (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.src Mon Mar 11 14:44:39 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.cxx Mon Mar 11 14:44:39 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControl.hxx Mon Mar 11 14:44:39 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.cxx Mon Mar 11 14:44:39 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
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=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.hxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/SidebarDialControlBmp.hxx Mon Mar 11 14:44:39 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
Modified: openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/svdraw/svdedtv1.cxx Mon Mar 11 14:44:39 2013
@@ -252,6 +252,49 @@ void SdrEditView::ResizeMarkedObj(const
if( bUndo )
EndUndo();
}
+void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
+ const Fraction& xFact,
+ const Fraction& yFact,
+ const bool bCopy,
+ const bool bWdh,
+ const bool bHgt)
+{
+ const bool bUndo = IsUndoEnabled();
+ if( bUndo )
+ {
+ XubString aStr;
+ ImpTakeDescriptionStr(STR_EditResize,aStr);
+ if (bCopy)
+ aStr+=ImpGetResStr(STR_EditWithCopy);
+ BegUndo(aStr);
+ }
+
+ if (bCopy)
+ CopyMarkedObj();
+
+ sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
+ for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
+ {
+ SdrMark* pM=GetSdrMarkByIndex(nm);
+ SdrObject* pO=pM->GetMarkedSdrObj();
+ if( bUndo )
+ {
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
+
+ Fraction aFrac(1,1);
+ if (bWdh && bHgt)
+ pO->Resize(rRef, xFact, yFact);
+ else if (bWdh)
+ pO->Resize(rRef, xFact, aFrac);
+ else if (bHgt)
+ pO->Resize(rRef, aFrac, yFact);
+ }
+ if( bUndo )
+ EndUndo();
+}
long SdrEditView::GetMarkedObjRotate() const
{
@@ -1198,36 +1241,9 @@ sal_Bool SdrEditView::SetStyleSheet(SfxS
SfxItemSet SdrEditView::GetGeoAttrFromMarked() const
{
- // used items are:
- //
- // SID_ATTR_TRANSFORM_POS_X ( SID_SVX_START + 88 )
- // SID_ATTR_TRANSFORM_POS_Y ( SID_SVX_START + 89 )
- // SID_ATTR_TRANSFORM_WIDTH ( SID_SVX_START + 90 )
- // SID_ATTR_TRANSFORM_HEIGHT ( SID_SVX_START + 91 )
- // SID_ATTR_TRANSFORM_ROT_X ( SID_SVX_START + 93 )
- // SID_ATTR_TRANSFORM_ROT_Y ( SID_SVX_START + 94 )
- // SID_ATTR_TRANSFORM_ANGLE ( SID_SVX_START + 95 )
- // SID_ATTR_TRANSFORM_PROTECT_POS ( SID_SVX_START + 236 )
- // SID_ATTR_TRANSFORM_PROTECT_SIZE ( SID_SVX_START + 237 )
- // SID_ATTR_TRANSFORM_SHEAR ( SID_SVX_START + 304 )
- // SID_ATTR_TRANSFORM_SHEAR_X ( SID_SVX_START + 305 )
- // SID_ATTR_TRANSFORM_SHEAR_Y ( SID_SVX_START + 306 )
- // SID_ATTR_TRANSFORM_RESIZE_REF_X ( SID_SVX_START + 308 )
- // SID_ATTR_TRANSFORM_RESIZE_REF_Y ( SID_SVX_START + 309 )
- // SID_ATTR_TRANSFORM_AUTOWIDTH ( SID_SVX_START + 310 )
- // SID_ATTR_TRANSFORM_AUTOHEIGHT ( SID_SVX_START + 311 )
- // SID_ATTR_TRANSFORM_MIRROR_HORIZONTAL (SID_SVX_START+1108)
- // SID_ATTR_TRANSFORM_MIRROR_VERTICAL (SID_SVX_START+1109)
- // SID_ATTR_TRANSFORM_MATRIX (SID_SVX_START+1112)
- // SDRATTR_ECKENRADIUS ????
- //
- // SfxItemSet needs sorted pairs of IDs as ranges, an null-termainated array of ranges.
- // No need to be too exact as long as the SfxItemSet is not used as a filter (which it is not here)
-
SfxItemSet aRetSet(pMod->GetItemPool(), // SID_ATTR_TRANSFORM_... aus s:svxids.hrc
SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT,
- SID_ATTR_TRANSFORM_MIRROR_HORIZONTAL, SID_ATTR_TRANSFORM_MATRIX,
SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS,
0);
@@ -1294,54 +1310,13 @@ SfxItemSet SdrEditView::GetGeoAttrFromMa
sal_Bool bSizProt=pObj->IsResizeProtect();
sal_Bool bPosProtDontCare=sal_False;
sal_Bool bSizProtDontCare=sal_False;
- bool bMirroredX(false); // pObj->IsMirroredX()); // currently not supported, needs aw080
- bool bMirroredY(false); // pObj->IsMirroredY());
- bool bMirroredXDontCare(false);
- bool bMirroredYDontCare(false);
-
- for (sal_uIntPtr i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); i++)
+ for (sal_uIntPtr i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); i++)
{
pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
-
- if (bPosProt!=pObj->IsMoveProtect())
- {
- bPosProtDontCare=sal_True;
- }
-
- if (bSizProt!=pObj->IsResizeProtect())
- {
- bSizProtDontCare=sal_True;
- }
-
- if(bMirroredX != false) // pObj->IsMirroredX())
- {
- bMirroredXDontCare = true;
- }
-
- if(bMirroredY != false) // pObj->IsMirroredY())
- {
- bMirroredYDontCare = true;
- }
- }
-
- if(bMirroredXDontCare)
- {
- aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_MIRROR_HORIZONTAL);
- }
- else
- {
- aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_MIRROR_HORIZONTAL, bMirroredX));
+ if (bPosProt!=pObj->IsMoveProtect()) bPosProtDontCare=sal_True;
+ if (bSizProt!=pObj->IsResizeProtect()) bSizProtDontCare=sal_True;
}
-
- if(bMirroredYDontCare)
- {
- aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_MIRROR_VERTICAL);
- }
- else
- {
- aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_MIRROR_VERTICAL, bMirroredY));
- }
-
+
// InvalidateItem setzt das Item auf DONT_CARE
if (bPosProtDontCare) {
aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_POS);
@@ -1488,6 +1463,7 @@ void SdrEditView::SetGeoAttrToMarked(con
sal_Bool bChgPos=sal_False;
sal_Bool bChgSiz=sal_False;
+ sal_Bool bChgWdh=sal_False;
sal_Bool bChgHgt=sal_False;
sal_Bool bRotate=sal_False;
sal_Bool bShear =sal_False;
@@ -1510,6 +1486,7 @@ void SdrEditView::SetGeoAttrToMarked(con
if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,sal_True,&pPoolItem)) {
nSizX=((const SfxUInt32Item*)pPoolItem)->GetValue();
bChgSiz=sal_True;
+ bChgWdh=sal_True;
}
if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,sal_True,&pPoolItem)) {
nSizY=((const SfxUInt32Item*)pPoolItem)->GetValue();
@@ -1602,7 +1579,7 @@ void SdrEditView::SetGeoAttrToMarked(con
GetSdrPageView()->PagePosToLogic(aRef);
}
- ResizeMarkedObj(aRef,aWdt,aHgt);
+ ResizeMultMarkedObj(aRef, aWdt, aHgt, false, bChgWdh, bChgHgt);
}
// Rotieren
@@ -1668,108 +1645,6 @@ void SdrEditView::SetGeoAttrToMarked(con
MoveMarkedObj(Size(nPosDX,nPosDY));
}
- // mirror cannot be hold at SdrObjects in this version (needs aw080 to do so), will just be applied if set
- if(nMarkCount)
- {
- if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_MIRROR_HORIZONTAL, true, &pPoolItem))
- {
- const bool bMirrorX(((const SfxBoolItem*)pPoolItem)->GetValue());
-
- if(bMirrorX)
- {
- MirrorMarkedObj(aRect.TopCenter(), aRect.BottomCenter(), false);
- }
- }
- if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_MIRROR_VERTICAL, true, &pPoolItem))
- {
- const bool bMirrorY(((const SfxBoolItem*)pPoolItem)->GetValue());
-
- if(bMirrorY)
- {
- MirrorMarkedObj(aRect.LeftCenter(), aRect.RightCenter(), false);
- }
- }
- if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_MATRIX, true, &pPoolItem))
- {
- const AffineMatrixItem* pMatItem = dynamic_cast< const AffineMatrixItem* >(pPoolItem);
-
- if(pMatItem)
- {
- const com::sun::star::geometry::AffineMatrix2D aAffineMatrix2D = pMatItem->GetAffineMatrix2D();
- Point aPageOffset(0, 0);
- basegfx::B2DHomMatrix aTransformation;
-
- if(GetSdrPageView())
- {
- aPageOffset = GetSdrPageView()->GetPageOrigin();
- }
-
- aTransformation.set(0, 0, aAffineMatrix2D.m00);
- aTransformation.set(0, 1, aAffineMatrix2D.m01);
- aTransformation.set(0, 2, aAffineMatrix2D.m02 + aPageOffset.X());
- aTransformation.set(1, 0, aAffineMatrix2D.m10);
- aTransformation.set(1, 1, aAffineMatrix2D.m11);
- aTransformation.set(1, 2, aAffineMatrix2D.m12 + aPageOffset.Y());
-
- if(!aTransformation.isIdentity())
- {
- basegfx::B2DPolyPolygon aPolyPolygon;
-
- if(nMarkCount > 1)
- {
- // get the current and the target range
- const Rectangle aRect(GetMarkedObjRect());
- const basegfx::B2DRange aCurrent(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
- basegfx::B2DRange aTarget(0.0, 0.0, 1.0, 1.0);
-
- aTarget.transform(aTransformation);
-
- // create transformation from current range to target range
- aTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(
- aCurrent.getRange(),
- aCurrent.getMinimum());
- aTransformation.invert();
- aTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(
- aTarget.getRange(),
- aTarget.getMinimum()) * aTransformation;
-
- // apply to each object
- for(sal_uInt32 i(0); i < nMarkCount; i++)
- {
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
-
- if(pObj)
- {
- basegfx::B2DHomMatrix aTransform;
-
- pObj->TRGetBaseGeometry(aTransform, aPolyPolygon);
- aTransform = aTransformation * aTransform;
- pObj->TRSetBaseGeometry(aTransform, aPolyPolygon);
- }
- }
- }
- else
- {
- // single object, replace transformation
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if(pObj)
- {
- basegfx::B2DHomMatrix aOldTransform;
-
- pObj->TRGetBaseGeometry(aOldTransform, aPolyPolygon);
- pObj->TRSetBaseGeometry(aTransformation, aPolyPolygon);
- }
- }
- }
- }
- else
- {
- OSL_ENSURE(false, "SID_ATTR_TRANSFORM_MATRIX not containing a AffineMatrixItem (!)");
- }
- }
- }
-
// protect position
if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, sal_True, &pPoolItem))
{
Modified: openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi Mon Mar 11 14:44:39 2013
@@ -147,6 +147,22 @@ interface BaseTextFrame
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_ATTR_TRANSFORM
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
+ SID_ATTR_TRANSFORM_WIDTH
+ [
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+ SID_ATTR_TRANSFORM_HEIGHT
+ [
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
SID_ATTR_ULSPACE // status(final|play)
[
ExecMethod = Execute ;
Modified: openoffice/branches/sidebar/main/sw/sdi/_grfsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/_grfsh.sdi?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/_grfsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/_grfsh.sdi Mon Mar 11 14:44:39 2013
@@ -32,6 +32,12 @@ interface BaseTextGraphic
StateMethod = GetAttrState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_FLIP_VERTICAL
+ [
+ ExecMethod = ExecAttr ;
+ StateMethod = GetAttrState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
FN_FLIP_HORZ_GRAFIC // status(final|play)
[
@@ -39,6 +45,12 @@ interface BaseTextGraphic
StateMethod = GetAttrState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_FLIP_HORIZONTAL
+ [
+ ExecMethod = ExecAttr ;
+ StateMethod = GetAttrState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
FN_FORMAT_GRAFIC_DLG // status(final|play)
[
Modified: openoffice/branches/sidebar/main/sw/sdi/drawsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/drawsh.sdi?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/drawsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/drawsh.sdi Mon Mar 11 14:44:39 2013
@@ -47,29 +47,6 @@ interface TextDraw : TextDrawBase
Export = FALSE;
]
- SID_ATTR_TRANSFORM // ole : no, status : ?
- [
- ExecMethod = ExecDrawAttrArgs ;
- StateMethod = DisableState ;
- Export = FALSE;
- ]
-
- // use same as SID_ATTR_LINEEND_STYLE
- SID_ATTR_TRANSFORM_MIRROR_HORIZONTAL [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_MIRROR_VERTICAL [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_POS_X [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_POS_Y [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_WIDTH [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_HEIGHT [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_ANGLE [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_ROT_X [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_ROT_Y [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_PROTECT_POS [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_PROTECT_SIZE [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_AUTOWIDTH [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_AUTOHEIGHT [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
- SID_ATTR_TRANSFORM_MATRIX [ ExecMethod = ExecDrawAttrArgs; StateMethod = DisableState; Export = FALSE; ]
-
SID_ATTR_LINE_STYLE
[
Export = FALSE;
@@ -235,6 +212,12 @@ interface TextDraw : TextDrawBase
StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_FLIP_VERTICAL
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
FN_FLIP_HORZ_GRAFIC
[
@@ -242,6 +225,12 @@ interface TextDraw : TextDrawBase
StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_FLIP_HORIZONTAL
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
SID_OBJECT_ROTATE
[
Modified: openoffice/branches/sidebar/main/sw/sdi/drwbassh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/drwbassh.sdi?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/drwbassh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/drwbassh.sdi Mon Mar 11 14:44:39 2013
@@ -32,6 +32,7 @@ interface TextDrawBase : BaseTextDrawBas
shell SwDrawBaseShell: SwBaseShell
{
import TextDrawBase[Automation];
+ import Sidebar;
SID_OBJECT_ALIGN
[
Added: openoffice/branches/sidebar/main/sw/sdi/sidebar.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/sidebar.sdi?rev=1455165&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/sidebar.sdi (added)
+++ openoffice/branches/sidebar/main/sw/sdi/sidebar.sdi Mon Mar 11 14:44:39 2013
@@ -0,0 +1,35 @@
+/**************************************************************
+ *
+ * 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.
+ *
+ *************************************************************/
+
+interface Sidebar [ Automation = FALSE; ]
+{
+ SID_ATTR_TRANSFORM_WIDTH [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_HEIGHT [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_POS_X [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_POS_Y [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_ANGLE [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_ROT_X [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_ROT_Y [ StateMethod = GetDrawAttrStateForIFBX; ]
+ SID_ATTR_TRANSFORM_PROTECT_POS [ StateMethod = GetDrawAttrStateForIFBX;]
+ SID_ATTR_TRANSFORM_PROTECT_SIZE [ StateMethod = GetDrawAttrStateForIFBX;]
+}
+
+
Modified: openoffice/branches/sidebar/main/sw/sdi/swslots.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/swslots.sdi?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/swslots.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/swslots.sdi Mon Mar 11 14:44:39 2013
@@ -74,7 +74,8 @@ ModulePrefix( "Sw" )
include "wtextsh.sdi"
include "_drwbase.sdi"
- include "drwbassh.sdi"
+ include "sidebar.sdi"
+ include "drwbassh.sdi"
include "wdrwbase.sdi"
include "_formsh.sdi"
Modified: openoffice/branches/sidebar/main/sw/sdi/wdrwbase.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/wdrwbase.sdi?rev=1455165&r1=1455164&r2=1455165&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/wdrwbase.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/wdrwbase.sdi Mon Mar 11 14:44:39 2013
@@ -31,6 +31,7 @@ interface WebDrawBase : BaseTextDrawBase
shell SwWebDrawBaseShell: SwBaseShell
{
import WebDrawBase[Automation];
+ import Sidebar;
SID_OBJECT_ALIGN
[