Kaydet (Commit) 6abf5a70 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert position and size dialog to widget UI

Change-Id: I283667cd21fee7dd905c5353245317ed90102c96
Reviewed-on: https://gerrit.libreoffice.org/5524Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f1304feb
...@@ -75,7 +75,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ ...@@ -75,7 +75,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/tabpages/page.src \ cui/source/tabpages/page.src \
cui/source/tabpages/paragrph.src \ cui/source/tabpages/paragrph.src \
cui/source/tabpages/strings.src \ cui/source/tabpages/strings.src \
cui/source/tabpages/transfrm.src \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -89,6 +89,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ ...@@ -89,6 +89,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/picknumberingpage \ cui/uiconfig/ui/picknumberingpage \
cui/uiconfig/ui/pickoutlinepage \ cui/uiconfig/ui/pickoutlinepage \
cui/uiconfig/ui/positionpage \ cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/positionsizedialog \
cui/uiconfig/ui/possizetabpage \ cui/uiconfig/ui/possizetabpage \
cui/uiconfig/ui/querychangelineenddialog \ cui/uiconfig/ui/querychangelineenddialog \
cui/uiconfig/ui/querydeletechartcolordialog \ cui/uiconfig/ui/querydeletechartcolordialog \
......
...@@ -1386,14 +1386,14 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( W ...@@ -1386,14 +1386,14 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( W
case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE : case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE :
{ {
pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE); 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_ANGLE" );
pDlg->RemoveTabPage( RID_SVXPAGE_SLANT ); pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
} }
break; break;
case RID_SCH_TransformTabDLG_SVXPAGE_SLANT: case RID_SCH_TransformTabDLG_SVXPAGE_SLANT:
{ {
pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE); 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; break;
default: default:
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#define RID_SVX_FORMAT_CELLS_DLG ( RID_SVX_START + 42 ) #define RID_SVX_FORMAT_CELLS_DLG ( RID_SVX_START + 42 )
// used in "tabpages" // used in "tabpages"
#define RID_SVXDLG_TRANSFORM (RID_SVX_START + 45)
#define RID_SVXDLG_LINE (RID_SVX_START + 50) #define RID_SVXDLG_LINE (RID_SVX_START + 50)
#define RID_SVXDLG_BBDLG (RID_SVX_START + 40) #define RID_SVXDLG_BBDLG (RID_SVX_START + 40)
#define RID_SVXDLG_CAPTION (RID_SVX_START + 151) #define RID_SVXDLG_CAPTION (RID_SVX_START + 151)
......
...@@ -46,10 +46,14 @@ const sal_uInt16 SVX_OBJ_NOPROTECT = 0x0200; ...@@ -46,10 +46,14 @@ const sal_uInt16 SVX_OBJ_NOPROTECT = 0x0200;
class SvxTransformTabDialog : public SfxTabDialog class SvxTransformTabDialog : public SfxTabDialog
{ {
sal_uInt16 nPosSize;
sal_uInt16 nSWPosSize;
sal_uInt16 nRotation;
sal_uInt16 nSlant;
private: private:
const SdrView* pView; const SdrView* pView;
sal_uInt16 nAnchorCtrls; sal_uInt16 nAnchorCtrls;
Link aValidateLink; Link aValidateLink;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
......
...@@ -1748,8 +1748,8 @@ sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_u ...@@ -1748,8 +1748,8 @@ sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_u
// Probably anchor change. So look for a similar relation. // Probably anchor change. So look for a similar relation.
switch (nRel) switch (nRel)
{ {
case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break; case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break;
case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break; case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break;
case RelOrientation::PAGE_LEFT: nRel = RelOrientation::FRAME_LEFT; break; case RelOrientation::PAGE_LEFT: nRel = RelOrientation::FRAME_LEFT; break;
case RelOrientation::PAGE_RIGHT: nRel = RelOrientation::FRAME_RIGHT; break; case RelOrientation::PAGE_RIGHT: nRel = RelOrientation::FRAME_RIGHT; break;
case RelOrientation::FRAME_LEFT: nRel = RelOrientation::PAGE_LEFT; break; case RelOrientation::FRAME_LEFT: nRel = RelOrientation::PAGE_LEFT; break;
......
/* -*- 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: */
...@@ -104,28 +104,32 @@ static void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale) ...@@ -104,28 +104,32 @@ static void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale)
\************************************************************************/ \************************************************************************/
SvxTransformTabDialog::SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr, SvxTransformTabDialog::SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr,
const SdrView* pSdrView, sal_uInt16 nAnchorTypes ) : const SdrView* pSdrView, sal_uInt16 nAnchorTypes )
SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_TRANSFORM ), pAttr ), : SfxTabDialog( pParent
pView ( pSdrView ), ,"PositionAndSizeDialog"
nAnchorCtrls(nAnchorTypes) ,"cui/ui/positionsizedialog.ui"
, pAttr )
, nPosSize(0)
, nSWPosSize(0)
, pView(pSdrView)
, nAnchorCtrls(nAnchorTypes)
{ {
DBG_ASSERT(pView, "no valid view (!)"); DBG_ASSERT(pView, "no valid view (!)");
FreeResource();
//different positioning page in Writer //different positioning page in Writer
if(nAnchorCtrls & 0x00ff) if(nAnchorCtrls & 0x00ff)
{ {
AddTabPage(RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges); nSWPosSize = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges);
RemoveTabPage(RID_SVXPAGE_POSITION_SIZE); RemoveTabPage("RID_SVXPAGE_POSITION_SIZE");
} }
else else
{ {
AddTabPage(RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges); nPosSize = AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges);
RemoveTabPage(RID_SVXPAGE_SWPOSSIZE); RemoveTabPage("RID_SVXPAGE_SWPOSSIZE");
} }
AddTabPage(RID_SVXPAGE_ANGLE, SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges); nRotation = AddTabPage("RID_SVXPAGE_ANGLE", SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges);
AddTabPage(RID_SVXPAGE_SLANT, SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges); nSlant = AddTabPage("RID_SVXPAGE_SLANT", SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges);
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -138,9 +142,7 @@ SvxTransformTabDialog::~SvxTransformTabDialog() ...@@ -138,9 +142,7 @@ SvxTransformTabDialog::~SvxTransformTabDialog()
void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{ {
switch(nId) if (nId==nPosSize)
{
case RID_SVXPAGE_POSITION_SIZE:
{ {
SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage); SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage);
rSvxPos.SetView(pView); rSvxPos.SetView(pView);
...@@ -156,40 +158,31 @@ void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) ...@@ -156,40 +158,31 @@ void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
rSvxPos.DisableProtect(); rSvxPos.DisableProtect();
rSvxPos.UpdateControlStates(); rSvxPos.UpdateControlStates();
} }
break;
} }
case RID_SVXPAGE_SWPOSSIZE : else if (nId == nSWPosSize)
{ {
SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage); SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage);
rSwPos.EnableAnchorTypes(nAnchorCtrls); rSwPos.EnableAnchorTypes(nAnchorCtrls);
rSwPos.SetValidateFramePosLink(aValidateLink); rSwPos.SetValidateFramePosLink(aValidateLink);
rSwPos.SetView(pView); rSwPos.SetView(pView);
break;
} }
case RID_SVXPAGE_ANGLE: else if( nId == nRotation)
{ {
SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage); SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage);
rSvxAng.SetView( pView ); rSvxAng.SetView( pView );
rSvxAng.Construct(); rSvxAng.Construct();
break;
} }
case RID_SVXPAGE_SLANT: else if (nId == nSlant)
{ {
SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage); SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage);
rSvxSlnt.SetView( pView ); rSvxSlnt.SetView( pView );
rSvxSlnt.Construct(); rSvxSlnt.Construct();
break;
} }
}
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
/* -*- 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: */
/* -*- 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: */
<?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>
...@@ -89,8 +89,6 @@ ...@@ -89,8 +89,6 @@
#define RID_SVXPAGE_HATCH (RID_SVX_START + 57) #define RID_SVXPAGE_HATCH (RID_SVX_START + 57)
#define RID_SVXPAGE_BITMAP (RID_SVX_START + 58) #define RID_SVXPAGE_BITMAP (RID_SVX_START + 58)
#define RID_SVXPAGE_GRADIENT (RID_SVX_START + 59) #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_DISTRIBUTE (RID_SVX_START + 236)
#define RID_SVXPAGE_MACROASSIGN (RID_SVX_START + 296) #define RID_SVXPAGE_MACROASSIGN (RID_SVX_START + 296)
......
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