connect(myTitle, SIGNAL(MouseMove (QMouseEvent*)), this, SLOT(mouseTitleMove(QMouseEvent*)));
connect(myTitle, SIGNAL(MouseRelease(QMouseEvent*)), this, SLOT(mouseTitleRelease(QMouseEvent*)));
- myPortsBox = new QFrame(0);
- myPortLayout = new QGridLayout(myPortsBox, 0, 2, 0, 1);
+ myPortsBox = new QVBox(0);
+ myPortsBox->setSpacing(3);
+ myValuesBox = new QWidget(myPortsBox);
+ myPortLayout = new QGridLayout(myValuesBox, 0, 2, 0, 1);
+
+ myGatesBox = new QFrame(myPortsBox);
+ myGatesBox->setFrameStyle( QFrame::Panel | QFrame::Raised );
+ myGatesBox->setLineWidth(2);
+ // myGatesBox->setPaletteBackgroundColor(backgroundColor().dark(105));
+ myGatesBox->setPaletteBackgroundColor(green.light(170));
+ myGatesLayout = new QGridLayout(myGatesBox, 0, 2);
+ myGatesLayout->setMargin(3);
myTimer = new QTimer(this);
connect(myTimer, SIGNAL(timeout()), this, SLOT(movingNode(/*QMouseEvent* e*/)));
for (int i=0; i<n; i++) {
if (ports[i]->IsInput()) {
- myPortLayout->addWidget(new SUPERVGUI_PortIn(myPortsBox, myMain, ports[i]),
- myPIcount, 0);
- myPIcount++;
+ if (ports[i]->IsGate())
+ myGatesLayout->addWidget(new SUPERVGUI_PortIn(myGatesBox, myMain, ports[i]),
+ 0, 0);
+ else {
+ myPortLayout->addWidget(new SUPERVGUI_PortIn(myValuesBox, myMain, ports[i]),
+ myPIcount, 0);
+ myPIcount++;
+ }
} else {
- myPortLayout->addWidget(new SUPERVGUI_PortOut(myPortsBox, myMain, ports[i]),
- myPOcount, 1, Qt::AlignRight);
- myPOcount++;
+ if (ports[i]->IsGate())
+ myGatesLayout->addWidget(new SUPERVGUI_PortOut(myGatesBox, myMain, ports[i]),
+ 0, 1, Qt::AlignRight);
+ else {
+ myPortLayout->addWidget(new SUPERVGUI_PortOut(myValuesBox, myMain, ports[i]),
+ myPOcount, 1, Qt::AlignRight);
+ myPOcount++;
+ }
}
}
}
//check: is creation of link is complete
if (myMain->getGraph()->isAnyLinkCreating()) {
//not creation complete
- //cout<<" --- $$$ 1"<<endl;
myPopup->setItemEnabled(myDeleteItem, false);
}
else {
if (aPort == NULL) return;
if (getNodeType() == SUPERV::EndSwitchNode) {
- SUPERVGUI_PortInESNode* aPortPrs = new SUPERVGUI_PortInESNode(myPortsBox, myMain, aPort);
+ SUPERVGUI_PortInESNode* aPortPrs = new SUPERVGUI_PortInESNode(myValuesBox, myMain, aPort);
myPortLayout->addWidget(aPortPrs, myPIcount, 0);
if (myPortsBox->isVisible()) {
}
}
else {
- SUPERVGUI_PortIn* aPortPrs = new SUPERVGUI_PortIn(myPortsBox, myMain, aPort);
+ SUPERVGUI_PortIn* aPortPrs = new SUPERVGUI_PortIn(myValuesBox, myMain, aPort);
myPortLayout->addWidget(aPortPrs, myPIcount, 0);
if (myPortsBox->isVisible()) {
SUPERV_Port aPort = createOutPort();
if (aPort == NULL) return;
- SUPERVGUI_PortOut* aPortPrs = new SUPERVGUI_PortOut(myPortsBox, myMain, aPort);
+ SUPERVGUI_PortOut* aPortPrs = new SUPERVGUI_PortOut(myValuesBox, myMain, aPort);
myPortLayout->addWidget(aPortPrs, myPOcount, 1, Qt::AlignRight);
myPOcount++;
if (myPortsBox->isVisible()) {
aPortPrs = (SUPERVGUI_Port*) child(aName, "SUPERVGUI_Port");
if (aPortPrs == NULL) {
if (aPorts[i]->IsInput()) {
- SUPERVGUI_PortIn* aPortIn = new SUPERVGUI_PortIn(myPortsBox, myMain, aPorts[i]);
- myPortLayout->addWidget(aPortIn, myPIcount, 0);
+ SUPERVGUI_PortIn* aPortIn;
+ if (aPorts[i]->IsGate()) {
+ aPortIn = new SUPERVGUI_PortIn(myGatesBox, myMain, aPorts[i]);
+ myGatesLayout->addWidget(aPortIn, myPIcount, 0);
+ } else {
+ aPortIn = new SUPERVGUI_PortIn(myValuesBox, myMain, aPorts[i]);
+ myPortLayout->addWidget(aPortIn, myPIcount, 0);
+ myPIcount++;
+ }
if (aIsVisible) aPortIn->show();
- myPIcount++;
isAdded = true;
} else {
- SUPERVGUI_PortOut* aPortOut = new SUPERVGUI_PortOut(myPortsBox, myMain, aPorts[i]);
- myPortLayout->addWidget(aPortOut, myPOcount, 1, Qt::AlignRight);
+ SUPERVGUI_PortOut* aPortOut;
+ if (aPorts[i]->IsGate()) {
+ aPortOut = new SUPERVGUI_PortOut(myGatesBox, myMain, aPorts[i]);
+ myGatesLayout->addWidget(aPortOut, myPOcount, 1, Qt::AlignRight);
+ } else {
+ aPortOut = new SUPERVGUI_PortOut(myValuesBox, myMain, aPorts[i]);
+ myPortLayout->addWidget(aPortOut, myPOcount, 1, Qt::AlignRight);
+ myPOcount++;
+ }
if (aIsVisible) aPortOut->show();
- myPOcount++;
isAdded = true;
}
}