From e484def6763bf94a70c3fef3c68bbef50eced67f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 24 Apr 2013 15:59:17 +0100 Subject: adapt code to insert layer .ui conversion Change-Id: I75e83c2e2399f12e7d4cd035856e5ee07a75d494 --- sd/AllLangResTarget_sd.mk | 1 - sd/UIConfig_sdraw.mk | 1 + sd/source/ui/dlg/layeroptionsdlg.cxx | 62 +++---- sd/source/ui/dlg/layeroptionsdlg.src | 139 ---------------- sd/source/ui/inc/layeroptionsdlg.hrc | 38 ----- sd/source/ui/inc/layeroptionsdlg.hxx | 24 +-- sd/uiconfig/sdraw/ui/insertlayer.ui | 315 ++++++++++++++++++----------------- 7 files changed, 197 insertions(+), 383 deletions(-) delete mode 100644 sd/source/ui/dlg/layeroptionsdlg.src delete mode 100644 sd/source/ui/inc/layeroptionsdlg.hrc (limited to 'sd') diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk index a5838b8f938b..11aedefea7bd 100644 --- a/sd/AllLangResTarget_sd.mk +++ b/sd/AllLangResTarget_sd.mk @@ -58,7 +58,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\ sd/source/ui/dlg/inspagob.src \ sd/source/ui/dlg/ins_paste.src \ sd/source/ui/dlg/LayerDialog.src \ - sd/source/ui/dlg/layeroptionsdlg.src \ sd/source/ui/dlg/masterlayoutdlg.src \ sd/source/ui/dlg/morphdlg.src \ sd/source/ui/dlg/navigatr.src \ diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk index fc7244c7a89f..3fda04ddc6c7 100644 --- a/sd/UIConfig_sdraw.mk +++ b/sd/UIConfig_sdraw.mk @@ -66,6 +66,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/sdraw,\ )) $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\ + sd/uiconfig/sdraw/ui/insertlayer \ sd/uiconfig/sdraw/ui/printeroptions \ )) diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx index df8365ec0297..e9c56ce7891c 100644 --- a/sd/source/ui/dlg/layeroptionsdlg.cxx +++ b/sd/source/ui/dlg/layeroptionsdlg.cxx @@ -19,56 +19,46 @@ #include +#include #include "strings.hrc" #include "sdattr.hxx" #include "sdresid.hxx" #include "layeroptionsdlg.hxx" -#include "layeroptionsdlg.hrc" -SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, String aStr ) -: ModalDialog( pWindow, SdResId( DLG_INSERT_LAYER ) ) -, maFtName( this, SdResId( FT_NAME ) ) -, maEdtName( this, SdResId( EDT_NAME ) ) -, maFtTitle( this, SdResId( FT_TITLE ) ) -, maEdtTitle( this, SdResId( EDT_TITLE ) ) -, maFtDesc( this, SdResId( FT_DESCRIPTION ) ) -, maEdtDesc( this, SdResId( EDT_DESCRIPTION ) ) -, maCbxVisible( this, SdResId( CBX_VISIBLE ) ) -, maCbxPrintable( this, SdResId( CBX_PRINTABLE ) ) -, maCbxLocked( this, SdResId( CBX_LOCKED ) ) -, maFixedLine( this, SdResId( FL_SEPARATOR_B ) ) -, maBtnHelp( this, SdResId( BTN_HELP ) ) -, maBtnOK( this, SdResId( BTN_OK ) ) -, maBtnCancel( this, SdResId( BTN_CANCEL ) ) -, mrOutAttrs( rInAttrs ) +SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, + bool bDeletable, const OUString& rStr ) + : ModalDialog(pWindow, "InsertLayerDialog", "modules/sdraw/ui/insertlayer.ui") + , mrOutAttrs(rInAttrs) { - FreeResource(); + SetText(rStr); - SetText( aStr ); + get(m_pEdtName, "name"); + get(m_pEdtTitle, "title"); + get(m_pEdtDesc, "textview"); + get(m_pCbxVisible, "visible"); + get(m_pCbxPrintable, "printable"); + get(m_pCbxLocked, "locked"); - maEdtName.SetText( ( ( const SdAttrLayerName& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() ); - maEdtTitle.SetText( ( ( const SdAttrLayerTitle& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() ); - maEdtDesc.SetText( ( ( const SdAttrLayerDesc& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() ); - maCbxVisible.Check( ( ( const SdAttrLayerVisible& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() ); - maCbxPrintable.Check( ( ( const SdAttrLayerPrintable& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() ); - maCbxLocked.Check( ( ( const SdAttrLayerLocked& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() ); + m_pEdtName->SetText( ( ( const SdAttrLayerName& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() ); + m_pEdtTitle->SetText( ( ( const SdAttrLayerTitle& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() ); + m_pEdtDesc->SetText( ( ( const SdAttrLayerDesc& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() ); + m_pEdtDesc->set_height_request(4 * m_pEdtDesc->GetTextHeight()); + m_pCbxVisible->Check( ( ( const SdAttrLayerVisible& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() ); + m_pCbxPrintable->Check( ( ( const SdAttrLayerPrintable& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() ); + m_pCbxLocked->Check( ( ( const SdAttrLayerLocked& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() ); - if( !bDeletable ) - { - maFtName.Disable(); - maEdtName.Disable(); - } + get("nameframe")->Enable(bDeletable); } void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs ) { - rAttrs.Put( SdAttrLayerName( maEdtName.GetText() ) ); - rAttrs.Put( SdAttrLayerTitle( maEdtTitle.GetText() ) ); - rAttrs.Put( SdAttrLayerDesc( maEdtDesc.GetText() ) ); - rAttrs.Put( SdAttrLayerVisible( maCbxVisible.IsChecked() ) ); - rAttrs.Put( SdAttrLayerPrintable( maCbxPrintable.IsChecked() ) ); - rAttrs.Put( SdAttrLayerLocked( maCbxLocked.IsChecked() ) ); + rAttrs.Put( SdAttrLayerName( m_pEdtName->GetText() ) ); + rAttrs.Put( SdAttrLayerTitle( m_pEdtTitle->GetText() ) ); + rAttrs.Put( SdAttrLayerDesc( m_pEdtDesc->GetText() ) ); + rAttrs.Put( SdAttrLayerVisible( m_pCbxVisible->IsChecked() ) ); + rAttrs.Put( SdAttrLayerPrintable( m_pCbxPrintable->IsChecked() ) ); + rAttrs.Put( SdAttrLayerLocked( m_pCbxLocked->IsChecked() ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/layeroptionsdlg.src b/sd/source/ui/dlg/layeroptionsdlg.src deleted file mode 100644 index 834c5a61a967..000000000000 --- a/sd/source/ui/dlg/layeroptionsdlg.src +++ /dev/null @@ -1,139 +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 "app.hrc" -#include "layeroptionsdlg.hrc" -#include "helpids.h" - -ModalDialog DLG_INSERT_LAYER -{ - HelpID = CMD_SID_INSERTLAYER ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 200 , 172 ) ; - Text [ en-US ] = "Insert Layer" ; - Moveable = TRUE ; - - FixedText FT_NAME - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 188 , 8 ) ; - Text [ en-US ] = "~Name" ; - }; - - Edit EDT_NAME - { - HelpID = "sd:Edit:DLG_INSERT_LAYER:EDT_NAME"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 17 ) ; - Size = MAP_APPFONT ( 188 , 12 ) ; - TabStop = TRUE ; - }; - - FixedText FT_TITLE - { - Pos = MAP_APPFONT ( 6 , 32 ) ; - Size = MAP_APPFONT ( 188 , 8 ) ; - Text [ en-US ] = "~Title" ; - }; - - Edit EDT_TITLE - { - HelpID = "sd:Edit:DLG_INSERT_LAYER:EDT_TITLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 43 ) ; - Size = MAP_APPFONT ( 188 , 12 ) ; - TabStop = TRUE ; - }; - - FixedText FT_DESCRIPTION - { - Pos = MAP_APPFONT ( 6 , 58 ) ; - Size = MAP_APPFONT ( 188 , 8 ) ; - Text [ en-US ] = "~Description" ; - }; - - MultiLineEdit EDT_DESCRIPTION - { - HelpID = "sd:MultiLineEdit:DLG_INSERT_LAYER:EDT_DESCRIPTION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 69 ) ; - Size = MAP_APPFONT ( 188 , 34 ) ; - TabStop = TRUE ; - IgnoreTab = TRUE; - VScroll = TRUE; - }; - - CheckBox CBX_VISIBLE - { - HelpID = "sd:CheckBox:DLG_INSERT_LAYER:CBX_VISIBLE"; - Pos = MAP_APPFONT ( 6 , 106 ) ; - Size = MAP_APPFONT ( 188 , 10 ) ; - Text [ en-US ] = "~Visible" ; - TabStop = TRUE ; - }; - - CheckBox CBX_PRINTABLE - { - HelpID = "sd:CheckBox:DLG_INSERT_LAYER:CBX_PRINTABLE"; - Pos = MAP_APPFONT ( 6 , 119 ) ; - Size = MAP_APPFONT ( 188 , 10 ) ; - Text [ en-US ] = "~Printable" ; - TabStop = TRUE ; - }; - - CheckBox CBX_LOCKED - { - HelpID = "sd:CheckBox:DLG_INSERT_LAYER:CBX_LOCKED"; - Pos = MAP_APPFONT ( 6 , 132 ) ; - Size = MAP_APPFONT ( 188 , 10 ) ; - Text [ en-US ] = "~Locked" ; - TabStop = TRUE ; - }; - - // divider - FixedLine FL_SEPARATOR_B - { - Pos = MAP_APPFONT ( 0 , 144 ) ; - Size = MAP_APPFONT ( 200 , 4 ) ; - }; - - // Buttons - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 6, 152 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 200 - (50 + 50 + 9), 152) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 200 - (50 + 6), 152) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/layeroptionsdlg.hrc b/sd/source/ui/inc/layeroptionsdlg.hrc deleted file mode 100644 index 438878bb3699..000000000000 --- a/sd/source/ui/inc/layeroptionsdlg.hrc +++ /dev/null @@ -1,38 +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 - -#define DLG_INSERT_LAYER 259 - -#define FT_NAME 1 -#define EDT_NAME 2 -#define FT_TITLE 3 -#define EDT_TITLE 4 -#define FT_DESCRIPTION 5 -#define EDT_DESCRIPTION 6 -#define CBX_VISIBLE 7 -#define CBX_PRINTABLE 8 -#define CBX_LOCKED 9 -#define FL_SEPARATOR_B 10 - -#define BTN_HELP 1 -#define BTN_OK 1 -#define BTN_CANCEL 1 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/layeroptionsdlg.hxx b/sd/source/ui/inc/layeroptionsdlg.hxx index 54d75be9b0fe..efd48846f7a9 100644 --- a/sd/source/ui/inc/layeroptionsdlg.hxx +++ b/sd/source/ui/inc/layeroptionsdlg.hxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "sdresid.hxx" #include "strings.hrc" @@ -36,25 +36,19 @@ class SfxItemSet; class SD_DLLPUBLIC SdInsertLayerDlg : public ModalDialog { private: - FixedText maFtName; - Edit maEdtName; - FixedText maFtTitle; - Edit maEdtTitle; - FixedText maFtDesc; - MultiLineEdit maEdtDesc; - CheckBox maCbxVisible; - CheckBox maCbxPrintable; - CheckBox maCbxLocked; - FixedLine maFixedLine; - HelpButton maBtnHelp; - OKButton maBtnOK; - CancelButton maBtnCancel; + Edit* m_pEdtName; + Edit* m_pEdtTitle; + VclMultiLineEdit* m_pEdtDesc; + CheckBox* m_pCbxVisible; + CheckBox* m_pCbxPrintable; + CheckBox* m_pCbxLocked; const SfxItemSet& mrOutAttrs; public: - SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, String aStr ); + SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, + bool bDeletable, const OUString& rStr ); void GetAttr( SfxItemSet& rOutAttrs ); }; diff --git a/sd/uiconfig/sdraw/ui/insertlayer.ui b/sd/uiconfig/sdraw/ui/insertlayer.ui index a53d72d57393..4ff980ea8711 100644 --- a/sd/uiconfig/sdraw/ui/insertlayer.ui +++ b/sd/uiconfig/sdraw/ui/insertlayer.ui @@ -1,7 +1,7 @@ - + False 6 Insert Layer @@ -10,18 +10,17 @@ False vertical - 2 + 12 False - start + end - + gtk-help True True True - False True top @@ -29,16 +28,16 @@ False True 0 + True - + gtk-ok True True True True - False True @@ -48,12 +47,11 @@ - + gtk-cancel True True True - False True @@ -71,199 +69,208 @@ - + True False - 0 - none + True + True + vertical + 6 - + True False - 6 - 12 + 0 + none - + True - True - - True + False + 6 + 12 + + + True + True + + 54 + True + + + + + + + True + False + _Name + True + + + + + False + True + 0 + - - - True - False - <b>_Name</b> - True - True - - - - - False - True - 1 - - - - - True - False - 0 - none - + True False - 6 - 12 + 0 + none - + + True + False + 6 + 12 + + + True + True + + 54 + True + + + + + + True - True - - True + False + _Title + True + + + + + False + True + 1 + - - - True - False - <b>_Title</b> - True - True - - - - - False - True - 2 - - - - - True - False - 0 - none - + True False - 6 - 12 + True + True + 0 + none - + True False + True + True + 6 + 12 - + True True - - True + always + in + + + True + True + True + True + + - - False - True - 0 - - - - - True - False - vertical - - - False - True - 1 - + + + True + False + _Description + True + + + + + + + False + True + 2 + - - + + + _Visible True - False - <b>_Description</b> - True + True + False True + 0 + True + + False + True + 3 + + + + + _Printable + True + True + False + True + 0 + True + + + False + True + 4 + + + + + _Locked + True + True + False + True + 0 + True + + + False + True + 5 + False True - 3 - - - - - _Visible - True - True - False - False - True - 0 - True - - - False - True - 4 - - - - - _Printable - True - True - False - False - True - 0 - True - - - False - True - 5 - - - - - _Locked - True - True - False - False - True - 0 - True - - - False - True - 6 + 1 - help1 - ok1 - cancel1 + help + ok + cancel -- cgit