1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <svl/itemset.hxx>
22 #include <vcl/layout.hxx>
24 #include "strings.hrc"
26 #include "sdresid.hxx"
27 #include "layeroptionsdlg.hxx"
29 SdInsertLayerDlg::SdInsertLayerDlg( Window
* pWindow
, const SfxItemSet
& rInAttrs
,
30 bool bDeletable
, const OUString
& rStr
)
31 : ModalDialog(pWindow
, "InsertLayerDialog", "modules/sdraw/ui/insertlayer.ui")
32 , mrOutAttrs(rInAttrs
)
36 get(m_pEdtName
, "name");
37 get(m_pEdtTitle
, "title");
38 get(m_pEdtDesc
, "textview");
39 get(m_pCbxVisible
, "visible");
40 get(m_pCbxPrintable
, "printable");
41 get(m_pCbxLocked
, "locked");
43 m_pEdtName
->SetText( ( ( const SdAttrLayerName
& ) mrOutAttrs
.Get( ATTR_LAYER_NAME
) ).GetValue() );
44 m_pEdtTitle
->SetText( ( ( const SdAttrLayerTitle
& ) mrOutAttrs
.Get( ATTR_LAYER_TITLE
) ).GetValue() );
45 m_pEdtDesc
->SetText( ( ( const SdAttrLayerDesc
& ) mrOutAttrs
.Get( ATTR_LAYER_DESC
) ).GetValue() );
46 m_pEdtDesc
->set_height_request(4 * m_pEdtDesc
->GetTextHeight());
47 m_pCbxVisible
->Check( ( ( const SdAttrLayerVisible
& ) mrOutAttrs
.Get( ATTR_LAYER_VISIBLE
) ).GetValue() );
48 m_pCbxPrintable
->Check( ( ( const SdAttrLayerPrintable
& ) mrOutAttrs
.Get( ATTR_LAYER_PRINTABLE
) ).GetValue() );
49 m_pCbxLocked
->Check( ( ( const SdAttrLayerLocked
& ) mrOutAttrs
.Get( ATTR_LAYER_LOCKED
) ).GetValue() );
51 get
<VclContainer
>("nameframe")->Enable(bDeletable
);
54 void SdInsertLayerDlg::GetAttr( SfxItemSet
& rAttrs
)
56 rAttrs
.Put( SdAttrLayerName( m_pEdtName
->GetText() ) );
57 rAttrs
.Put( SdAttrLayerTitle( m_pEdtTitle
->GetText() ) );
58 rAttrs
.Put( SdAttrLayerDesc( m_pEdtDesc
->GetText() ) );
59 rAttrs
.Put( SdAttrLayerVisible( m_pCbxVisible
->IsChecked() ) );
60 rAttrs
.Put( SdAttrLayerPrintable( m_pCbxPrintable
->IsChecked() ) );
61 rAttrs
.Put( SdAttrLayerLocked( m_pCbxLocked
->IsChecked() ) );
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */