1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : SUPERVGUI_ManagePortsDlg.h
8 // Author : Alexander SLADKOV
11 #ifndef SUPERVGUI_ManagePortsDlg_H
12 #define SUPERVGUI_ManagePortsDlg_H
17 class SUPERVGUI_CanvasNode;
22 * Simple redefinition of ListBoxItem for storing ports name and type without having to parce it
24 class PortListItem : QListBoxText {
26 PortListItem ( QListBox* lb, const QString& name, const QString& type )
27 : QListBoxText( lb/*, QString( "%1 (%2)" ).arg( name ).arg( type )*/ ),
32 virtual QString text() const { return QString( "%1 (%2)" ).arg( PortName ).arg( PortType ); }
38 class SUPERVGUI_ManagePortsDlg: public QDialog {
43 SUPERVGUI_ManagePortsDlg( SUPERVGUI_CanvasNode* theNode );
44 virtual ~SUPERVGUI_ManagePortsDlg();
50 void addInput() { addPort( myInList ); }
51 void addOutput() { addPort( myOutList );}
52 void removeInput() { removePort( myInList ); }
53 void removeOutput() { removePort( myOutList );}
54 void upInput() { moveUp( myInList ); }
55 void upOutput() { moveUp( myOutList );}
56 void downInput() { moveDown( myInList ); }
57 void downOutput() { moveDown( myOutList );}
59 void nameChanged( const QString& name );
60 void typeChanged( const QString& type );
61 void itemChanged( QListBoxItem * item );
64 virtual void showEvent( QShowEvent* theEvent );
65 void addPort( QListBox* );
66 void removePort( QListBox* );
67 void moveUp( QListBox* );
68 void moveDown( QListBox* );
72 void init( const SUPERVGUI_CanvasNode* theNode );
74 SUPERVGUI_CanvasNode* myNode;
77 QComboBox* myTypeCombo;
80 QListBoxItem* myLastItem;
81 bool myFromItemChanged;