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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SUPERVGUI_ManagePortsDlg.h
23 // Author : Alexander SLADKOV
26 #ifndef SUPERVGUI_ManagePortsDlg_H
27 #define SUPERVGUI_ManagePortsDlg_H
29 #include "SUPERVGUI.h"
33 #include <qstringlist.h>
34 #include <qlineedit.h>
35 #include <qcombobox.h>
38 class SUPERVGUI_CanvasNode;
41 * Simple redefinition of ListBoxItem for storing ports name and type without having to parce it
43 class PortListItem : QListBoxText {
45 PortListItem ( QListBox* lb, const QString& name, const QString& type )
46 : QListBoxText( lb/*, QString( "%1 (%2)" ).arg( name ).arg( type )*/ ),
51 virtual QString text() const { return QString( "%1 (%2)" ).arg( PortName ).arg( PortType ); }
57 class SUPERVGUI_ManagePortsDlg: public QDialog {
62 SUPERVGUI_ManagePortsDlg( SUPERVGUI_CanvasNode* theNode );
63 virtual ~SUPERVGUI_ManagePortsDlg();
69 void addInput() { addPort( myInList ); }
70 void addOutput() { addPort( myOutList );}
71 void removeInput() { removePort( myInList ); }
72 void removeOutput() { removePort( myOutList );}
73 void upInput() { moveUp( myInList ); }
74 void upOutput() { moveUp( myOutList );}
75 void downInput() { moveDown( myInList ); }
76 void downOutput() { moveDown( myOutList );}
78 void nameChanged( const QString& name );
79 void typeChanged( const QString& type );
80 void itemChanged( QListBoxItem * item );
81 void itemDeselect(QListBoxItem* item, const QPoint& point); // mkr: PAL12448
84 virtual void showEvent( QShowEvent* theEvent );
85 void addPort( QListBox* );
86 void removePort( QListBox* );
87 void moveUp( QListBox* );
88 void moveDown( QListBox* );
89 void moveItem( QListBox* theLB, const int from, const int to );
91 void createLinkEngine( SUPERV::Port_ptr thePort,
92 QValueList< QPair< QString,QString > >& theOwnList,
93 QValueList< QPair< QString,QString > >& theCorrespList );
97 void init( const SUPERVGUI_CanvasNode* theNode );
99 SUPERVGUI_CanvasNode* myNode;
101 QLineEdit* myNameEdt;
102 QComboBox* myTypeCombo;
105 QListBoxItem* myLastItem;
109 * Port parameters dialog definition (taken from SUPERVGUI_Node.h without change)
111 class SUPERVGUI_PortParamsDlg: public QDialog {
115 SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames);
116 ~SUPERVGUI_PortParamsDlg() {};
118 QString getName() { return myNameTxt->text(); }
119 QString getType() { return myTypeTxt->currentText(); }
126 QLineEdit* myNameTxt;
127 QComboBox* myTypeTxt;
128 QStringList myPortsNames;