Ejemplo n.º 1
0
CVarToggleWidget::CVarToggleWidget(char const *cvarPath, int cvarValueMask,
                                   String const &downText, String const &upText)
    : ButtonWidget()
    , d(new Impl)
{
    setFont(MENU_FONT1);
    setColor(MENU_COLOR3);
    setAction(Modified,    CVarToggleWidget_UpdateCVar);
    setAction(FocusGained, Hu_MenuDefaultFocusAction);

    d->cvarPath      = cvarPath;
    d->cvarValueMask = cvarValueMask;
    setDownText(downText);
    setUpText(upText);
}
Ejemplo n.º 2
0
RightPanel::RightPanel(QWidget *widget):QWidget(widget) {
	// TODO Auto-generated constructor stub
	inputusertextDialog = NULL;
	uid = QString("");
	uid_index = -1;
	selectFlag = false;
	mapcanvasMPP = 0;			// meter per 1 pixcel
	objectpanelMPP = 0;			// meter per 1 pixcel

	// Object Panel define
	selectButton = new QToolButton;
	selectButton->setIcon(QIcon(":/images/object_select.png"));
	selectButton->setToolTip(QString("Selection"));
	selectButton->adjustSize();
	connect(selectButton, SIGNAL(clicked()), this, SLOT(setDownSelect()));

	lineButton = new QToolButton;
	lineButton->setIcon(QIcon(":/images/object_line.png"));
	lineButton->setToolTip(QString("Line"));
	lineButton->adjustSize();
	connect(lineButton, SIGNAL(clicked()), this, SLOT(setDownLine()));

	circleButton = new QToolButton;
	circleButton->setIcon(QIcon(":/images/object_circle.png"));
	circleButton->setToolTip(QString("Circle"));
	circleButton->adjustSize();
	connect(circleButton, SIGNAL(clicked()), this, SLOT(setDownCircle()));

	eclipseButton = new QToolButton;
	eclipseButton->setIcon(QIcon(":/images/object_ellipse.png"));
	eclipseButton->setToolTip(QString("Eclipse"));
	eclipseButton->adjustSize();
	connect(eclipseButton, SIGNAL(clicked()), this, SLOT(setDownEllipse()));

	rectangleButton = new QToolButton;
	rectangleButton->setIcon(QIcon(":/images/object_rectangle.png"));
	rectangleButton->setToolTip(QString("Rectangle"));
	rectangleButton->adjustSize();
	connect(rectangleButton, SIGNAL(clicked()), this, SLOT(setDownRectangle()));

	polygonButton = new QToolButton;
	polygonButton->setIcon(QIcon(":/images/object_polygon.png"));
	polygonButton->setToolTip(QString("Polygon"));
	polygonButton->adjustSize();
	connect(polygonButton, SIGNAL(clicked()), this, SLOT(setDownPolygon()));

	polylineButton = new QToolButton;
	polylineButton->setIcon(QIcon(":/images/object_polyline.png"));
	polylineButton->setToolTip(QString("Polyline"));
	polylineButton->adjustSize();
	connect(polylineButton, SIGNAL(clicked()), this, SLOT(setDownPolyline()));

	textButton = new QToolButton;
	textButton->setIcon(QIcon(":/images/object_text.png"));
	textButton->setToolTip(QString("Text"));
	textButton->adjustSize();
	connect(textButton, SIGNAL(clicked()), this, SLOT(setDownText()));

	arcButton = new QToolButton;
	arcButton->setIcon(QIcon(":/images/object_arc.png"));
	arcButton->setToolTip(QString("Arc"));
	arcButton->adjustSize();
	connect(arcButton, SIGNAL(clicked()), this, SLOT(setDownArc()));

	symbolButton = new QToolButton;
	symbolButton->setIcon(QIcon(":/images/object_symbol.png"));
	symbolButton->setToolTip(QString("Symbol"));
	symbolButton->adjustSize();
	connect(symbolButton, SIGNAL(clicked()), this, SLOT(setDownSymbol()));

	QGroupBox* groupboxDrawObject = new QGroupBox("Draw Object");
	QVBoxLayout* vb1 = new QVBoxLayout;
	QGridLayout* grid = new QGridLayout;
	grid->addWidget(selectButton,       0, 0);
	grid->addWidget(lineButton,         0, 1);
	grid->addWidget(circleButton,       0, 2);
	grid->addWidget(eclipseButton,      0, 3);
	grid->addWidget(arcButton,          0, 4);

	grid->addWidget(rectangleButton,    1, 0);
	grid->addWidget(polygonButton,      1, 1);
	grid->addWidget(polylineButton,     1, 2);
	grid->addWidget(textButton,         1, 3);
	grid->addWidget(symbolButton,       1, 4);

	manualButton = new QPushButton(tr("&Manual Coord. Input"));
	connect(manualButton, SIGNAL(clicked()), this, SLOT(setDownManual()));
	QHBoxLayout* hb1 = new QHBoxLayout;
	hb1->addStretch();
	hb1->addWidget(manualButton);
	hb1->addStretch();
	vb1->addLayout(grid);
	vb1->addLayout(hb1);

	groupboxDrawObject->setLayout(vb1);

	// Line Properties
	QLabel* labelLineType = new QLabel(tr("Type"));
	QLabel* labelLineWidth = new QLabel(tr("Width"));
	QLabel* labelLineColor = new QLabel(tr("Color"));

	comboLineType = new LineTypeCombo;
	connect(comboLineType, SIGNAL(currentIndexChanged(int)), this, SLOT(setLineType(int)));

	spinLineWidth = new QSpinBox;
	spinLineWidth->setValue(1);
	spinLineWidth->setRange(1, 5);
	connect(spinLineWidth, SIGNAL(valueChanged(int)), this, SLOT(setLineWidth(int)));

	rgbLineColor = new ColorRgbPicker;
	connect(rgbLineColor, SIGNAL(changed()), this, SLOT(setLineColor()));

	QGridLayout* gridLine = new QGridLayout;

	gridLine->addWidget(labelLineType, 0, 0);
	gridLine->addWidget(comboLineType, 0, 1);

	gridLine->addWidget(labelLineWidth, 1, 0);
	gridLine->addWidget(spinLineWidth, 1, 1);

	gridLine->addWidget(labelLineColor, 2, 0);
	gridLine->addWidget(rgbLineColor, 2, 1);

	QGroupBox* groupboxLineProperties = new QGroupBox("Line Properties");
	groupboxLineProperties->setLayout(gridLine);

	// Fill Properties
	QLabel* labelLineFillColor = new QLabel(tr("Fill Color"));
	QLabel* labelLinePattern = new QLabel(tr("Pattern"));

	rgbLineFillColor = new ColorRgbPicker;
	connect(rgbLineFillColor, SIGNAL(changed()), this, SLOT(setLineFillColor()));

	comboLinePattern = new FillPatternCombo;
	connect(comboLinePattern, SIGNAL(currentIndexChanged(int)), this, SLOT(setFillPattern(int)));

	QGridLayout* gridFill = new QGridLayout;
	gridFill->addWidget(labelLineFillColor, 0, 0);
	gridFill->addWidget(rgbLineFillColor, 0, 1);

	gridFill->addWidget(labelLinePattern, 1, 0);
	gridFill->addWidget(comboLinePattern, 1, 1);

	QGroupBox* groupboxFillProperties = new QGroupBox("Fill Properties");
	groupboxFillProperties->setLayout(gridFill);

	// Text Properties
	QLabel* labelTextFont = new QLabel(tr("Font"));
	QLabel* labelTextSize = new QLabel(tr("Size"));
	QLabel* labelTextColor = new QLabel(tr("Color"));

	comboTextFont = new QFontComboBox;
	comboTextFont->setFontFilters(QFontComboBox::ScalableFonts);
	comboTextFont->setCurrentFont(QFont("Courier"));
	connect(comboTextFont, SIGNAL(currentFontChanged(QFont)), this, SLOT(setFontName(QFont)));

	spinTextSize = new QSpinBox;
	spinTextSize->setValue(10);
	spinTextSize->setRange(8, 30);
	connect(spinTextSize, SIGNAL(valueChanged(int)), this, SLOT(setTextSize(int)));

	rgbTextColor = new ColorRgbPicker;
	connect(rgbTextColor, SIGNAL(changed()), this, SLOT(setTextColor()));

	QGridLayout* gridText = new QGridLayout;

	gridText->addWidget(labelTextFont,   0, 0);
	gridText->addWidget(comboTextFont,   0, 1);
	gridText->addWidget(labelTextSize,   1, 0);
	gridText->addWidget(spinTextSize,    1, 1);
	gridText->addWidget(labelTextColor,  2, 0);
	gridText->addWidget(rgbTextColor,    2, 1);

	QGroupBox* groupboxTextProperties = new QGroupBox("Text Properties");
	groupboxTextProperties->setLayout(gridText);

	// Usermap id List
	QGroupBox* groupboxUserMapId = new QGroupBox("User Map Id");
	listUserMapId = new CheckListBox;
	listUserMapId->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
	connect(listUserMapId, SIGNAL(currentRowChanged(QString)), this, SLOT(uidChanged(QString)));

	// Usermap delete changename button
	buttonUserMapIdDelete = new QPushButton(tr("&Delete"));
	connect(buttonUserMapIdDelete, SIGNAL(clicked()), this, SLOT(deleteUid()));

	buttonUserIdChange = new QPushButton(tr("&Change Id name"));
	connect(buttonUserIdChange, SIGNAL(clicked()), this, SLOT(changeUidName()));

	QVBoxLayout* umiVLayout = new QVBoxLayout;
	QHBoxLayout* umiHLayout = new QHBoxLayout;
	umiHLayout->addStretch();
	umiHLayout->addWidget(buttonUserMapIdDelete);
	umiHLayout->addWidget(buttonUserIdChange);
	umiHLayout->addStretch();

	umiVLayout->addWidget(listUserMapId);
	umiVLayout->addLayout(umiHLayout);
	groupboxUserMapId->setLayout(umiVLayout);

	// Zoom
	groupboxZoom = new QGroupBox("Zoom");
	groupboxZoom->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);

	spinBoxZoom = new QSpinBox();
	spinBoxZoom->setRange(10, 2000);		// MPP

	hSliderZoom = new QSlider();
	hSliderZoom->setOrientation(Qt::Horizontal);
	hSliderZoom->setRange(10, 2000);
	hSliderZoom->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);

	connect(spinBoxZoom, SIGNAL(valueChanged(int)), hSliderZoom, SLOT(setValue(int)));
	connect(hSliderZoom, SIGNAL(valueChanged(int)), spinBoxZoom, SLOT(setValue(int)));
	connect(spinBoxZoom, SIGNAL(valueChanged(int)), this,        SLOT(changeZoom()));
	connect(hSliderZoom, SIGNAL(valueChanged(int)), this,        SLOT(changeZoom()));

	zoomHLayout = new QHBoxLayout;
	zoomHLayout->addWidget(hSliderZoom);
	zoomHLayout->addWidget(spinBoxZoom);
	groupboxZoom->setLayout(zoomHLayout);

	// Main Setting
	QVBoxLayout* mainLayout = new QVBoxLayout;
	mainLayout->addWidget(groupboxDrawObject);
	mainLayout->addWidget(groupboxLineProperties);
	mainLayout->addWidget(groupboxFillProperties);
	mainLayout->addWidget(groupboxTextProperties);
	mainLayout->addWidget(groupboxUserMapId);
	mainLayout->addWidget(groupboxZoom);
	mainLayout->addStretch();

	setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
	setLayout(mainLayout);

	property = new LayerProperty;
	nowDrawType = Select;

	setDown(Select);
}