6 #include <QtGui/QPainter>
48 mpEditTitle->setText(
"");
56 mpBoxType->setCurrentIndex(0);
57 mpBoxLineSubType->setCurrentIndex(0);
60 mpCheckBefore->setChecked(
false);
61 mpCheckDuring->setChecked(
true);
62 mpCheckAfter->setChecked(
false);
76 assert(pDataModel != NULL);
94 if (!(tmp = curve->
getValue(
"Line type").
pVOID))
return false;
97 mpBoxType->setCurrentIndex(linetype);
102 if (linetype == 0 || linetype == 3)
104 if (!(tmp = curve->
getValue(
"Line subtype").
pVOID))
return false;
106 mpBoxLineSubType->setCurrentIndex(*(
unsigned C_INT32*)tmp);
109 if (!(tmp = curve->
getValue(
"Line width").
pVOID))
return false;
111 mpSpinBoxWidth->setValue(*(
C_FLOAT64*)tmp);
117 if (!(tmp = curve->
getValue(
"Line width").
pVOID))
return false;
119 mpSpinBoxWidth->setValue(*(
C_FLOAT64*)tmp);
123 if (linetype == 2 || linetype == 3)
125 if (!(tmp = curve->
getValue(
"Symbol subtype").
pVOID))
return false;
127 mpBoxSymbolSubType->setCurrentIndex(*(
unsigned C_INT32*)tmp);
132 mpBoxColor->addItem(
"auto");
139 QPainter painter(&pix);
143 painter.setPen(Qt::gray);
144 painter.setBrush(QBrush(color));
145 painter.drawRect(0, 0, 12, 12);
156 std::string colorstr = *(std::string*)tmp;
159 if ((tmpindex = mpBoxColor->findText(colorstr.c_str())) != -1)
160 mpBoxColor->setCurrentIndex(tmpindex);
163 QColor color = QColor(colorstr.c_str());
165 QPainter painter(&pix);
169 painter.setPen(Qt::gray);
170 painter.setBrush(QBrush(color));
171 painter.drawRect(0, 0, 12, 12);
177 mpBoxColor->addItem(icon, colorstr.c_str());
178 mpBoxColor->setCurrentIndex(mpBoxColor->count() - 1);
195 std::string title =
TO_UTF8(mpEditTitle->text());
196 unsigned C_INT32 lineType = (
unsigned C_INT32)mpBoxType->currentIndex();
197 unsigned C_INT32 lineSubType = (
unsigned C_INT32)mpBoxLineSubType->currentIndex();
198 unsigned C_INT32 symbolSubType = (
unsigned C_INT32)mpBoxSymbolSubType->currentIndex();
200 std::string color =
TO_UTF8(mpBoxColor->currentText());
213 bool thingsChanged =
false;
215 if (original != NULL)
219 thingsChanged =
true;
222 thingsChanged =
true;
224 if (thingsChanged || *original->
getValue(
"Line type").
pUINT != lineType)
225 thingsChanged =
true;
227 if (thingsChanged || *original->
getValue(
"Line subtype").
pUINT != lineSubType)
228 thingsChanged =
true;
230 if (thingsChanged || *original->
getValue(
"Symbol subtype").
pUINT != symbolSubType)
231 thingsChanged =
true;
233 if (thingsChanged || *original->
getValue(
"Line width").
pDOUBLE != lineWidth)
234 thingsChanged =
true;
237 thingsChanged =
true;
239 if (thingsChanged || original->
getActivity() != Activity)
240 thingsChanged =
true;
242 if (thingsChanged || original->
getChannels().size() != 2)
243 thingsChanged =
true;
245 if (thingsChanged || original->
getChannels()[0] != xName)
246 thingsChanged =
true;
248 if (thingsChanged || original->
getChannels()[1] != yName)
249 thingsChanged =
true;
251 else thingsChanged =
true;
264 curve->
setValue(
"Line type", lineType);
265 curve->
setValue(
"Line subtype", lineSubType);
266 curve->
setValue(
"Symbol subtype", symbolSubType);
267 curve->
setValue(
"Line width", lineWidth);
297 mpEditX->setText(
"");
320 mpEditY->setText(
"");
325 if (linetype == 0 || linetype == 3 || linetype == 1)
327 mpBoxLineSubType->setEnabled(linetype != 1);
328 mpSpinBoxWidth->setEnabled(
true);
332 mpBoxLineSubType->setEnabled(linetype == 1);
333 mpSpinBoxWidth->setEnabled(
false);
337 if (linetype == 2 || linetype == 3)
339 mpBoxSymbolSubType->setEnabled(
true);
343 mpBoxSymbolSubType->setEnabled(
false);
352 mpEditTitle->setEnabled(!mode);
353 mpEditX->setEnabled(!mode);
354 mpEditY->setEnabled(!mode);
355 mpBtnX->setEnabled(!mode);
356 mpBtnY->setEnabled(!mode);
CCopasiObject * getDataObject(const CCopasiObjectName &CN) const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
static size_t getNumCopasiColors()
static QColor getColor(std::string colorstr, size_t colorindex)
virtual CCopasiObjectName getCN() const
static std::string getCopasiColorStr(size_t index)
std::vector< CPlotDataChannelSpec > & getChannels()
void setActivity(const COutputInterface::Activity &activity)
static const QIcon & icon(const IconID &id)
const CPlotItem::Type & getType() const
bool setValue(const std::string &name, const CType &value)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
const COutputInterface::Activity & getActivity() const
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
const CCopasiParameter::Value & getValue(const std::string &name) const
const std::string & getTitle() const
void setTitle(const std::string &title)
static const CCopasiObject * getObjectSingle(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const CCopasiObject *pCurrentObject=NULL)