Kaydet (Commit) e484def6 authored tarafından Caolán McNamara's avatar Caolán McNamara

adapt code to insert layer .ui conversion

Change-Id: I75e83c2e2399f12e7d4cd035856e5ee07a75d494
üst d995207e
......@@ -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 \
......
......@@ -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 \
))
......
......@@ -19,56 +19,46 @@
#include <svl/itemset.hxx>
#include <vcl/layout.hxx>
#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<VclContainer>("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: */
/* -*- 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: */
/* -*- 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 <sfx2/sfx.hrc>
#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: */
......@@ -27,7 +27,7 @@
#include <vcl/fixed.hxx>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <svtools/svmedit.hxx>
#include <vcl/vclmedit.hxx>
#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 );
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment