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

#include <CPlotSelectionDialog.h>

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

Public Member Functions

 CPlotSelectionDialog (QWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0)
 
void setModel (CModel *model)
 
void setOutputVectors (std::vector< CCopasiObject * > *outputVector1, std::vector< CCopasiObject * > *outputVector2)
 
virtual ~CPlotSelectionDialog ()
 

Protected Slots

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

Protected Member Functions

void setTabOrder ()
 

Protected Attributes

QHBox * mpButtonBox
 
QPushButton * mpCancelButton
 
QCheckBox * mpExpertCheckBox
 
QVBoxLayout * mpMainLayout
 
QPushButton * mpOKButton
 
QSplitter * mpSplitter
 
QLabel * mpXAxisLabel
 
ObjectBrowserWidgetmpXAxisObjectBrowserWidget
 
std::vector< CCopasiObject * > * mpXAxisOutputVector
 
QVBox * mpXAxisSelectionBox
 
QWidget * mpXAxisSelectionWidget
 
SimpleSelectionWidget * mpXAxisSimpleSelectionWidget
 
std::vector< CCopasiObject * > * mpXAxisTmpVector
 
QLabel * mpYAxisLabel
 
ObjectBrowserWidgetmpYAxisObjectBrowserWidget
 
std::vector< CCopasiObject * > * mpYAxisOutputVector
 
QVBox * mpYAxisSelectionBox
 
QWidget * mpYAxisSelectionWidget
 
SimpleSelectionWidget * mpYAxisSimpleSelectionWidget
 
std::vector< CCopasiObject * > * mpYAxisTmpVector
 

Detailed Description

Definition at line 37 of file CPlotSelectionDialog.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file CPlotSelectionDialog.cpp.

References mpButtonBox, mpCancelButton, mpExpertCheckBox, mpMainLayout, mpOKButton, mpSplitter, mpXAxisLabel, mpXAxisSelectionBox, mpXAxisSelectionWidget, mpXAxisSimpleSelectionWidget, mpXAxisTmpVector, mpYAxisLabel, mpYAxisSelectionBox, mpYAxisSelectionWidget, mpYAxisSimpleSelectionWidget, mpYAxisTmpVector, setTabOrder(), slotCancelButtonClicked(), slotExpertCheckBoxToggled(), and slotOKButtonClicked().

28  :
29  QDialog(parent, name, modal, f)
30  , mpOKButton(NULL)
31  , mpCancelButton(NULL)
32  , 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  , mpXAxisTmpVector(new std::vector<CCopasiObject*>())
49  , mpYAxisTmpVector(new std::vector<CCopasiObject*>())
50 {
51  this->mpMainLayout = new QVBoxLayout(this);
52  this->mpMainLayout->setAutoAdd(true);
53 
54  this->mpSplitter = new QSplitter(this);
55  this->mpSplitter->setOrientation(Qt::Horizontal);
56 
57  this->mpButtonBox = new QHBox(this);
58  this->mpButtonBox->layout()->setAutoAdd(false);
59 
60  ((QHBoxLayout*)this->mpButtonBox->layout())->addStretch();
61 
62  this->mpOKButton = new QPushButton(this->mpButtonBox);
63  this->mpOKButton->setText("OK");
64  this->mpOKButton->setDefault(true);
65  this->mpButtonBox->layout()->add(this->mpOKButton);
66 
67  this->mpCancelButton = new QPushButton(this->mpButtonBox);
68  this->mpCancelButton->setText("Cancel");
69  this->mpButtonBox->layout()->add(this->mpCancelButton);
70 
71  this->mpExpertCheckBox = new QCheckBox(this->mpButtonBox);
72  this->mpExpertCheckBox->setText("Expert Mode");
73  this->mpExpertCheckBox->setChecked(false);
74  this->mpButtonBox->layout()->add(this->mpExpertCheckBox);
75 
76  ((QHBoxLayout*)this->mpButtonBox->layout())->addStretch();
77 
78  this->mpXAxisSelectionBox = new QVBox(this->mpSplitter);
79  this->mpXAxisSelectionBox->layout()->setMargin(5);
80  this->mpXAxisSelectionBox->layout()->setAutoAdd(false);
81 
82  this->mpYAxisSelectionBox = new QVBox(this->mpSplitter);
83  this->mpYAxisSelectionBox->layout()->setMargin(5);
84  this->mpYAxisSelectionBox->layout()->setAutoAdd(false);
85 
86  this->mpXAxisLabel = new QLabel("X-Axis:", this->mpXAxisSelectionBox);
87  this->mpXAxisLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
88  this->mpXAxisSelectionBox->layout()->add(this->mpXAxisLabel);
89 
90  this->mpYAxisLabel = new QLabel("Y-Axis:", this->mpYAxisSelectionBox);
91  this->mpYAxisLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
92  this->mpYAxisSelectionBox->layout()->add(this->mpYAxisLabel);
93 
94  this->mpXAxisSimpleSelectionWidget = new SimpleSelectionWidget(this->mpXAxisSelectionBox);
96  this->mpXAxisSimpleSelectionWidget->setSingleSelection(true);
97  this->mpXAxisSimpleSelectionWidget->setOutputVector(this->mpXAxisTmpVector);
98  this->mpXAxisSelectionBox->layout()->add(this->mpXAxisSelectionWidget);
99 
100  this->mpYAxisSimpleSelectionWidget = new SimpleSelectionWidget(this->mpYAxisSelectionBox);
102  this->mpYAxisSimpleSelectionWidget->setOutputVector(this->mpYAxisTmpVector);
103  this->mpYAxisSelectionBox->layout()->add(this->mpYAxisSelectionWidget);
104 
105  connect(this->mpOKButton, SIGNAL(clicked()), this, SLOT(slotOKButtonClicked()));
106  connect(this->mpCancelButton, SIGNAL(clicked()), this, SLOT(slotCancelButtonClicked()));
107  connect(this->mpExpertCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotExpertCheckBoxToggled(bool)));
108 
109  this->setTabOrder();
110 }
SimpleSelectionWidget * mpYAxisSimpleSelectionWidget
void slotExpertCheckBoxToggled(bool checked)
std::vector< CCopasiObject * > * mpXAxisTmpVector
ObjectBrowserWidget * mpXAxisObjectBrowserWidget
std::vector< CCopasiObject * > * mpYAxisTmpVector
std::vector< CCopasiObject * > * mpXAxisOutputVector
ObjectBrowserWidget * mpYAxisObjectBrowserWidget
SimpleSelectionWidget * mpXAxisSimpleSelectionWidget
std::vector< CCopasiObject * > * mpYAxisOutputVector
CPlotSelectionDialog::~CPlotSelectionDialog ( )
virtual

Definition at line 112 of file CPlotSelectionDialog.cpp.

References mpButtonBox, mpCancelButton, mpExpertCheckBox, mpMainLayout, mpOKButton, mpSplitter, mpXAxisLabel, mpXAxisObjectBrowserWidget, mpXAxisSelectionBox, mpXAxisSimpleSelectionWidget, mpXAxisTmpVector, mpYAxisLabel, mpYAxisObjectBrowserWidget, mpYAxisSelectionBox, mpYAxisSimpleSelectionWidget, mpYAxisTmpVector, and pdelete.

113 {
114  pdelete(this->mpOKButton);
115  pdelete(this->mpCancelButton);
116  pdelete(this->mpExpertCheckBox);
117  pdelete(this->mpXAxisLabel);
118  pdelete(this->mpYAxisLabel);
125  pdelete(this->mpSplitter);
126  pdelete(this->mpButtonBox);
127  pdelete(this->mpMainLayout);
128  pdelete(this->mpXAxisTmpVector);
129  pdelete(this->mpYAxisTmpVector);
130 }
SimpleSelectionWidget * mpYAxisSimpleSelectionWidget
#define pdelete(p)
Definition: copasi.h:215
std::vector< CCopasiObject * > * mpXAxisTmpVector
ObjectBrowserWidget * mpXAxisObjectBrowserWidget
std::vector< CCopasiObject * > * mpYAxisTmpVector
ObjectBrowserWidget * mpYAxisObjectBrowserWidget
SimpleSelectionWidget * mpXAxisSimpleSelectionWidget

Member Function Documentation

void CPlotSelectionDialog::setModel ( CModel model)

Definition at line 234 of file CPlotSelectionDialog.cpp.

References mpXAxisSimpleSelectionWidget, and mpYAxisSimpleSelectionWidget.

235 {
236  this->mpXAxisSimpleSelectionWidget->populateTree(model);
237  this->mpYAxisSimpleSelectionWidget->populateTree(model);
238 }
SimpleSelectionWidget * mpYAxisSimpleSelectionWidget
SimpleSelectionWidget * mpXAxisSimpleSelectionWidget
void CPlotSelectionDialog::setOutputVectors ( std::vector< CCopasiObject * > *  outputVector1,
std::vector< CCopasiObject * > *  outputVector2 
)

Definition at line 228 of file CPlotSelectionDialog.cpp.

References mpXAxisOutputVector, and mpYAxisOutputVector.

229 {
230  this->mpXAxisOutputVector = outputVector1;
231  this->mpYAxisOutputVector = outputVector2;
232 }
std::vector< CCopasiObject * > * mpXAxisOutputVector
std::vector< CCopasiObject * > * mpYAxisOutputVector
void CPlotSelectionDialog::setTabOrder ( )
protected

Definition at line 132 of file CPlotSelectionDialog.cpp.

References mpCancelButton, mpExpertCheckBox, mpOKButton, mpXAxisSelectionWidget, and mpYAxisSelectionWidget.

Referenced by CPlotSelectionDialog(), and slotExpertCheckBoxToggled().

133 {
134  QWidget::setTabOrder(this->mpOKButton, this->mpCancelButton);
135  QWidget::setTabOrder(this->mpCancelButton, this->mpExpertCheckBox);
136  QWidget::setTabOrder(this->mpExpertCheckBox, this->mpXAxisSelectionWidget);
137  QWidget::setTabOrder(this->mpXAxisSelectionWidget, this->mpYAxisSelectionWidget);
138  this->mpXAxisSelectionWidget->setFocus();
139 }
void CPlotSelectionDialog::slotCancelButtonClicked ( )
protectedslot

Definition at line 193 of file CPlotSelectionDialog.cpp.

Referenced by CPlotSelectionDialog().

194 {
195  QDialog::done(QDialog::Rejected);
196 }
void CPlotSelectionDialog::slotExpertCheckBoxToggled ( bool  checked)
protectedslot

Definition at line 198 of file CPlotSelectionDialog.cpp.

References mpXAxisObjectBrowserWidget, mpXAxisSelectionBox, mpXAxisSelectionWidget, mpXAxisSimpleSelectionWidget, mpYAxisObjectBrowserWidget, mpYAxisSelectionBox, mpYAxisSelectionWidget, mpYAxisSimpleSelectionWidget, and setTabOrder().

Referenced by CPlotSelectionDialog().

199 {
200  this->mpXAxisSelectionWidget->hide();
201  this->mpYAxisSelectionWidget->hide();
202  this->mpXAxisSelectionBox->layout()->remove(this->mpXAxisSelectionWidget);
203  this->mpYAxisSelectionBox->layout()->remove(this->mpYAxisSelectionWidget);
204  if (checked)
205  {
206  if (!this->mpXAxisObjectBrowserWidget)
207  {
208  // create ObjectBrowserWidget objects
211  }
214  }
215 
216  else
217  {
220  }
221  this->mpXAxisSelectionBox->layout()->add(this->mpXAxisSelectionWidget);
222  this->mpYAxisSelectionBox->layout()->add(this->mpYAxisSelectionWidget);
223  this->mpXAxisSelectionWidget->show();
224  this->mpYAxisSelectionWidget->show();
225  this->setTabOrder();
226 }
SimpleSelectionWidget * mpYAxisSimpleSelectionWidget
ObjectBrowserWidget * mpXAxisObjectBrowserWidget
ObjectBrowserWidget * mpYAxisObjectBrowserWidget
SimpleSelectionWidget * mpXAxisSimpleSelectionWidget
void CPlotSelectionDialog::slotOKButtonClicked ( )
protectedslot

Definition at line 141 of file CPlotSelectionDialog.cpp.

References ObjectBrowserWidget::commitClicked(), mpExpertCheckBox, mpXAxisObjectBrowserWidget, mpXAxisOutputVector, mpXAxisSimpleSelectionWidget, mpXAxisTmpVector, mpYAxisObjectBrowserWidget, mpYAxisOutputVector, mpYAxisSimpleSelectionWidget, and mpYAxisTmpVector.

Referenced by CPlotSelectionDialog().

142 {
143  // fill the selection vectors
144  if (this->mpXAxisOutputVector)
145  {
146  if (this->mpExpertCheckBox->isChecked())
147  {
148  this->mpXAxisTmpVector->clear();
150  }
151  else
152  {
153  if (this->mpXAxisSimpleSelectionWidget->isSingleSelection())
154  {
155  this->mpXAxisTmpVector->clear();
156  this->mpXAxisSimpleSelectionWidget->addButtonClicked();
157  }
158  }
159  unsigned int counter;
160  unsigned int maxCount = this->mpXAxisTmpVector->size();
161  this->mpXAxisOutputVector->clear();
162  for (counter = 0; counter < maxCount;++counter)
163  {
164  this->mpXAxisOutputVector->push_back(this->mpXAxisTmpVector->at(counter));
165  }
166  }
167  if (this->mpYAxisOutputVector)
168  {
169  if (this->mpExpertCheckBox->isChecked())
170  {
171  this->mpYAxisTmpVector->clear();
173  }
174  else
175  {
176  if (this->mpYAxisSimpleSelectionWidget->isSingleSelection())
177  {
178  this->mpYAxisTmpVector->clear();
179  this->mpYAxisSimpleSelectionWidget->addButtonClicked();
180  }
181  }
182  unsigned int counter;
183  unsigned int maxCount = this->mpYAxisTmpVector->size();
184  this->mpYAxisOutputVector->clear();
185  for (counter = 0; counter < maxCount;++counter)
186  {
187  this->mpYAxisOutputVector->push_back(this->mpYAxisTmpVector->at(counter));
188  }
189  }
190  QDialog::done(QDialog::Accepted);
191 }
SimpleSelectionWidget * mpYAxisSimpleSelectionWidget
std::vector< CCopasiObject * > * mpXAxisTmpVector
ObjectBrowserWidget * mpXAxisObjectBrowserWidget
std::vector< CCopasiObject * > * mpYAxisTmpVector
std::vector< CCopasiObject * > * mpXAxisOutputVector
ObjectBrowserWidget * mpYAxisObjectBrowserWidget
SimpleSelectionWidget * mpXAxisSimpleSelectionWidget
std::vector< CCopasiObject * > * mpYAxisOutputVector

Member Data Documentation

QHBox* CPlotSelectionDialog::mpButtonBox
protected

Definition at line 66 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), and ~CPlotSelectionDialog().

QPushButton* CPlotSelectionDialog::mpCancelButton
protected

Definition at line 57 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), setTabOrder(), and ~CPlotSelectionDialog().

QCheckBox* CPlotSelectionDialog::mpExpertCheckBox
protected
QVBoxLayout* CPlotSelectionDialog::mpMainLayout
protected

Definition at line 67 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), and ~CPlotSelectionDialog().

QPushButton* CPlotSelectionDialog::mpOKButton
protected

Definition at line 56 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), setTabOrder(), and ~CPlotSelectionDialog().

QSplitter* CPlotSelectionDialog::mpSplitter
protected

Definition at line 65 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), and ~CPlotSelectionDialog().

QLabel* CPlotSelectionDialog::mpXAxisLabel
protected

Definition at line 68 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), and ~CPlotSelectionDialog().

ObjectBrowserWidget* CPlotSelectionDialog::mpXAxisObjectBrowserWidget
protected
std::vector<CCopasiObject*>* CPlotSelectionDialog::mpXAxisOutputVector
protected

Definition at line 72 of file CPlotSelectionDialog.h.

Referenced by setOutputVectors(), and slotOKButtonClicked().

QVBox* CPlotSelectionDialog::mpXAxisSelectionBox
protected
QWidget* CPlotSelectionDialog::mpXAxisSelectionWidget
protected
SimpleSelectionWidget* CPlotSelectionDialog::mpXAxisSimpleSelectionWidget
protected
std::vector<CCopasiObject*>* CPlotSelectionDialog::mpXAxisTmpVector
protected
QLabel* CPlotSelectionDialog::mpYAxisLabel
protected

Definition at line 69 of file CPlotSelectionDialog.h.

Referenced by CPlotSelectionDialog(), and ~CPlotSelectionDialog().

ObjectBrowserWidget* CPlotSelectionDialog::mpYAxisObjectBrowserWidget
protected
std::vector<CCopasiObject*>* CPlotSelectionDialog::mpYAxisOutputVector
protected

Definition at line 73 of file CPlotSelectionDialog.h.

Referenced by setOutputVectors(), and slotOKButtonClicked().

QVBox* CPlotSelectionDialog::mpYAxisSelectionBox
protected
QWidget* CPlotSelectionDialog::mpYAxisSelectionWidget
protected
SimpleSelectionWidget* CPlotSelectionDialog::mpYAxisSimpleSelectionWidget
protected
std::vector<CCopasiObject*>* CPlotSelectionDialog::mpYAxisTmpVector
protected

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