1
/****************************************************************************
3
** This file is part of the LibreCAD project, a 2D CAD program
5
** Copyright (C) 2011 Rallaz (rallazz@gmail.com)
8
** This file is free software; you can redistribute it and/or modify
9
** it under the terms of the GNU General Public License as published by
10
** the Free Software Foundation; either version 2 of the License, or
11
** (at your option) any later version.
13
** This program is distributed in the hope that it will be useful,
14
** but WITHOUT ANY WARRANTY; without even the implied warranty of
15
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
** GNU General Public License for more details.
18
** You should have received a copy of the GNU General Public License
19
** along with this program; if not, write to the Free Software
20
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
** This copyright notice MUST APPEAR in all copies of the script!
24
**********************************************************************/
25
#include "qg_dlgpolyline.h"
27
#include "rs_polyline.h"
28
#include "rs_graphic.h"
29
/*#include "rs_layer.h"
30
#include "qg_widgetpen.h"
31
#include "qg_layerbox.h"*/
34
* Constructs a QG_DlgPolyline as a child of 'parent', with the
35
* name 'name' and widget flags set to 'f'.
37
* The dialog will by default be modeless, unless you set 'modal' to
38
* true to construct a modal dialog.
40
QG_DlgPolyline::QG_DlgPolyline(QWidget* parent, bool modal, Qt::WindowFlags fl)
49
* Destroys the object and frees any allocated resources
51
QG_DlgPolyline::~QG_DlgPolyline()
53
// no need to delete child widgets, Qt does it all for us
57
* Sets the strings of the subwidgets using the current
60
void QG_DlgPolyline::languageChange()
65
void QG_DlgPolyline::setPolyline(RS_Polyline& e) {
67
//pen = spline->getPen();
68
wPen->setPen(polyline->getPen(false), true, false, "Pen");
69
RS_Graphic* graphic = polyline->getGraphic();
71
cbLayer->init(*(graphic->getLayerList()), false, false);
73
RS_Layer* lay = polyline->getLayer(false);
75
cbLayer->setLayer(*lay);
78
cbClosed->setChecked(polyline->isClosed());
83
void QG_DlgPolyline::updatePolyline() {
84
polyline->setClosed(cbClosed->isChecked(), 0.0);
85
polyline->setPen(wPen->getPen());
86
polyline->setLayer(cbLayer->currentText());