Kaydet (Commit) 6867a80c authored tarafından Prashant Pandey's avatar Prashant Pandey Kaydeden (comit) Jan Holesovsky

sidebar: PosSizePropertyPanel conversion to .ui

Change-Id: I18716dec85c257d2df3ed8973591d831b86e018f
üst db610b4a
......@@ -72,7 +72,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
svx/source/sidebar/area/AreaPropertyPanel.src \
svx/source/sidebar/graphic/GraphicPropertyPanel.src \
svx/source/sidebar/line/LinePropertyPanel.src \
svx/source/sidebar/possize/PosSizePropertyPanel.src \
svx/source/sidebar/text/TextPropertyPanel.src \
svx/source/sidebar/paragraph/ParaPropertyPanel.src \
svx/source/sidebar/insert/InsertPropertyPanel.src \
......
......@@ -25,6 +25,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/sidebararea \
svx/uiconfig/ui/sidebarline \
svx/uiconfig/ui/sidebarparagraph \
svx/uiconfig/ui/sidebarpossize \
svx/uiconfig/ui/sidebartextpanel \
))
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
// 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 FT_FLIP 22
#define STR_QH_HORI_FLIP 23
#define STR_QH_VERT_FLIP 24
#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
......@@ -24,6 +24,7 @@
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <boost/scoped_ptr.hpp>
#include <svx/rectenum.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <svl/poolitem.hxx>
#include <tools/fldunit.hxx>
#include <com/sun/star/ui/XSidebar.hpp>
......@@ -41,7 +42,7 @@ namespace svx { namespace sidebar {
class SidebarDialControl;
class PosSizePropertyPanel
: public Control,
: public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
......@@ -69,29 +70,28 @@ public:
private:
//Position
::boost::scoped_ptr< FixedText > mpFtPosX;
::boost::scoped_ptr< MetricField > mpMtrPosX;
::boost::scoped_ptr< FixedText > mpFtPosY;
::boost::scoped_ptr< MetricField > mpMtrPosY;
FixedText* mpFtPosX;
MetricField* mpMtrPosX;
FixedText* mpFtPosY;
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;
FixedText* mpFtWidth;
MetricField* mpMtrWidth;
FixedText* mpFtHeight;
MetricField* mpMtrHeight;
CheckBox* mpCbxScale;
//rotation
::boost::scoped_ptr< FixedText > mpFtAngle;
::boost::scoped_ptr< MetricBox > mpMtrAngle;
FixedText* mpFtAngle;
MetricBox* mpMtrAngle;
//rotation control
::boost::scoped_ptr<SidebarDialControl> mpDial;
SidebarDialControl* mpDial;
//flip
::boost::scoped_ptr< FixedText > mpFtFlip;
::boost::scoped_ptr< Window > mpFlipTbxBackground;
::boost::scoped_ptr< ToolBox > mpFlipTbx;
FixedText* mpFtFlip;
ToolBox* mpFlipTbx;
// Internal variables
Rectangle maRect;
......@@ -174,8 +174,6 @@ private:
void MetricState( SfxItemState eState, const SfxPoolItem* pState );
FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
void DisableControls();
void AdaptWidthHeightScalePosition(bool bOriginal);
void AdaptAngleFlipDialPosition(bool bOriginal);
};
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
#include "PosSizePropertyPanel.hrc"
#include <sfx2/sidebar/ResourceDefinitions.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;
};
ToolBoxItem
{
Identifier = FLIP_HORIZONTAL ;
Text [ en-US ] = "Flip Horizontally" ;
HelpID = HID_PROPERTY_PANEL_POSIZE_FLIP_HORIZONTAL;
};
};
};
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.";
};
Control DIAL_CONTROL
{
Pos = MAP_APPFONT ( ROTATE_CONTROL_X , ROTATE_CONTROL_Y );
Size = MAP_PIXEL( 50, 50 );
HelpID = HID_PROPERTY_PANEL_POSIZE_DIAL_CONTROL;
};
};
// eof
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment