COPASI API  4.16.103
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
CCopasiPlotSelectionDialog Class Reference

#include <CCopasiPlotSelectionDialog.h>

Inheritance diagram for CCopasiPlotSelectionDialog:
Inheritance graph
[legend]
Collaboration diagram for CCopasiPlotSelectionDialog:
Collaboration graph
[legend]

Public Member Functions

 CCopasiPlotSelectionDialog (QWidget *parent=0, const char *name=0, bool modal=false, Qt::WFlags f=0)
 
void setModel (CModel *model, const CQSimpleSelectionTree::ObjectClasses &classes)
 
void setOutputVectors (std::vector< const CCopasiObject * > *outputVector1, std::vector< const CCopasiObject * > *outputVector2)
 
 ~CCopasiPlotSelectionDialog ()
 

Protected Slots

void slotCancelButtonClicked ()
 
void slotExpertCheckBoxToggled (bool checked)
 
void slotOKButtonClicked ()
 

Protected Member Functions

void setTabOrder ()
 

Protected Attributes

QHBoxLayout * mpButtonBox
 
QCheckBox * mpExpertCheckBox
 
QVBoxLayout * mpMainLayout
 
QSplitter * mpSplitter
 
QLabel * mpXAxisLabel
 
std::vector< const
CCopasiObject * > * 
mpXAxisOutputVector
 
QWidget * mpXAxisSelectionBox
 
CCopasiSelectionWidgetmpXAxisSelectionWidget
 
QLabel * mpYAxisLabel
 
std::vector< const
CCopasiObject * > * 
mpYAxisOutputVector
 
QWidget * mpYAxisSelectionBox
 
CCopasiSelectionWidgetmpYAxisSelectionWidget
 

Detailed Description

Definition at line 36 of file CCopasiPlotSelectionDialog.h.

Constructor & Destructor Documentation

CCopasiPlotSelectionDialog::CCopasiPlotSelectionDialog ( QWidget *  parent = 0,
const char *  name = 0,
bool  modal = false,
Qt::WFlags  f = 0 
)

Definition at line 34 of file CCopasiPlotSelectionDialog.cpp.

References mpButtonBox, mpExpertCheckBox, mpMainLayout, mpSplitter, mpXAxisLabel, mpXAxisOutputVector, mpXAxisSelectionBox, mpXAxisSelectionWidget, mpYAxisLabel, mpYAxisOutputVector, mpYAxisSelectionBox, mpYAxisSelectionWidget, CCopasiSelectionWidget::setOutputVector(), CCopasiSelectionWidget::setSingleSelection(), setTabOrder(), slotCancelButtonClicked(), slotExpertCheckBoxToggled(), and slotOKButtonClicked().

34  :
35  QDialog(parent, f)
36  , mpExpertCheckBox(NULL)
39  , mpSplitter(NULL)
40  , mpButtonBox(NULL)
41  , mpMainLayout(NULL)
42  , mpXAxisLabel(NULL)
43  , mpYAxisLabel(NULL)
44  , mpXAxisSelectionBox(NULL)
45  , mpYAxisSelectionBox(NULL)
46  , mpXAxisOutputVector(NULL)
47  , mpYAxisOutputVector(NULL)
48 {
49  setObjectName(QString::fromUtf8(name));
50  setModal(modal);
51  mpMainLayout = new QVBoxLayout(this);
52 
53  mpSplitter = new QSplitter(this);
54  mpSplitter->setOrientation(Qt::Horizontal);
55  mpMainLayout->addWidget(mpSplitter);
56 
57  mpButtonBox = new QHBoxLayout(this);
58  mpMainLayout->addLayout(mpButtonBox);
59 
60  QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
61  mpButtonBox->addWidget(box);
62 
63  mpExpertCheckBox = new QCheckBox(this);
64  mpExpertCheckBox->setText("Expert Mode");
65  mpExpertCheckBox->setChecked(false);
66  mpButtonBox->addWidget(mpExpertCheckBox);
67 
68  mpXAxisSelectionBox = new QWidget(mpSplitter);
69  QVBoxLayout *vBox1 = new QVBoxLayout(mpXAxisSelectionBox);
70  mpXAxisSelectionBox->setLayout(vBox1);
71  mpXAxisSelectionBox->layout()->setContentsMargins(5, 5, 5, 5);
72 
73  mpYAxisSelectionBox = new QWidget(mpSplitter);
74  QVBoxLayout *vBox2 = new QVBoxLayout(mpYAxisSelectionBox);
75  mpYAxisSelectionBox->setLayout(vBox2);
76  mpYAxisSelectionBox->layout()->setContentsMargins(5, 5, 5, 5);
77 
78  mpXAxisLabel = new QLabel("X-Axis:", mpXAxisSelectionBox);
79  mpXAxisLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
80  mpXAxisSelectionBox->layout()->addWidget(mpXAxisLabel);
81 
82  mpYAxisLabel = new QLabel("Y-Axis:", mpYAxisSelectionBox);
83  mpYAxisLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
84  mpYAxisSelectionBox->layout()->addWidget(mpYAxisLabel);
85 
89  mpXAxisSelectionBox->layout()->addWidget(mpXAxisSelectionWidget);
90 
94  mpYAxisSelectionBox->layout()->addWidget(mpYAxisSelectionWidget);
95 
96  connect(box, SIGNAL(accepted()), this, SLOT(slotOKButtonClicked()));
97  connect(box, SIGNAL(rejected()), this, SLOT(slotCancelButtonClicked()));
98  connect(mpExpertCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotExpertCheckBoxToggled(bool)));
99 
100  setTabOrder();
101 }
std::vector< const CCopasiObject * > * mpYAxisOutputVector
void setSingleSelection(bool singleSelection)
CCopasiSelectionWidget * mpYAxisSelectionWidget
void setOutputVector(std::vector< const CCopasiObject * > *outputVector)
CCopasiSelectionWidget * mpXAxisSelectionWidget
std::vector< const CCopasiObject * > * mpXAxisOutputVector
CCopasiPlotSelectionDialog::~CCopasiPlotSelectionDialog ( )

Definition at line 103 of file CCopasiPlotSelectionDialog.cpp.

104 {}

Member Function Documentation

void CCopasiPlotSelectionDialog::setModel ( CModel model,
const CQSimpleSelectionTree::ObjectClasses classes 
)

Definition at line 171 of file CCopasiPlotSelectionDialog.cpp.

References mpXAxisSelectionWidget, mpYAxisSelectionWidget, and CCopasiSelectionWidget::populateTree().

Referenced by CQPlotSubwidget::addCurve2D().

173 {
174  this->mpXAxisSelectionWidget->populateTree(pModel, classes);
175  this->mpYAxisSelectionWidget->populateTree(pModel, classes);
176 }
void populateTree(const CModel *model, const CQSimpleSelectionTree::ObjectClasses &classes)
CCopasiSelectionWidget * mpYAxisSelectionWidget
CCopasiSelectionWidget * mpXAxisSelectionWidget
void CCopasiPlotSelectionDialog::setOutputVectors ( std::vector< const CCopasiObject * > *  outputVector1,
std::vector< const CCopasiObject * > *  outputVector2 
)

Definition at line 162 of file CCopasiPlotSelectionDialog.cpp.

References mpXAxisOutputVector, mpXAxisSelectionWidget, mpYAxisOutputVector, mpYAxisSelectionWidget, and CCopasiSelectionWidget::setOutputVector().

Referenced by CQPlotSubwidget::addCurve2D().

164 {
165  this->mpXAxisOutputVector = outputVector1;
167  this->mpYAxisOutputVector = outputVector2;
169 }
std::vector< const CCopasiObject * > * mpYAxisOutputVector
CCopasiSelectionWidget * mpYAxisSelectionWidget
void setOutputVector(std::vector< const CCopasiObject * > *outputVector)
CCopasiSelectionWidget * mpXAxisSelectionWidget
std::vector< const CCopasiObject * > * mpXAxisOutputVector
void CCopasiPlotSelectionDialog::setTabOrder ( )
protected

Definition at line 106 of file CCopasiPlotSelectionDialog.cpp.

References mpExpertCheckBox, mpXAxisSelectionWidget, and mpYAxisSelectionWidget.

Referenced by CCopasiPlotSelectionDialog().

107 {
108  QWidget::setTabOrder(this->mpExpertCheckBox, this->mpXAxisSelectionWidget);
109  QWidget::setTabOrder(this->mpXAxisSelectionWidget, this->mpYAxisSelectionWidget);
110  this->mpXAxisSelectionWidget->setFocus();
111 }
CCopasiSelectionWidget * mpYAxisSelectionWidget
CCopasiSelectionWidget * mpXAxisSelectionWidget
void CCopasiPlotSelectionDialog::slotCancelButtonClicked ( )
protectedslot

Definition at line 151 of file CCopasiPlotSelectionDialog.cpp.

Referenced by CCopasiPlotSelectionDialog().

152 {
153  QDialog::done(QDialog::Rejected);
154 }
void CCopasiPlotSelectionDialog::slotExpertCheckBoxToggled ( bool  checked)
protectedslot

Definition at line 156 of file CCopasiPlotSelectionDialog.cpp.

References mpXAxisSelectionWidget, mpYAxisSelectionWidget, and CCopasiSelectionWidget::setExpertMode().

Referenced by CCopasiPlotSelectionDialog().

157 {
158  this->mpXAxisSelectionWidget->setExpertMode(checked);
159  this->mpYAxisSelectionWidget->setExpertMode(checked);
160 }
void setExpertMode(bool expertMode)
CCopasiSelectionWidget * mpYAxisSelectionWidget
CCopasiSelectionWidget * mpXAxisSelectionWidget
void CCopasiPlotSelectionDialog::slotOKButtonClicked ( )
protectedslot

Definition at line 113 of file CCopasiPlotSelectionDialog.cpp.

References CCopasiSelectionWidget::commit(), FROM_UTF8, mpXAxisOutputVector, mpXAxisSelectionWidget, mpYAxisOutputVector, mpYAxisSelectionWidget, and CQMessageBox::question().

Referenced by CCopasiPlotSelectionDialog().

114 {
115  // fill the selection vectors
118  std::string message = "";
119  bool showWarning = false;
120 
121  if (this->mpXAxisOutputVector->empty())
122  {
123  message += "X Axis";
124  showWarning = true;
125  }
126 
127  if (this->mpYAxisOutputVector->empty())
128  {
129  if (showWarning)
130  {
131  message += " and ";
132  }
133 
134  showWarning = true;
135  message += "Y Axis";
136  }
137 
138  if (showWarning)
139  {
140  message = "You did not select anything for the " + message + "!\nDo you want to proceed anyway?";
141 
142  if (CQMessageBox::question(this, "Empty Selection", FROM_UTF8(message), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
143  {
144  return;
145  }
146  }
147 
148  QDialog::done(QDialog::Accepted);
149 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
std::vector< const CCopasiObject * > * mpYAxisOutputVector
CCopasiSelectionWidget * mpYAxisSelectionWidget
CCopasiSelectionWidget * mpXAxisSelectionWidget
std::vector< const CCopasiObject * > * mpXAxisOutputVector
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)

Member Data Documentation

QHBoxLayout* CCopasiPlotSelectionDialog::mpButtonBox
protected

Definition at line 61 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

QCheckBox* CCopasiPlotSelectionDialog::mpExpertCheckBox
protected

Definition at line 57 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog(), and setTabOrder().

QVBoxLayout* CCopasiPlotSelectionDialog::mpMainLayout
protected

Definition at line 62 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

QSplitter* CCopasiPlotSelectionDialog::mpSplitter
protected

Definition at line 60 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

QLabel* CCopasiPlotSelectionDialog::mpXAxisLabel
protected

Definition at line 63 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

std::vector< const CCopasiObject * >* CCopasiPlotSelectionDialog::mpXAxisOutputVector
protected
QWidget* CCopasiPlotSelectionDialog::mpXAxisSelectionBox
protected

Definition at line 65 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

CCopasiSelectionWidget* CCopasiPlotSelectionDialog::mpXAxisSelectionWidget
protected
QLabel* CCopasiPlotSelectionDialog::mpYAxisLabel
protected

Definition at line 64 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

std::vector< const CCopasiObject * >* CCopasiPlotSelectionDialog::mpYAxisOutputVector
protected
QWidget* CCopasiPlotSelectionDialog::mpYAxisSelectionBox
protected

Definition at line 66 of file CCopasiPlotSelectionDialog.h.

Referenced by CCopasiPlotSelectionDialog().

CCopasiSelectionWidget* CCopasiPlotSelectionDialog::mpYAxisSelectionWidget
protected

The documentation for this class was generated from the following files: