cui/AllLangResTarget_cui.mk | 1 cui/UIConfig_cui.mk | 1 cui/source/factory/dlgfact.cxx | 6 - cui/source/inc/cuires.hrc | 1 cui/source/inc/swpossizetabpage.hxx | 147 ++++++++++++++++++++++++++++ cui/source/inc/transfrm.hxx | 6 - cui/source/tabpages/swpossizetabpage.cxx | 4 cui/source/tabpages/swpossizetabpage.hrc | 53 ---------- cui/source/tabpages/swpossizetabpage.hxx | 147 ---------------------------- cui/source/tabpages/transfrm.cxx | 45 +++----- cui/source/tabpages/transfrm.hrc | 24 ---- cui/source/tabpages/transfrm.src | 74 -------------- cui/uiconfig/ui/positionsizedialog.ui | 161 +++++++++++++++++++++++++++++++ include/svx/dialogs.hrc | 2 14 files changed, 338 insertions(+), 334 deletions(-)
New commits: commit 6abf5a706ff49c996dd3c608939481fa8eccd5f7 Author: Olivier Hallot <olivier.hal...@edx.srv.br> Date: Mon Aug 19 22:06:31 2013 -0300 Convert position and size dialog to widget UI Change-Id: I283667cd21fee7dd905c5353245317ed90102c96 Reviewed-on: https://gerrit.libreoffice.org/5524 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk index 2ba3b3a..af8e41d 100644 --- a/cui/AllLangResTarget_cui.mk +++ b/cui/AllLangResTarget_cui.mk @@ -75,7 +75,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ cui/source/tabpages/page.src \ cui/source/tabpages/paragrph.src \ cui/source/tabpages/strings.src \ - cui/source/tabpages/transfrm.src \ )) # vim: set noet sw=4 ts=4: diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 9435977..a0d790c 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -89,6 +89,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/picknumberingpage \ cui/uiconfig/ui/pickoutlinepage \ cui/uiconfig/ui/positionpage \ + cui/uiconfig/ui/positionsizedialog \ cui/uiconfig/ui/possizetabpage \ cui/uiconfig/ui/querychangelineenddialog \ cui/uiconfig/ui/querydeletechartcolordialog \ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index e3436c4..ab7a4ba 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1386,14 +1386,14 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( W case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE : { pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE); - pDlg->RemoveTabPage( RID_SVXPAGE_ANGLE ); - pDlg->RemoveTabPage( RID_SVXPAGE_SLANT ); + pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" ); + pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" ); } break; case RID_SCH_TransformTabDLG_SVXPAGE_SLANT: { pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE); - pDlg->RemoveTabPage( RID_SVXPAGE_SLANT ); + pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" ); } break; default: diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 1a54c25..abf3728 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -44,7 +44,6 @@ #define RID_SVX_FORMAT_CELLS_DLG ( RID_SVX_START + 42 ) // used in "tabpages" -#define RID_SVXDLG_TRANSFORM (RID_SVX_START + 45) #define RID_SVXDLG_LINE (RID_SVX_START + 50) #define RID_SVXDLG_BBDLG (RID_SVX_START + 40) #define RID_SVXDLG_CAPTION (RID_SVX_START + 151) diff --git a/cui/source/tabpages/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx similarity index 100% rename from cui/source/tabpages/swpossizetabpage.hxx rename to cui/source/inc/swpossizetabpage.hxx diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx index 5b3138a..ab5e9f2 100644 --- a/cui/source/inc/transfrm.hxx +++ b/cui/source/inc/transfrm.hxx @@ -46,10 +46,14 @@ const sal_uInt16 SVX_OBJ_NOPROTECT = 0x0200; class SvxTransformTabDialog : public SfxTabDialog { + sal_uInt16 nPosSize; + sal_uInt16 nSWPosSize; + sal_uInt16 nRotation; + sal_uInt16 nSlant; private: const SdrView* pView; - sal_uInt16 nAnchorCtrls; + sal_uInt16 nAnchorCtrls; Link aValidateLink; virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index c7c1407..9fc7067 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1748,8 +1748,8 @@ sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_u // Probably anchor change. So look for a similar relation. switch (nRel) { - case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break; - case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break; + case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break; + case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break; case RelOrientation::PAGE_LEFT: nRel = RelOrientation::FRAME_LEFT; break; case RelOrientation::PAGE_RIGHT: nRel = RelOrientation::FRAME_RIGHT; break; case RelOrientation::FRAME_LEFT: nRel = RelOrientation::PAGE_LEFT; break; diff --git a/cui/source/tabpages/swpossizetabpage.hrc b/cui/source/tabpages/swpossizetabpage.hrc deleted file mode 100644 index b74871b..0000000 --- a/cui/source/tabpages/swpossizetabpage.hrc +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 . - */ - -#define FL_SIZE 1 -#define FT_WIDTH 2 -#define MF_WIDTH 3 -#define FT_HEIGHT 4 -#define MF_HEIGHT 5 -#define CB_KEEPRATIO 6 -#define FL_SEPARATOR 7 -#define FL_ANCHOR 8 -#define RB_TOPAGE 9 -#define RB_TOPARA 10 -#define RB_TOCHAR 11 -#define RB_ASCHAR 12 -#define RB_TOFRAME 13 -#define FL_PROTECTION 14 -#define CB_POSITION 15 -#define CB_SIZE 16 -#define FL_POSITION 17 -#define FT_HORI 18 -#define LB_HORI 19 -#define FT_HORIBY 20 -#define MF_HORIBY 21 -#define FT_HORITO 22 -#define LB_HORITO 23 -#define CB_HORIMIRROR 24 -#define FT_VERT 25 -#define LB_VERT 26 -#define FT_VERTBY 27 -#define MF_VERTBY 28 -#define FT_VERTTO 29 -#define LB_VERTTO 30 -#define CB_FOLLOW 31 -#define WN_EXAMPLE 32 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 6e5bd24..5e64bd9 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -104,28 +104,32 @@ static void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale) \************************************************************************/ SvxTransformTabDialog::SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr, - const SdrView* pSdrView, sal_uInt16 nAnchorTypes ) : - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_TRANSFORM ), pAttr ), - pView ( pSdrView ), - nAnchorCtrls(nAnchorTypes) + const SdrView* pSdrView, sal_uInt16 nAnchorTypes ) + : SfxTabDialog( pParent + ,"PositionAndSizeDialog" + ,"cui/ui/positionsizedialog.ui" + , pAttr ) + , nPosSize(0) + , nSWPosSize(0) + , pView(pSdrView) + , nAnchorCtrls(nAnchorTypes) { DBG_ASSERT(pView, "no valid view (!)"); - FreeResource(); //different positioning page in Writer if(nAnchorCtrls & 0x00ff) { - AddTabPage(RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges); - RemoveTabPage(RID_SVXPAGE_POSITION_SIZE); + nSWPosSize = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges); + RemoveTabPage("RID_SVXPAGE_POSITION_SIZE"); } else { - AddTabPage(RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges); - RemoveTabPage(RID_SVXPAGE_SWPOSSIZE); + nPosSize = AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges); + RemoveTabPage("RID_SVXPAGE_SWPOSSIZE"); } - AddTabPage(RID_SVXPAGE_ANGLE, SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges); - AddTabPage(RID_SVXPAGE_SLANT, SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges); + nRotation = AddTabPage("RID_SVXPAGE_ANGLE", SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges); + nSlant = AddTabPage("RID_SVXPAGE_SLANT", SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges); } // ----------------------------------------------------------------------- @@ -138,9 +142,7 @@ SvxTransformTabDialog::~SvxTransformTabDialog() void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) { - switch(nId) - { - case RID_SVXPAGE_POSITION_SIZE: + if (nId==nPosSize) { SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage); rSvxPos.SetView(pView); @@ -156,40 +158,31 @@ void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) rSvxPos.DisableProtect(); rSvxPos.UpdateControlStates(); } - - break; } - case RID_SVXPAGE_SWPOSSIZE : + else if (nId == nSWPosSize) { SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage); rSwPos.EnableAnchorTypes(nAnchorCtrls); rSwPos.SetValidateFramePosLink(aValidateLink); rSwPos.SetView(pView); - - break; } - case RID_SVXPAGE_ANGLE: + else if( nId == nRotation) { SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage); rSvxAng.SetView( pView ); rSvxAng.Construct(); - - break; } - case RID_SVXPAGE_SLANT: + else if (nId == nSlant) { SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage); rSvxSlnt.SetView( pView ); rSvxSlnt.Construct(); - - break; } - } } // ----------------------------------------------------------------------- diff --git a/cui/source/tabpages/transfrm.hrc b/cui/source/tabpages/transfrm.hrc deleted file mode 100644 index dbe5511..0000000 --- a/cui/source/tabpages/transfrm.hrc +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 . - */ -#define TAB_CONTROL 1 -#define BTN_OK 2 -#define BTN_CANCEL 3 -#define BTN_HELP 4 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/transfrm.src b/cui/source/tabpages/transfrm.src deleted file mode 100644 index 605a3d3..0000000 --- a/cui/source/tabpages/transfrm.src +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 <svtools/controldims.hrc> -#include <cuires.hrc> -#include "transfrm.hrc" -#include <svx/dialogs.hrc> - -#define MA_TABPAGE_HEIGHT 185 - -#define _POS_SIZE_TEXT \ - Text [ en-US ] = "Position and Size" ; \ - - -TabDialog RID_SVXDLG_TRANSFORM\ -{ - OutputSize = TRUE ; - SvLook = TRUE ; - Size = MAP_APPFONT ( 289 , MA_TABPAGE_HEIGHT + 41 ) ; - Text [ en-US ] = "Position and Size" ;\ - Moveable = TRUE ; - TabControl TAB_CONTROL\ - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ; - PageList = - { - PageItem\ - { - Identifier = RID_SVXPAGE_POSITION_SIZE ; - PageResID = RID_SVXPAGE_POSITION_SIZE ; - _POS_SIZE_TEXT - }; - PageItem - { - Identifier = RID_SVXPAGE_SWPOSSIZE; - PageResID = RID_SVXPAGE_SWPOSSIZE; - _POS_SIZE_TEXT - }; - PageItem - { - Identifier = RID_SVXPAGE_ANGLE ; - Text [ en-US ] = "Rotation" ; - PageResID = RID_SVXPAGE_ANGLE ; - }; - PageItem - { - Identifier = RID_SVXPAGE_SLANT ; - PageResID = RID_SVXPAGE_SLANT ; - Text [ en-US ] = "Slant & Corner Radius" ; - }; - }; - }; -}; - // ********************************************************************** EOF - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/positionsizedialog.ui b/cui/uiconfig/ui/positionsizedialog.ui new file mode 100644 index 0000000..1bba91b --- /dev/null +++ b/cui/uiconfig/ui/positionsizedialog.ui @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="PositionAndSizeDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Position and size</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="RID_SVXPAGE_POSITION_SIZE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Position and Size</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="RID_SVXPAGE_SWPOSSIZE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Position and Size</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="RID_SVXPAGE_ANGLE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Rotation</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="RID_SVXPAGE_SLANT"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Slant & Corner Radius</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">reset</action-widget> + </action-widgets> + </object> +</interface> diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index f5f0166..a8f19a2 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -89,8 +89,6 @@ #define RID_SVXPAGE_HATCH (RID_SVX_START + 57) #define RID_SVXPAGE_BITMAP (RID_SVX_START + 58) #define RID_SVXPAGE_GRADIENT (RID_SVX_START + 59) -#define RID_SVXPAGE_ANGLE (RID_SVX_START + 48) -#define RID_SVXPAGE_SLANT (RID_SVX_START + 49) #define RID_SVXPAGE_DISTRIBUTE (RID_SVX_START + 236) #define RID_SVXPAGE_MACROASSIGN (RID_SVX_START + 296)
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits