PeriDyno 1.2.1
Loading...
Searching...
No Matches
WStateFieldWidget.cpp
Go to the documentation of this file.
1#include "WStateFieldWidget.h"
2
4{
5 layout = this->setLayout(std::make_unique<Wt::WHBoxLayout>());
6 layout->setContentsMargins(0, 0, 0, 0);
7 layout->setSpacing(0);
8
9 setValue(field);
10 mfield = field;
11
12 checkbox->changed().connect(this, &WStateFieldWidget::updateField);
13}
14
18
20{
21 checkbox = layout->addWidget(std::make_unique<Wt::WCheckBox>());
22 field->parent()->findOutputField(field) ? checkbox->setChecked(true) : checkbox->setChecked(false);
23}
24
26{
27 checkbox->isChecked() ? mfield->promoteOuput() : mfield->demoteOuput();
28
29 changeValue_.emit(1);
30}
Wt::Signal< bool > changeValue_
void setValue(dyno::FBase *)
WStateFieldWidget(dyno::FBase *)
Wt::WCheckBox * checkbox
Wt::WHBoxLayout * layout
OBase * parent()
Definition FBase.cpp:41
bool findOutputField(FBase *field)
Definition OBase.cpp:308