1
/***************************************************************************
2
* Copyright (C) 2003 by Tim Sutton *
5
* This is a plugin generated from the QGIS plugin template *
7
* This program is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
***************************************************************************/
12
#include "plugingui.h"
13
#include <qcombobox.h>
15
#include <qcheckbox.h>
17
QgsScaleBarPluginGui::QgsScaleBarPluginGui() : QgsScaleBarPluginGuiBase()
22
QgsScaleBarPluginGui::QgsScaleBarPluginGui( QWidget* parent , const char* name , bool modal , WFlags fl )
23
: QgsScaleBarPluginGuiBase( parent, name, modal, fl )
27
QgsScaleBarPluginGui::~QgsScaleBarPluginGui()
31
void QgsScaleBarPluginGui::pbnOK_clicked()
34
emit changePlacement(cboPlacement->currentText());
35
emit changePreferredSize(spnSize->value());
36
emit changeSnapping(chkSnapping->isChecked());
37
emit changeEnabled(chkEnable->isChecked());
38
emit changeStyle(cboStyle->currentText());
39
emit changeColour(frameColour->paletteBackgroundColor());
43
void QgsScaleBarPluginGui::pbnCancel_clicked()
48
void QgsScaleBarPluginGui::setPlacement(QString thePlacementQString)
50
cboPlacement->setCurrentText(tr(thePlacementQString));
53
void QgsScaleBarPluginGui::setPreferredSize(int thePreferredSize)
55
spnSize->setValue(thePreferredSize);
58
void QgsScaleBarPluginGui::setSnapping(bool theSnapping)
60
chkSnapping->setChecked(theSnapping);
62
void QgsScaleBarPluginGui::setEnabled(bool theBool)
64
chkEnable->setChecked(theBool);
67
void QgsScaleBarPluginGui::setStyle(QString theStyleQString)
69
if ((tr(theStyleQString))==tr("Tick Down"))
71
cboStyle->setCurrentItem(0);
73
else if ((tr(theStyleQString))==tr("Tick Up"))
75
cboStyle->setCurrentItem(1);
77
else if ((tr(theStyleQString))==tr("Box"))
79
cboStyle->setCurrentItem(2);
81
else if ((tr(theStyleQString))==tr("Bar"))
83
cboStyle->setCurrentItem(3);
87
void QgsScaleBarPluginGui::setColour(QColor theQColor)
89
frameColour->setPaletteBackgroundColor(theQColor);