From acee1b8b8c68c5c9d7492dbcc95635e68551713f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 19 Dec 2013 12:30:43 +0000 Subject: convert border background dialog to .ui Change-Id: I661384b04fef7f59c2b4feffe093cf75103d55d1 --- cui/AllLangResTarget_cui.mk | 1 - cui/UIConfig_cui.mk | 1 + cui/source/inc/bbdlg.hxx | 11 +-- cui/source/inc/cuires.hrc | 1 - cui/source/tabpages/bbdlg.cxx | 34 ++------ cui/source/tabpages/bbdlg.src | 54 ------------ cui/uiconfig/ui/borderbackgrounddialog.ui | 133 ++++++++++++++++++++++++++++++ 7 files changed, 147 insertions(+), 88 deletions(-) delete mode 100644 cui/source/tabpages/bbdlg.src create mode 100644 cui/uiconfig/ui/borderbackgrounddialog.ui (limited to 'cui') diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk index 3265c7e2fb8e..9bf5505cd229 100644 --- a/cui/AllLangResTarget_cui.mk +++ b/cui/AllLangResTarget_cui.mk @@ -59,7 +59,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\ cui/source/options/treeopt.src \ cui/source/tabpages/align.src \ cui/source/tabpages/autocdlg.src \ - cui/source/tabpages/bbdlg.src \ cui/source/tabpages/border.src \ cui/source/tabpages/dstribut.src \ cui/source/tabpages/frmdirlbox.src \ diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 1ae0d8377d5e..174b243c7359 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -24,6 +24,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/autocorrectdialog \ cui/uiconfig/ui/backgroundpage \ cui/uiconfig/ui/bitmaptabpage \ + cui/uiconfig/ui/borderbackgrounddialog \ cui/uiconfig/ui/borderpage \ cui/uiconfig/ui/breaknumberoption \ cui/uiconfig/ui/cellalignment \ diff --git a/cui/source/inc/bbdlg.hxx b/cui/source/inc/bbdlg.hxx index a1bddb35c5b4..0b3139a6da73 100644 --- a/cui/source/inc/bbdlg.hxx +++ b/cui/source/inc/bbdlg.hxx @@ -28,17 +28,14 @@ class SvxBorderBackgroundDlg: public SfxTabDialog { public: - SvxBorderBackgroundDlg( Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector = sal_False ); - - ~SvxBorderBackgroundDlg(); - + SvxBorderBackgroundDlg(Window *pParent, const SfxItemSet& rCoreSet, + bool bEnableSelector = false); protected: virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); private: - sal_Bool bEnableBackgroundSelector; ///< for Border/Background + bool m_bEnableBackgroundSelector; ///< for Border/Background + sal_uInt16 m_nBackgroundPageId; }; diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index fc70da2587b5..da21280a0c94 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -41,7 +41,6 @@ // used in "tabpages" #define RID_SVXDLG_LINE (RID_SVX_START + 50) -#define RID_SVXDLG_BBDLG (RID_SVX_START + 40) #define RID_SVXDLG_CAPTION (RID_SVX_START + 151) #define RID_SVXSTRARY_PAPERSIZE_STD (RID_SVX_START + 142) #define RID_SVXSTRARY_PAPERSIZE_DRAW (RID_SVX_START + 143) diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx index dc99b22a932e..30a487c7f12f 100644 --- a/cui/source/tabpages/bbdlg.cxx +++ b/cui/source/tabpages/bbdlg.cxx @@ -17,43 +17,27 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include - #include "bbdlg.hxx" #include "border.hxx" #include "backgrnd.hxx" -#include - -// class SvxBorderBackgroundDlg ------------------------------------------ - -SvxBorderBackgroundDlg::SvxBorderBackgroundDlg( Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector ) : - - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_BBDLG ), &rCoreSet ), - bEnableBackgroundSelector( bEnableSelector ) -{ - FreeResource(); - AddTabPage( RID_SVXPAGE_BORDER, SvxBorderTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 ); -} -// ----------------------------------------------------------------------- +SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(Window *pParent, + const SfxItemSet& rCoreSet, bool bEnableSelector) -SvxBorderBackgroundDlg::~SvxBorderBackgroundDlg() + : SfxTabDialog(pParent, "BorderBackgroundDialog", + "cui/ui/borderbackgrounddialog.ui", &rCoreSet) + , m_bEnableBackgroundSelector(bEnableSelector) + , m_nBackgroundPageId(0) { + AddTabPage("borders", SvxBorderTabPage::Create, 0 ); + m_nBackgroundPageId = AddTabPage("background", SvxBackgroundTabPage::Create, 0 ); } -// ----------------------------------------------------------------------- - void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) { // Make it possible to switch between color/graphic: - if ( bEnableBackgroundSelector && (RID_SVXPAGE_BACKGROUND == nPageId) ) + if ( m_bEnableBackgroundSelector && (nPageId == m_nBackgroundPageId) ) ((SvxBackgroundTabPage&)rTabPage).ShowSelector( ); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/bbdlg.src b/cui/source/tabpages/bbdlg.src deleted file mode 100644 index da680a9f4e3a..000000000000 --- a/cui/source/tabpages/bbdlg.src +++ /dev/null @@ -1,54 +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 - - // RID_SVXDLG_BBDLG ------------------------------------------------------ -TabDialog RID_SVXDLG_BBDLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 328 , 155 ) ; - Text [ en-US ] = "Border / Background" ; - Moveable = TRUE ; - // Closeable = TRUE; hat ja einen OKButton - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 2 , 10 ) ; - Size = MAP_APPFONT ( 260 , 135 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_BORDER ; - Text [ en-US ] = "Borders" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_BACKGROUND ; - Text [ en-US ] = "Background" ; - }; - }; - }; -}; - // ********************************************************************** EOF - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/borderbackgrounddialog.ui b/cui/uiconfig/ui/borderbackgrounddialog.ui new file mode 100644 index 000000000000..9b9b71ff2373 --- /dev/null +++ b/cui/uiconfig/ui/borderbackgrounddialog.ui @@ -0,0 +1,133 @@ + + + + + False + 6 + Border / Background + dialog + + + False + vertical + 12 + + + 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 + True + True + True + + + + + + True + False + Borders + + + False + + + + + + + + True + False + Background + + + 1 + False + + + + + False + True + 1 + + + + + + ok + cancel + help + reset + + + -- cgit