From e1283c873c8a535fd91a9d077970aab6cd1a98f3 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Sat, 17 Aug 2013 21:23:17 -0300 Subject: Convert text dialog to widget UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifd1303db2b3da95d80baaace898fc3e93996fa76 Reviewed-on: https://gerrit.libreoffice.org/5486 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/AllLangResTarget_cui.mk | 1 - cui/UIConfig_cui.mk | 1 + cui/source/inc/cuires.hrc | 1 - cui/source/inc/textanim.hxx | 2 + cui/source/tabpages/textanim.cxx | 23 +++---- cui/source/tabpages/textanim.src | 89 -------------------------- cui/uiconfig/ui/textdialog.ui | 132 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 142 insertions(+), 107 deletions(-) delete mode 100644 cui/source/tabpages/textanim.src create mode 100644 cui/uiconfig/ui/textdialog.ui (limited to 'cui') diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk index 8b1b8e3dde34..2ba3b3afe2d0 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/textanim.src \ cui/source/tabpages/transfrm.src \ )) diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 2d93b34d0c09..632a2d6cc238 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -109,6 +109,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/swpossizepage \ cui/uiconfig/ui/textattrtabpage \ cui/uiconfig/ui/textanimtabpage \ + cui/uiconfig/ui/textdialog \ cui/uiconfig/ui/textflowpage \ cui/uiconfig/ui/thesaurus \ cui/uiconfig/ui/transparencytabpage \ diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index d3f077989ee4..c7ef4780fd31 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_TEXT (RID_SVX_START + 183) #define RID_SVXDLG_TRANSFORM (RID_SVX_START + 45) #define RID_SVXDLG_LINE (RID_SVX_START + 50) #define RID_SVXDLG_BBDLG (RID_SVX_START + 40) diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx index e70f20b78726..df483f1ac615 100644 --- a/cui/source/inc/textanim.hxx +++ b/cui/source/inc/textanim.hxx @@ -92,6 +92,8 @@ public: \************************************************************************/ class SvxTextTabDialog : public SfxTabDialog { + sal_uInt16 m_nTextId; + sal_uInt16 m_nTextAnimId; private: const SdrView* pView; diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 53340714347e..02edafe950aa 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -45,13 +45,14 @@ static sal_uInt16 pRanges[] = SvxTextTabDialog::SvxTextTabDialog( Window* pParent, const SfxItemSet* pAttr, const SdrView* pSdrView ) : - SfxTabDialog ( pParent, CUI_RES( RID_SVXDLG_TEXT ), pAttr ), + SfxTabDialog ( pParent + ,"TextDialog" + ,"cui/ui/textdialog.ui" + , pAttr ), pView ( pSdrView ) { - FreeResource(); - - AddTabPage( RID_SVXPAGE_TEXTATTR, SvxTextAttrPage::Create, 0); - AddTabPage( RID_SVXPAGE_TEXTANIMATION, SvxTextAnimationPage::Create, 0); + m_nTextId = AddTabPage( "RID_SVXPAGE_TEXTATTR", SvxTextAttrPage::Create, 0); + m_nTextAnimId = AddTabPage( "RID_SVXPAGE_TEXTANIMATION", SvxTextAnimationPage::Create, 0); } /************************************************************************* @@ -62,21 +63,11 @@ SvxTextTabDialog::SvxTextTabDialog( Window* pParent, void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { - switch( nId ) - { - case RID_SVXPAGE_TEXTATTR: + if (nId == m_nTextId) { ( (SvxTextAttrPage&) rPage ).SetView( pView ); ( (SvxTextAttrPage&) rPage ).Construct(); } - break; - - case RID_SVXPAGE_TEXTANIMATION: - break; - - default: - break; - } } diff --git a/cui/source/tabpages/textanim.src b/cui/source/tabpages/textanim.src deleted file mode 100644 index 41ea9b7ff592..000000000000 --- a/cui/source/tabpages/textanim.src +++ /dev/null @@ -1,89 +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 -#include -#include - -// direction image buttons -#define MA_HALFBUTTON_WIDTH 7 -#define MA_BUTTON_WIDTH (2 * MA_HALFBUTTON_WIDTH) -#define MA_BUTTON_HEIGHT (2 * MA_HALFBUTTON_WIDTH) -#define BUTTON_SIZE MAP_APPFONT( MA_BUTTON_WIDTH, MA_BUTTON_WIDTH ) -#define MA_MOVEBUT_GRACE_X 6 - -// height of first group Text effects -#define MA_EFFECTSGROUP_HEIGHT (RSC_CD_FIXEDLINE_HEIGHT + \ - RSC_SP_FLGR_INNERBORDER_LEFT + \ -/* direction buttons */ 3*MA_BUTTON_HEIGHT + \ - RSC_SP_FLGR_INNERBORDER_BOTTOM + RSC_SP_FLGR_SPACE_Y) - -// height of second group height of FIXEDTEXT -#define MA_PROPERTIESGROUP_HEIGHT (RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_LEFT + \ -/* text initially visible */ RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* text finally visible */ RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* animation runs */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* number of runs */ RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* step size */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* number of pixel */ RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* step delay */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* delay time */ RSC_CD_TEXTBOX_HEIGHT) - -// tabpage total size -#define MA_TOTAL_WIDTH 260 -#define MA_TOTAL_HEIGHT RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT + MA_PROPERTIESGROUP_HEIGHT + RSC_SP_TBPG_INNERBORDER_BOTTOM - -// X position and width of effects drop down -#define MA_EFFECTLIST_X 50 -#define MA_EFFECTLIST_WIDTH 95 - - - // RID_SVXDLG_TEXT ------------------------------------------------------- -TabDialog RID_SVXDLG_TEXT -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 289 , 185 + 46 ) ; - Text [ en-US ] = "Text" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - PageList = - { - PageItem - { - PageResID = RID_SVXPAGE_TEXTATTR ; - Identifier = RID_SVXPAGE_TEXTATTR ; - Text [ en-US ] = "Text" ; - }; - PageItem - { - PageResID = RID_SVXPAGE_TEXTANIMATION ; - Identifier = RID_SVXPAGE_TEXTANIMATION ; - Text [ en-US ] = "Text Animation" ; - }; - }; - }; -}; - // ******************************************************************* EOF - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/textdialog.ui b/cui/uiconfig/ui/textdialog.ui new file mode 100644 index 000000000000..8434d9f84db9 --- /dev/null +++ b/cui/uiconfig/ui/textdialog.ui @@ -0,0 +1,132 @@ + + + + + False + 5 + dialog + + + False + vertical + 2 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + gtk-revert-to-saved + True + True + True + True + + + False + True + 3 + + + + + False + True + end + 0 + + + + + True + False + True + True + + + + + + True + False + Text + + + False + + + + + + + + True + False + Text animation + + + 1 + False + + + + + False + True + 1 + + + + + + ok + cancel + help + reset + + + -- cgit