summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@edx.srv.br>2013-08-19 22:06:31 -0300
committerCaolán McNamara <caolanm@redhat.com>2013-08-20 13:11:09 +0000
commit6abf5a706ff49c996dd3c608939481fa8eccd5f7 (patch)
tree078e9c929ae396906b5c22eceb37cae40b0eebb4 /cui
parentf1304feb4b343a9497c96bc256a8ade6d8e503f1 (diff)
Convert position and size dialog to widget UI
Change-Id: I283667cd21fee7dd905c5353245317ed90102c96 Reviewed-on: https://gerrit.libreoffice.org/5524 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/AllLangResTarget_cui.mk1
-rw-r--r--cui/UIConfig_cui.mk1
-rw-r--r--cui/source/factory/dlgfact.cxx6
-rw-r--r--cui/source/inc/cuires.hrc1
-rw-r--r--cui/source/inc/swpossizetabpage.hxx (renamed from cui/source/tabpages/swpossizetabpage.hxx)0
-rw-r--r--cui/source/inc/transfrm.hxx6
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx4
-rw-r--r--cui/source/tabpages/swpossizetabpage.hrc53
-rw-r--r--cui/source/tabpages/transfrm.cxx45
-rw-r--r--cui/source/tabpages/transfrm.hrc24
-rw-r--r--cui/source/tabpages/transfrm.src74
-rw-r--r--cui/uiconfig/ui/positionsizedialog.ui161
12 files changed, 191 insertions, 185 deletions
diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk
index 2ba3b3afe2d0..af8e41d18ede 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 9435977de9d1..a0d790c90a4b 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 e3436c45a0ea..ab7a4bab0914 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 1a54c25d4326..abf3728150aa 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
index ee26c6826fb1..ee26c6826fb1 100644
--- a/cui/source/tabpages/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index 5b3138a29507..ab5e9f20373e 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 c7c140753034..9fc706763b25 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 b74871ba8918..000000000000
--- 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 6e5bd24decfa..5e64bd9dc4c8 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 dbe55118a03d..000000000000
--- 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 605a3d3ee42c..000000000000
--- 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 000000000000..1bba91bf913d
--- /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 &amp; 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>