From c6f4f70b24eaddbedf8bb463dfc4bd225f3c7f86 Mon Sep 17 00:00:00 2001 From: Palenik Mihály Date: Sun, 3 Aug 2014 15:55:33 +0200 Subject: Convert RID_SVXDLG_ASSIGNCOMPONENT to .ui Change-Id: Id38ee64e22684905c1a0809d3649e54e893580e1 Reviewed-on: https://gerrit.libreoffice.org/10710 Reviewed-by: David Tardon Tested-by: David Tardon --- cui/UIConfig_cui.mk | 1 + cui/source/customize/macropg.cxx | 17 ++--- cui/source/customize/macropg.hrc | 54 -------------- cui/source/customize/macropg.src | 47 ------------ cui/source/customize/macropg_impl.hxx | 7 +- cui/source/inc/cuires.hrc | 1 - cui/uiconfig/ui/assigncomponentdialog.ui | 124 +++++++++++++++++++++++++++++++ 7 files changed, 133 insertions(+), 118 deletions(-) delete mode 100644 cui/source/customize/macropg.hrc create mode 100644 cui/uiconfig/ui/assigncomponentdialog.ui diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index dbd98d091b0e..c806bfc01081 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -23,6 +23,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/areadialog \ cui/uiconfig/ui/areatabpage \ cui/uiconfig/ui/asiantypography \ + cui/uiconfig/ui/assigncomponentdialog \ cui/uiconfig/ui/autocorrectdialog \ cui/uiconfig/ui/backgroundpage \ cui/uiconfig/ui/baselinksdialog \ diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 8ab8d2b092f6..fcb3af8f2221 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -35,7 +35,6 @@ #include #include "selector.hxx" #include "cfg.hxx" -#include "macropg.hrc" #include "helpid.hrc" #include #include "headertablistbox.hxx" @@ -847,7 +846,7 @@ SvxMacroAssignDlg::SvxMacroAssignDlg( Window* pParent, const Reference< frame::X IMPL_LINK_NOARG(AssignComponentDialog, ButtonHandler) { - OUString aMethodName = maMethodEdit.GetText(); + OUString aMethodName = mpMethodEdit->GetText(); maURL = ""; if( !aMethodName.isEmpty() ) { @@ -859,16 +858,12 @@ IMPL_LINK_NOARG(AssignComponentDialog, ButtonHandler) } AssignComponentDialog::AssignComponentDialog( Window * pParent, const OUString& rURL ) - : ModalDialog( pParent, CUI_RES( RID_SVXDLG_ASSIGNCOMPONENT ) ) - , maMethodLabel( this, CUI_RES( FT_METHOD ) ) - , maMethodEdit( this, CUI_RES( EDIT_METHOD ) ) - , maOKButton( this, CUI_RES( RID_PB_OK ) ) - , maCancelButton( this, CUI_RES( RID_PB_CANCEL ) ) - , maHelpButton( this, CUI_RES( RID_PB_HELP ) ) + : ModalDialog( pParent, "AssignComponent", "cui/ui/assigncomponentdialog.ui" ) , maURL( rURL ) { - FreeResource(); - maOKButton.SetClickHdl(LINK(this, AssignComponentDialog, ButtonHandler)); + get(mpMethodEdit, "methodEntry"); + get(mpOKButton, "ok"); + mpOKButton->SetClickHdl(LINK(this, AssignComponentDialog, ButtonHandler)); OUString aMethodName; if( maURL.startsWith( aVndSunStarUNO ) ) @@ -876,7 +871,7 @@ AssignComponentDialog::AssignComponentDialog( Window * pParent, const OUString& sal_Int32 nBegin = aVndSunStarUNO.getLength(); aMethodName = maURL.copy( nBegin ); } - maMethodEdit.SetText( aMethodName, Selection( 0, SELECTION_MAX ) ); + mpMethodEdit->SetText( aMethodName, Selection( 0, SELECTION_MAX ) ); } AssignComponentDialog::~AssignComponentDialog() diff --git a/cui/source/customize/macropg.hrc b/cui/source/customize/macropg.hrc deleted file mode 100644 index 5101a038f7cd..000000000000 --- a/cui/source/customize/macropg.hrc +++ /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 . - */ - -#ifndef _MACROPG_HRC -#define _MACROPG_HRC - -#include - -#define LB_EVENT 1 -#define PB_DELETE 3 -#define STR_EVENT 4 -#define STR_ASSMACRO 5 -#define FT_ASSIGN 6 -#define PB_ASSIGN_COMPONENT 7 - -#define IMG_MACRO 30 -#define IMG_COMPONENT 31 - -#define RID_PB_OK 41 -#define RID_PB_CANCEL 42 -#define RID_PB_HELP 43 -#define FT_METHOD 44 -#define EDIT_METHOD 45 - -#define COMP_EDIT_WIDTH 100 -#define COMP_DIST_Y 6 -#define COMP_WIDTH (COMP_EDIT_WIDTH+RSC_CD_PUSHBUTTON_WIDTH+3*COMP_DIST_Y) -#define COMP_COL0 COMP_DIST_Y -#define COMP_COL1 (COMP_COL0+COMP_EDIT_WIDTH+COMP_DIST_Y) -#define COMP_ROW0 6 -#define COMP_ROW1 (COMP_ROW0+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_CTRL_GROUP_Y) -#define COMP_ROW2 (COMP_ROW1+RSC_CD_PUSHBUTTON_HEIGHT+2*RSC_SP_CTRL_GROUP_Y) -#define COMP_ROWEDIT (COMP_ROW0+RSC_CD_FIXEDTEXT_HEIGHT+2) -#define COMP_HEIGHT (COMP_ROW2+RSC_CD_PUSHBUTTON_HEIGHT+2*RSC_SP_CTRL_GROUP_Y) - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/customize/macropg.src b/cui/source/customize/macropg.src index 3c9c4944790a..c4cc3675ea56 100644 --- a/cui/source/customize/macropg.src +++ b/cui/source/customize/macropg.src @@ -18,57 +18,10 @@ */ #include -#include "macropg.hrc" #include #include "helpid.hrc" #include -#define MASKCOLOR MaskColor = \ - Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }; - -ModalDialog RID_SVXDLG_ASSIGNCOMPONENT -{ - HelpID = "cui:ModalDialog:RID_SVXDLG_ASSIGNCOMPONENT"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( COMP_WIDTH , COMP_HEIGHT ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "Assign Component"; - OKButton RID_PB_OK - { - Pos = MAP_APPFONT ( COMP_COL1 , COMP_ROW0 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton RID_PB_CANCEL - { - Pos = MAP_APPFONT ( COMP_COL1 , COMP_ROW1 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - HelpButton RID_PB_HELP - { - Pos = MAP_APPFONT ( COMP_COL1 , COMP_ROW2 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - }; - FixedText FT_METHOD - { - Pos = MAP_APPFONT ( COMP_COL0 , COMP_ROW0 ) ; - Size = MAP_APPFONT ( COMP_EDIT_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Component method name" ; - }; - Edit EDIT_METHOD - { - HelpID = "cui:Edit:RID_SVXDLG_ASSIGNCOMPONENT:EDIT_METHOD"; - Border = TRUE ; - Pos = MAP_APPFONT ( COMP_COL0 , COMP_ROWEDIT ) ; - Size = MAP_APPFONT ( COMP_EDIT_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; - TabStop = TRUE ; - }; -}; - //DF String RID_SVXSTR_EVENT_STARTAPP { diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx index 907bdfdf06af..4f8e824db0b3 100644 --- a/cui/source/customize/macropg_impl.hxx +++ b/cui/source/customize/macropg_impl.hxx @@ -40,11 +40,8 @@ public: class AssignComponentDialog : public ModalDialog { private: - FixedText maMethodLabel; - Edit maMethodEdit; - OKButton maOKButton; - CancelButton maCancelButton; - HelpButton maHelpButton; + Edit* mpMethodEdit; + OKButton* mpOKButton; OUString maURL; diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 1c6280d8d1e8..176e7fd594e2 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -259,7 +259,6 @@ #define RID_SVXDLG_CUSTOMIZE (RID_SVX_START + 291) #define RID_SVXPAGE_TOOLBARS (RID_SVX_START + 294) #define RID_SVXPAGE_CONFIGGROUPBOX (RID_SVX_START + 304) -#define RID_SVXDLG_ASSIGNCOMPONENT (RID_SVX_START + 297) #define RID_SVXSTR_NEW_MENU (RID_SVX_START + 1039) #define RID_SVXSTR_NEW_TOOLBAR (RID_SVX_START + 1040) diff --git a/cui/uiconfig/ui/assigncomponentdialog.ui b/cui/uiconfig/ui/assigncomponentdialog.ui new file mode 100644 index 000000000000..48b777d0e264 --- /dev/null +++ b/cui/uiconfig/ui/assigncomponentdialog.ui @@ -0,0 +1,124 @@ + + + + + False + True + True + 6 + Assign Component + dialog + + + False + True + True + 12 + + + False + vertical + start + + + gtk-ok + False + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + False + True + True + True + True + + + False + True + 1 + + + + + gtk-help + False + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + vertical + + + True + False + start + Component method name + + + False + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit