All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BasicFillDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/se/BasicFillDialog.cpp
22 
23  \brief A dialog used to build a basic fill element.
24 */
25 
26 // TerraLib
27 #include "BasicFillDialog.h"
28 #include "BasicFillWidget.h"
29 #include "ui_BasicFillDialogForm.h"
30 
31 te::qt::widgets::BasicFillDialog::BasicFillDialog(QWidget* parent, Qt::WindowFlags f)
32  : QDialog(parent, f),
33  m_ui(new Ui::BasicFillDialogForm)
34 {
35  m_ui->setupUi(this);
36 
37  // Fill Widget
39 
40  // Adjusting...
41  QGridLayout* layout = new QGridLayout(m_ui->m_fillWidgetFrame);
42  layout->addWidget(m_fillWidget);
43 }
44 
46 {
47 }
48 
49 te::se::Fill* te::qt::widgets::BasicFillDialog::getFill(const te::se::Fill* initial, QWidget* parent, const QString& title)
50 {
51  BasicFillDialog dlg(parent);
52 
53  if(!title.isEmpty())
54  dlg.setWindowTitle(title);
55 
56  if(initial)
57  dlg.m_fillWidget->setFill(initial);
58 
59  if(dlg.exec() == QDialog::Accepted)
60  return dlg.getFill();
61 
62  return 0;
63 }
64 
66 {
67  return m_fillWidget->getFill();
68 }
A widget used to build a basic fill element.
static te::se::Fill * getFill(const te::se::Fill *initial, QWidget *parent=0, const QString &title="")
Pops up a modal basic fill dialog with the given window title, lets the user configure the fill...
A dialog used to build a basic fill element.
std::auto_ptr< Ui::BasicFillDialogForm > m_ui
Dialog form.
A dialog used to build a basic fill element. If you want to use this dialog, you can use commands lik...
A widget used to build a basic fill element.
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
bool setFill(const te::se::Fill *fill)
Sets a fill element to this widget.
BasicFillDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic fill dialog which is a child of parent, with widget flags set to f...
te::se::Fill * getFill() const
Gets the configured fill element.
te::qt::widgets::BasicFillWidget * m_fillWidget
Basic Fill Widget used to configure the fill element.