diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-09-27 09:55:57 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-30 10:44:14 +0000 |
commit | e5c370e53d8701d863d231c26ce8e5c46385e5eb (patch) | |
tree | 53b6013416a1c48052b29e31afb54b255b06ccf6 /sd | |
parent | 959711f1276106b0aaee69ab660f1b0d3ece5bbc (diff) |
Convert Draw page dialog to Widget UI
Change-Id: I65cb85e4f8ce3f234e6d9ae780a83db04c23f0f6
Reviewed-on: https://gerrit.libreoffice.org/6053
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/AllLangResTarget_sd.mk | 1 | ||||
-rw-r--r-- | sd/UIConfig_sdraw.mk | 3 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgpage.cxx | 42 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgpage.src | 79 | ||||
-rw-r--r-- | sd/source/ui/inc/dlgpage.hrc | 21 | ||||
-rw-r--r-- | sd/source/ui/inc/dlgpage.hxx | 4 | ||||
-rw-r--r-- | sd/uiconfig/sdraw/ui/drawpagedialog.ui | 132 |
7 files changed, 157 insertions, 125 deletions
diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk index b4642be40085..978c41583588 100644 --- a/sd/AllLangResTarget_sd.mk +++ b/sd/AllLangResTarget_sd.mk @@ -48,7 +48,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\ sd/source/ui/dlg/dlg_char.src \ sd/source/ui/dlg/dlgfield.src \ sd/source/ui/dlg/dlgolbul.src \ - sd/source/ui/dlg/dlgpage.src \ sd/source/ui/dlg/inspagob.src \ sd/source/ui/dlg/ins_paste.src \ sd/source/ui/dlg/LayerDialog.src \ diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk index f5a5d1f40303..292955f750a6 100644 --- a/sd/UIConfig_sdraw.mk +++ b/sd/UIConfig_sdraw.mk @@ -68,7 +68,8 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/sdraw,\ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\ sd/uiconfig/sdraw/ui/dlgsnap \ sd/uiconfig/sdraw/ui/copydlg \ - sd/uiconfig/sdraw/ui/drawparadialog \ + sd/uiconfig/sdraw/ui/drawparadialog \ + sd/uiconfig/sdraw/ui/drawpagedialog \ sd/uiconfig/sdraw/ui/insertlayer \ sd/uiconfig/sdraw/ui/paranumberingtab \ sd/uiconfig/sdraw/ui/printeroptions \ diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx index e0bae00c4fcc..b6eebfc51440 100644 --- a/sd/source/ui/dlg/dlgpage.cxx +++ b/sd/source/ui/dlg/dlgpage.cxx @@ -34,8 +34,11 @@ * Constructor of tab dialog: appends pages to the dialog */ SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) : - SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ), - mpDocShell ( pDocSh ) + SfxTabDialog ( pParent + ,"DrawPageDialog" + ,"modules/sdraw/ui/drawpagedialog.ui" + , pAttr ), + mpDocShell ( pDocSh ) { SvxColorListItem aColorListItem(*( (const SvxColorListItem*) ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) ); @@ -51,43 +54,38 @@ SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* mpHatchingList = aHatchListItem.GetHatchList(); mpBitmapList = aBitmapListItem.GetBitmapList(); - FreeResource(); - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AddTabPage( RID_SVXPAGE_PAGE, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), 0 ); - AddTabPage( RID_SVXPAGE_AREA, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), 0 ); + mnPage = AddTabPage( "RID_SVXPAGE_PAGE", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), 0 ); + mnArea = AddTabPage( "RID_SVXPAGE_AREA", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), 0 ); if(!bAreaPage) // I have to add the page before I remove it ! - RemoveTabPage( RID_SVXPAGE_AREA ); + RemoveTabPage( "RID_SVXPAGE_AREA" ); } void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - switch(nId) + if (nId == mnPage) { - case RID_SVXPAGE_PAGE: aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION)); aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_START, PAPER_A0)); aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_END, PAPER_E)); rPage.PageCreated(aSet); - break; - case RID_SVXPAGE_AREA: - aSet.Put (SvxColorListItem(mpColorList,SID_COLOR_TABLE)); - aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST)); - aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST)); - aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST)); - aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0)); - aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); - aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0)); - rPage.PageCreated(aSet); - break; + } + else if (nId == mnArea) + { + aSet.Put (SvxColorListItem(mpColorList,SID_COLOR_TABLE)); + aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST)); + aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST)); + aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST)); + aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0)); + aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); + aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0)); + rPage.PageCreated(aSet); } } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/dlgpage.src b/sd/source/ui/dlg/dlgpage.src deleted file mode 100644 index 7e3dbb5286f5..000000000000 --- a/sd/source/ui/dlg/dlgpage.src +++ /dev/null @@ -1,79 +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 <svx/dialogs.hrc> -#include "dlgpage.hrc" -TabDialog TAB_PAGE -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 289 , 176 ) ; - Text [ en-US ] = "Page Setup" ; - Moveable = TRUE ; - Closeable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , 135 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_PAGE ; - Text [ en-US ] = "Page" ; - PageResID = RID_SVXPAGE_PAGE ; - }; - - PageItem - { - Identifier = RID_SVXPAGE_AREA; - PageResID = RID_SVXPAGE_AREA; - Text [ en-US ] = "Background"; - }; - }; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 6 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 60 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 114 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton 1 - { - Pos = MAP_APPFONT ( 169 , 151 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "Return" ; - TabStop = TRUE ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/dlgpage.hrc b/sd/source/ui/inc/dlgpage.hrc deleted file mode 100644 index 6742088e76e5..000000000000 --- a/sd/source/ui/inc/dlgpage.hrc +++ /dev/null @@ -1,21 +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_PAGE 20625 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/dlgpage.hxx b/sd/source/ui/inc/dlgpage.hxx index 952a6101559c..4e53efd8e824 100644 --- a/sd/source/ui/inc/dlgpage.hxx +++ b/sd/source/ui/inc/dlgpage.hxx @@ -22,7 +22,6 @@ #define _SD_DLGPAGE_HXX #include <sfx2/tabdlg.hxx> -#include "dlgpage.hrc" class SfxObjectShell; @@ -40,6 +39,9 @@ private: XGradientListRef mpGradientList; XHatchListRef mpHatchingList; XBitmapListRef mpBitmapList; + sal_uInt16 mnArea; + sal_uInt16 mnPage; + public: SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage = sal_True ); diff --git a/sd/uiconfig/sdraw/ui/drawpagedialog.ui b/sd/uiconfig/sdraw/ui/drawpagedialog.ui new file mode 100644 index 000000000000..df9e19eac1f1 --- /dev/null +++ b/sd/uiconfig/sdraw/ui/drawpagedialog.ui @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="DrawPageDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</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_PAGE"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Page</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="RID_SVXPAGE_AREA"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Background</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> |