1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SUPERVGUI_Service.cxx
25 // Author : Francis KLOSS
29 #include "SUPERVGUI_Service.h"
30 #include "SUPERVGUI_Main.h"
31 #include "SUPERVGUI.h"
32 #include "QAD_Tools.h"
33 #include "QAD_FileDlg.h"
35 #include "SALOME_NamingService.hxx"
36 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
38 #include <qtextstream.h>
41 static const char * ComponentIcon[] = {
48 " .................. ",
57 " .................. ",
61 " .. .. .. .. .. .. ",
63 " .. .. .. .. .. .. ",
67 static const char * InterfaceIcon[] = {
95 SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
96 QDialog(QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
99 setSizeGripEnabled( true );
100 setCaption(tr("TIT_SERVICES"));
102 QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 4);
104 myTabPane = new QTabWidget(this);
105 connect(myTabPane, SIGNAL(currentChanged(QWidget *)), this, SLOT(tabChanged(QWidget *)));
107 // Create Tab for Corba services
108 QWidget* aCorbaPane = new QWidget(myTabPane);
109 QVBoxLayout* aBaseLayoutV= new QVBoxLayout(aCorbaPane, 0, 4);
110 aBaseLayoutV->setMargin(5);
111 aBaseLayoutV->setSpacing(10);
113 QHBoxLayout* aBaseLayout = new QHBoxLayout(aCorbaPane); //!!
115 components = new QListView(aCorbaPane);
116 components->addColumn(tr("COL_COMPONENTS"));
117 components->addColumn(tr("COL_PORTTYPE"));
118 components->addColumn(tr("COL_PORTWAY"));
119 components->setColumnAlignment(1, AlignLeft);
120 components->setColumnAlignment(2, AlignLeft);
121 components->setColumnAlignment(3, AlignLeft);
122 components->setSelectionMode(QListView::Extended);
123 components->setRootIsDecorated(true);
124 // aBaseLayout->addWidget(components);
125 aBaseLayoutV->addWidget(components); //!!
127 //QHGroupBox* aAddBox = new QHGroupBox(tr("TIT_ADDNODE"), aCorbaPane); //!!
128 //aAddBox->setInsideSpacing(20); //!!
130 QPushButton* aComputeCBtn = new QPushButton(tr("TIT_ADDCNODE"), aCorbaPane); //!!
131 connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
132 aComputeCBtn->setDefault(false);
134 QPushButton* aComputeBtn = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
135 connect(aComputeBtn, SIGNAL(clicked()), this, SLOT(addFactoryNode()));
136 aComputeBtn->setDefault(true);
138 aBaseLayout->addWidget(aComputeBtn);
139 aBaseLayout->addWidget(aComputeCBtn); //!!
141 aBaseLayoutV->insertLayout(-1, aBaseLayout);
142 myTabPane->addTab(aCorbaPane, tr("MODULES_PANE"));
145 // Create Tab for Python services
146 QWidget* aPythonPane = new QWidget(myTabPane);
147 QVBoxLayout* aPythonLayout = new QVBoxLayout(aPythonPane, 0, 4);
148 aPythonLayout->setMargin(5);
149 aPythonLayout->setSpacing(10);
152 QHGroupBox* aAddBox2 = new QHGroupBox(tr("TIT_ADDNODE"), aPythonPane);
153 aAddBox2->setInsideSpacing(20);
155 QLabel* aTypeLbl = new QLabel(tr("LBL_NODETYPE"), aAddBox2);
157 myTypeCombo = new QComboBox(aAddBox2);
158 myTypeCombo->insertItem("Computation");
159 myTypeCombo->insertItem("Switch");
160 myTypeCombo->insertItem("Loop");
161 myTypeCombo->insertItem("GoTo");
162 //myTypeCombo->insertItem("Label");
163 connect(myTypeCombo, SIGNAL(activated(int)), this, SLOT(typeNodeSelected(int)));
165 aPythonLayout->addWidget(aAddBox2);
168 myStackWidget = new QWidgetStack(aPythonPane);
171 myScriptPane = new SUPERVGUI_PythonEditPane(myStackWidget);
172 myOtherId = myStackWidget->addWidget(myScriptPane);
175 QTabWidget* aLoopTabPane = new QTabWidget(myStackWidget);
176 myInitPane = new SUPERVGUI_PythonEditPane(myStackWidget);
177 aLoopTabPane->addTab(myInitPane, "Init");
179 myMorePane = new SUPERVGUI_PythonEditPane(myStackWidget);
180 aLoopTabPane->addTab(myMorePane, "More");
182 myNextPane = new SUPERVGUI_PythonEditPane(myStackWidget);
183 aLoopTabPane->addTab(myNextPane, "Next");
184 myLoopId = myStackWidget->addWidget(aLoopTabPane);
186 myStackWidget->raiseWidget(myOtherId);
188 aPythonLayout->addWidget(myStackWidget, 1);
191 QPushButton* aCreateBtn = new QPushButton(tr("TIT_ADDNODE"), aPythonPane);
192 connect(aCreateBtn, SIGNAL(clicked()), this, SLOT(addInlineNode()));
193 aPythonLayout->addWidget(aCreateBtn);
195 myTabPane->addTab(aPythonPane, tr("INLINE_PANE"));
197 aMainLayout->addWidget(myTabPane);
200 QHBox* aBtnBox = new QHBox(this);
201 QHBoxLayout* aBtnLayout = new QHBoxLayout(aBtnBox->layout());
202 aBtnLayout->addStretch();
204 QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
205 connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
207 aMainLayout->addWidget(aBtnBox);
216 char* getDataStreamParameterName(int aType)
234 void SUPERVGUI_Service::initialise() {
235 CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog");
236 SALOME_ModuleCatalog::ModuleCatalog_var *aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
237 *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
238 if (CORBA::is_nil(*aModuleCatalog)) {
239 setCaption("Error in Connexion to omniNames with '/Kernel/ModulCatalog'");
243 QAD_ResourceMgr* aResMgr = QAD_Desktop::createResourceManager();
245 SALOME_ModuleCatalog::ListOfComponents_var lComponents = (*aModuleCatalog)->GetComponentList();
246 long nbComp = lComponents->length();
247 for (int i=0; i<nbComp; i++) {
248 SALOME_ModuleCatalog::Acomponent_ptr C = (*aModuleCatalog)->GetComponent((char *)lComponents[i]);
249 QListViewItem* myComponentItem = new QListViewItem(components, (char*)lComponents[i]);
250 myComponentItem->setSelectable(false);
251 QString aIconName = C->component_icone();
252 if (!aIconName.isEmpty()) {
253 QString resDir = aResMgr->findFile(aIconName, C->componentname()) ;
255 resDir = QAD_Tools::addSlash(resDir);
256 QPixmap aIcone(resDir + aIconName);
257 QIconSet aIconSet(aIcone);
258 myComponentItem->setPixmap(0, aIconSet.pixmap(QIconSet::Small, QIconSet::Normal));
260 myComponentItem->setPixmap(0, ComponentIcon);
263 myComponentItem->setPixmap(0, ComponentIcon);
265 SALOME_ModuleCatalog::ListOfInterfaces* lInterfaces = C->GetInterfaceList();
266 long nbInterf = lInterfaces->length();
267 for (int j=0; j<nbInterf; j++) {
268 SALOME_ModuleCatalog::DefinitionInterface* Interface = C->GetInterface((char*)(*lInterfaces)[j]);
269 QListViewItem* myInterfaceItem = new QListViewItem(myComponentItem, (char*)Interface->interfacename);
270 myInterfaceItem->setSelectable(false);
271 myInterfaceItem->setPixmap(0, InterfaceIcon);
273 long nbServices = Interface->interfaceservicelist.length();
274 for (int k=0; k<nbServices; k++) {
275 SALOME_ModuleCatalog::Service* Service = &(Interface->interfaceservicelist[k]);
276 QListViewItem* myServiceItem = new QListViewItem(myInterfaceItem, (char*)Service->ServiceName);
277 myServiceItem->setSelectable(true);
278 components->ensureItemVisible(myServiceItem);
280 long nbPortsOut = Service->ServiceoutParameter.length();
281 for (int m=0; m<nbPortsOut; m++) {
282 SALOME_ModuleCatalog::ServicesParameter* PortOut = &(Service->ServiceoutParameter[m]);
283 QListViewItem* myPortOutItem =
284 new QListViewItem(myServiceItem, (char*)PortOut->Parametername, (char*)PortOut->Parametertype, "Out");
285 myPortOutItem->setSelectable(false);
288 long nbStreamPortsOut = Service->ServiceoutDataStreamParameter.length();
289 for (int m=0; m<nbStreamPortsOut; m++) {
290 SALOME_ModuleCatalog::ServicesDataStreamParameter* PortOut = &(Service->ServiceoutDataStreamParameter[m]);
291 QListViewItem* myPortOutItem =
292 new QListViewItem(myServiceItem, (char*)PortOut->Parametername,
293 getDataStreamParameterName(PortOut->Parametertype), "DataStream Out");
294 myPortOutItem->setSelectable(false);
297 long nbPortsIn = Service->ServiceinParameter.length();
298 for (int l=0; l<nbPortsIn; l++) {
299 SALOME_ModuleCatalog::ServicesParameter* PortIn = &(Service->ServiceinParameter[l]);
300 QListViewItem* myPortInItem =
301 new QListViewItem(myServiceItem, (char*)PortIn->Parametername, (char*)PortIn->Parametertype, "In");
302 myPortInItem->setSelectable(false);
305 long nbStreamPortsIn = Service->ServiceinDataStreamParameter.length();
306 for (int l=0; l<nbStreamPortsIn; l++) {
307 SALOME_ModuleCatalog::ServicesDataStreamParameter* PortIn = &(Service->ServiceinDataStreamParameter[l]);
308 QListViewItem* myPortInItem =
309 new QListViewItem(myServiceItem, (char*)PortIn->Parametername,
310 getDataStreamParameterName(PortIn->Parametertype), "DataStream In");
311 myPortInItem->setSelectable(false);
320 SUPERVGUI_Service::~SUPERVGUI_Service() {
321 Trace("SUPERVGUI_Service::~SUPERVGUI_Service")
324 void SUPERVGUI_Service::addComputeNode() {
325 SUPERVGUI_Main* aMain = Supervision.getMain();
327 QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
329 CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog");
330 SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
331 *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
332 if (CORBA::is_nil(*aModuleCatalog)) {
333 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
337 QListViewItemIterator i(components);
338 for (; i.current(); ++i) {
340 if (item->isSelected()) {
341 const char* service = item->text(0).latin1();
342 const char* interface = item->parent()->text(0).latin1();
343 const char* component = item->parent()->parent()->text(0).latin1();
344 SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
345 if (myComponent==NULL) {
346 QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
348 const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
351 SUPERV_CNode node = aMain->getDataflow()->CNode(*myService);
352 if (CORBA::is_nil(node)) {
353 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
356 node->Coords(myX, myY);
359 aMain->addComputeNode(SUPERV::CNode::_narrow(node));
364 QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NONODE_TOADD"));
370 void SUPERVGUI_Service::addFactoryNode() {
371 SUPERVGUI_Main* aMain = Supervision.getMain();
373 QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
375 CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog");
376 SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
377 *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
378 if (CORBA::is_nil(*aModuleCatalog)) {
379 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
383 QListViewItemIterator i(components);
384 for (; i.current(); ++i) {
386 if (item->isSelected()) {
387 const char* service = item->text(0).latin1();
388 const char* interface = item->parent()->text(0).latin1();
389 const char* component = item->parent()->parent()->text(0).latin1();
390 SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
391 if (myComponent==NULL) {
392 QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
394 const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
397 SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
398 if (CORBA::is_nil(node)) {
399 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
402 node->Coords(myX, myY);
405 aMain->addComputeNode(SUPERV::CNode::_narrow(node));
410 QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NONODE_TOADD"));
417 void SUPERVGUI_Service::addInlineNode() {
418 SUPERVGUI_Main* aMain = Supervision.getMain();
420 QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
422 int aSel = myTypeCombo->currentItem();
424 case 0: // Computation
425 if (myScriptPane->isDefined()) {
426 SUPERV_INode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(),
427 (myScriptPane->getFunction()).in());
428 if (CORBA::is_nil(aNode)) {
429 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
432 aNode->Coords(myX, myY);
435 aMain->addComputeNode(SUPERV::CNode::_narrow(aNode));
440 if (myScriptPane->isDefined()) {
441 SUPERV_INode aEndNode;
442 SUPERV_SNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(),
443 (myScriptPane->getFunction()).in(),
445 if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
446 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
449 aStartNode->Coords(myX, myY);
450 aEndNode->Coords(myX + LABEL_WIDTH*2, myY);
453 aMain->addControlNode(SUPERV::CNode::_narrow(aStartNode), SUPERV::CNode::_narrow(aEndNode), true);
459 SUPERV_INode aEndNode;
460 SUPERV_LNode aStartNode = aMain->getDataflow()->LNode(myInitPane->getFuncName().latin1(), (myInitPane->getFunction()).in(),
461 myMorePane->getFuncName().latin1(), (myMorePane->getFunction()).in(),
462 myNextPane->getFuncName().latin1(), (myNextPane->getFunction()).in(),
464 if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
465 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
468 aStartNode->Coords(myX, myY);
469 aEndNode->Coords(myX + LABEL_WIDTH*2, myY);
472 aMain->addControlNode(SUPERV::CNode::_narrow(aStartNode), SUPERV::CNode::_narrow(aEndNode), true);
478 SUPERV_GNode aGotoNode;
479 if (myScriptPane->isDefined())
480 aGotoNode = aMain->getDataflow()->GNode(myScriptPane->getFuncName().latin1(),
481 (myScriptPane->getFunction()).in(), "");
483 aGotoNode = aMain->getDataflow()->GNode("GoTo", (myScriptPane->getFunction()).in(), "");
484 if (CORBA::is_nil(aGotoNode)) {
485 QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
488 aGotoNode->Coords(myX, myY);
491 aMain->addGOTONode(SUPERV::GNode::_narrow(aGotoNode));
500 void SUPERVGUI_Service::typeNodeSelected(int theRow) {
502 myStackWidget->raiseWidget(myLoopId);
504 myStackWidget->raiseWidget(myOtherId);
509 void SUPERVGUI_Service::choose() {
510 Trace("SUPERVGUI_Service::choose")
516 void SUPERVGUI_Service::showEvent(QShowEvent* theEvent) {
517 SUPERVGUI_Main* aMain = Supervision.getMain();
518 if (aMain && (!aMain->isArrayShown())) {
519 aMain->getGraph()->viewportToContents(0, 0, myX, myY);
521 QDialog::showEvent(theEvent);
525 void SUPERVGUI_Service::tabChanged(QWidget* theWidget) {
526 myIsInline = (myTabPane->currentPageIndex() == 1);
531 //*****************************************************
532 // Pane for Python script editing
533 //*****************************************************
534 SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane(QWidget* theParent)
538 QGridLayout* aEditLayout = new QGridLayout(this, 2, 4);
541 QPushButton* aLoadBtn = new QPushButton(tr("BUT_LOAD"), this);
542 connect(aLoadBtn, SIGNAL(clicked()), this, SLOT(loadFile()));
544 aEditLayout->addWidget(aLoadBtn, 0, 2);
546 myNextBtn = new QPushButton(tr("BUT_NEXT"), this);
547 myNextBtn->setEnabled(false);
548 connect(myNextBtn, SIGNAL(clicked()), this, SLOT(readFunction()));
550 aEditLayout->addWidget(myNextBtn, 0, 3);
553 myText = new QTextEdit(this);
554 myText->setWordWrap(QTextEdit::FixedColumnWidth);
555 myText->setWrapColumnOrWidth(80);
557 aEditLayout->addMultiCellWidget(myText, 1, 1, 0, 3);
562 * Load existing Python script
564 void SUPERVGUI_PythonEditPane::loadFile() {
565 QString aFileName = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
568 tr("TIT_LOADSCRIPT"),
570 if (aFileName.isEmpty()) return;
572 myFile = new QFile(aFileName);
573 if (!myFile->open(IO_ReadOnly)) {
574 QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"),
575 tr("MSG_CANT_LOADSCRIPT"));
578 myIStream = new QTextStream(myFile);
580 if (myIStream->atEnd()) {
581 QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"),
582 tr("MSG_EMTY_FILE"));
583 myNextBtn->setEnabled(false);
590 myNextBtn->setEnabled(true);
596 * Finds and Reads a function from current position in the opened file
598 void SUPERVGUI_PythonEditPane::readFunction() {
599 if (!myIStream) return;
601 while (!myIStream->atEnd()) {
602 QString aLine = myIStream->readLine();
603 if (aLine.isNull()) return;
605 // find first function
606 int aDefPos = aLine.find("def");
607 if (aDefPos == 0) { // only not a class members
610 /*int aStart = aLine.find(" ", aDefPos);
611 int aEnd = aLine.find("(", aStart);
612 QString aName = aLine.mid(aStart, (aEnd-aStart));
613 aName = aName.stripWhiteSpace();
614 myNameEdt->setText(aName);*/
618 aEnd = aLine.find(")", aStart);
619 QString aParams = aLine.mid(aStart, (aEnd-aStart));
620 aParams = aParams.stripWhiteSpace();
621 myParamEdt->setText(aParams);*/
623 myText->append(aLine);
625 QString aBodyLine = myIStream->readLine();
626 while ((!aBodyLine.isNull()) && aBodyLine[0].isSpace()) {
627 myText->append(aBodyLine);
628 aBodyLine = myIStream->readLine();
633 QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"),
634 tr("MSG_NOMORE_FUNCTIONS"));
637 myNextBtn->setEnabled(false);
643 QString SUPERVGUI_PythonEditPane::getFuncName() {
645 for (int i=0; i < myText->paragraphs(); i++) {
646 QString aLine = myText->text(i);
647 int aDefPos = aLine.find("def");
649 int aStart = aLine.find(" ", aDefPos);
650 int aEnd = aLine.find("(", aStart);
651 QString aName = aLine.mid(aStart, (aEnd-aStart));
652 return aName.stripWhiteSpace();
659 SUPERV_Strings SUPERVGUI_PythonEditPane::getFunction() {
660 SUPERV_Strings aStrings = new SUPERV::ListOfStrings();
661 aStrings->length(myText->paragraphs());
662 for (int i=0; i < myText->paragraphs(); i++) {
663 aStrings[i] = CORBA::string_dup(myText->text(i).latin1());
665 return aStrings._retn();
669 void SUPERVGUI_PythonEditPane::setFunction(SUPERV_Strings theStr) {
670 int aLen = theStr->length();
671 for (int i=0; i < aLen; i++)
672 myText->append(QString(theStr[i]));
680 SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg(bool isLoop)
681 :QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
683 setSizeGripEnabled( true );
684 setCaption(tr("TIT_FUNC_PYTHON"));
686 QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 4);
688 QTabWidget* aLoopTabPane = new QTabWidget(this);
689 myInitPane = new SUPERVGUI_PythonEditPane(this);
690 aLoopTabPane->addTab(myInitPane, "Init");
692 myMorePane = new SUPERVGUI_PythonEditPane(this);
693 aLoopTabPane->addTab(myMorePane, "More");
695 myNextPane = new SUPERVGUI_PythonEditPane(this);
696 aLoopTabPane->addTab(myNextPane, "Next");
698 aMainLayout->addWidget(aLoopTabPane);
700 myEditPane = new SUPERVGUI_PythonEditPane(this);
701 aMainLayout->addWidget(myEditPane);
703 QGroupBox* aBtnBox = new QGroupBox( this );
704 aBtnBox->setColumnLayout( 0, Qt::Vertical );
705 aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
706 QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
707 aBtnLayout->setAlignment( Qt::AlignTop );
708 aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
710 QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
711 connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
712 aBtnLayout->addWidget( aOKBtn );
714 aBtnLayout->addStretch();
716 QPushButton* aCancelBtn = new QPushButton( tr("BUT_CANCEL"), aBtnBox );
717 connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
718 aBtnLayout->addWidget( aCancelBtn );
720 aMainLayout->addWidget(aBtnBox);