diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-08-17 21:23:17 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-18 12:57:27 +0000 |
commit | e1283c873c8a535fd91a9d077970aab6cd1a98f3 (patch) | |
tree | 2c46be3c07ddacfc25636ef541212a03642797ec /cui | |
parent | cc0b40f6a94f05b36b31b1a7a55431e1b5f2608e (diff) |
Convert text dialog to widget UI
Change-Id: Ifd1303db2b3da95d80baaace898fc3e93996fa76
Reviewed-on: https://gerrit.libreoffice.org/5486
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.mk | 1 | ||||
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 1 | ||||
-rw-r--r-- | cui/source/inc/textanim.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/textanim.cxx | 23 | ||||
-rw-r--r-- | cui/source/tabpages/textanim.src | 89 | ||||
-rw-r--r-- | cui/uiconfig/ui/textdialog.ui | 132 |
7 files changed, 142 insertions, 107 deletions
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 <svtools/controldims.hrc> -#include <cuires.hrc> -#include <svx/dialogs.hrc> - -// 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="TextDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</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">2</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_TEXTATTR"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Text</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="RID_SVXPAGE_TEXTANIMATION"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Text animation</property> + </object> + <packing> + <property name="position">1</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> |