1 #include "CubePlotCurveConfigureDialog.h" 6 #include <QColorDialog> 11 #include <QPushButton> 34 connect( parent, SIGNAL( plotChanged() ),
35 this, SLOT( updateCurvesList() ) );
42 QGridLayout *optionsLayout =
new QGridLayout;
47 QLabel *curvesLabel =
new QLabel(
"Curves: ");
50 this, SLOT( updateComboIndex(
int) ) );
51 optionsLayout->addWidget(curvesLabel, row, 0);
56 QLabel *nameLabel =
new QLabel(
"Curve Name: ");
58 optionsLayout->addWidget(nameLabel, row, 0);
62 QLabel *colorLabel =
new QLabel(
"Color: ");
67 optionsLayout->addWidget(colorLabel, row, 0);
71 QLabel *styleLabel =
new QLabel(
"Style:");
73 m_styleCombo->addItem(
"No Line", static_cast<int>(Qt::NoPen));
74 m_styleCombo->addItem(
"Solid Line", static_cast<int>(Qt::SolidLine));
75 m_styleCombo->addItem(
"Dash Line", static_cast<int>(Qt::DashLine));
76 m_styleCombo->addItem(
"Dot Line", static_cast<int>(Qt::DotLine));
77 m_styleCombo->addItem(
"Dash Dot Line", static_cast<int>(Qt::DashDotLine));
78 m_styleCombo->addItem(
"Dash Dot Dot Line", static_cast<int>(Qt::DashDotDotLine));
79 optionsLayout->addWidget(styleLabel, row, 0);
83 QLabel *sizeLabel =
new QLabel(
"Size:");
89 optionsLayout->addWidget(sizeLabel, row, 0);
93 QLabel *symbolLabel =
new QLabel(
"Symbol:");
102 m_symbolCombo->addItem(
"Down Facing Triangle", QwtSymbol::UTriangle);
103 m_symbolCombo->addItem(
"Up Facing Triangle", QwtSymbol::DTriangle);
104 m_symbolCombo->addItem(
"Left Facing Triangle", QwtSymbol::RTriangle);
105 m_symbolCombo->addItem(
"Right Facing Triangle", QwtSymbol::LTriangle);
108 m_symbolCombo->addItem(
"Diagonal Cross (X)", QwtSymbol::XCross);
109 m_symbolCombo->addItem(
"Eight-Pointed Star", QwtSymbol::Star1);
114 m_symbolCombo->addItem(
"Six-Pointed Star", QwtSymbol::Star2);
116 optionsLayout->addWidget(symbolLabel, row, 0);
120 QHBoxLayout *applyButtonsLayout =
new QHBoxLayout;
121 applyButtonsLayout->addStretch();
123 QPushButton *okay =
new QPushButton(
"&Ok");
124 okay->setIcon( QIcon::fromTheme(
"dialog-ok") );
125 connect( okay, SIGNAL( clicked() ),
127 connect( okay, SIGNAL( clicked() ),
128 this, SLOT( close() ) );
129 applyButtonsLayout->addWidget(okay);
131 QPushButton *apply =
new QPushButton(
"&Apply");
132 apply->setIcon( QIcon::fromTheme(
"dialog-ok-apply") );
133 connect( apply, SIGNAL( clicked() ),
135 applyButtonsLayout->addWidget(apply);
137 QPushButton *cancel =
new QPushButton(
"&Cancel");
138 cancel->setIcon( QIcon::fromTheme(
"dialog-cancel") );
139 connect( cancel, SIGNAL( clicked() ),
140 this, SLOT( close() ) );
141 applyButtonsLayout->addWidget(cancel);
144 optionsHolder->setLayout(optionsLayout);
147 applyButtonsHolder->setLayout(applyButtonsLayout);
149 QVBoxLayout *mainLayout =
new QVBoxLayout;
150 mainLayout->addWidget(optionsHolder);
151 mainLayout->addWidget(applyButtonsHolder);
153 setLayout(mainLayout);
183 curvePen.setColor( colorPalette.color(QPalette::Button) );
186 curvePen.setWidth(penWidth);
188 Qt::PenStyle penStyle = (Qt::PenStyle)
m_styleCombo->itemData(
190 curvePen.setStyle(penStyle);
193 m_plotCurve->setColor( colorPalette.color(QPalette::Button) );
196 QwtSymbol::Style symbolStyle = (QwtSymbol::Style)
m_symbolCombo->itemData(
222 setWindowTitle(
"Configure " +
m_plotCurve->title().text() );
240 QPalette colorPalette;
241 colorPalette.setColor( QPalette::Button,
m_plotCurve->pen().color() );
271 void CubePlotCurveConfigureDialog::updateComboIndex(
int selected) {
277 void CubePlotCurveConfigureDialog::updateCurvesList() {
301 QColor newColor = QColorDialog::getColor(
302 colorPalette.color(QPalette::Button),
this);
304 if( newColor.isValid() ) {
305 colorPalette.setColor(QPalette::Button, newColor);
int toInt(const QString &string)
Global function to convert from a string to an integer.
This error is for when a programmer made an API call that was illegal.
This is a plot curve with information relating it to a particular cube or region of a cube...
#define _FILEINFO_
Macro for the filename and line number.
Namespace for ISIS/Bullet specific routines.