Version: 8.3.0
gui.CItems.ControlItem Class Reference
Inheritance diagram for gui.CItems.ControlItem:
Collaboration diagram for gui.CItems.ControlItem:

Public Member Functions

def __init__
 
def moveBy
 
def myMove
 
def getObj
 
def popup
 
def connect
 
def link
 
def tooltip
 
def selected
 

Public Attributes

 port
 
 node
 
 item
 
 context
 

Detailed Description

Definition at line 266 of file CItems.py.

Constructor & Destructor Documentation

def gui.CItems.ControlItem.__init__ (   self,
  node,
  port,
  canvas 
)

Definition at line 267 of file CItems.py.

268  def __init__(self,node,port,canvas):
269  QCanvasRectangle.__init__(self,canvas)
270  self.setSize(6,6)
271  self.port=port
272  self.setPen(QPen(Qt.black))
273  self.setBrush(QBrush(Qt.red))
274  self.setZ(node.z()+1)
275  self.node=node
276  self.item=Item.adapt(self.port)

Member Function Documentation

def gui.CItems.ControlItem.connect (   self)

Definition at line 295 of file CItems.py.

References gui.CItems.ControlItem.context, and gui.CItems.ControlItem.port.

Referenced by gui.browser_catalog.Browser.init().

296  def connect(self):
297  print "ControlItem.connect",self.context
298  print self.port
299  item=Item.adapt(self.port)
300  print item
301  item.connect()
302  self.context.connecting(item)
303  #self.context.connecting(self)
def gui.CItems.ControlItem.getObj (   self)

Definition at line 283 of file CItems.py.

284  def getObj(self):
285  return self
def gui.CItems.ControlItem.link (   self,
  obj 
)

Definition at line 304 of file CItems.py.

305  def link(self,obj):
306  #Protocol to link 2 objects (ports, at first)
307  #First, notify the canvas View (or any view that can select) we are connecting (see method connect above)
308  #Second (and last) make the link in the link method of object that was declared connecting
309  print "link:",obj
def gui.CItems.ControlItem.moveBy (   self,
  dx,
  dy 
)

Definition at line 277 of file CItems.py.

278  def moveBy(self,dx,dy):
279  self.node.moveBy(dx,dy)
def gui.CItems.ControlItem.myMove (   self,
  dx,
  dy 
)

Definition at line 280 of file CItems.py.

281  def myMove(self,dx,dy):
282  QCanvasRectangle.moveBy(self,dx,dy)
def gui.CItems.ControlItem.popup (   self,
  canvasView 
)

Definition at line 286 of file CItems.py.

Referenced by gui.GraphViewer.GraphViewer.contentsMousePressEvent().

287  def popup(self,canvasView):
288  self.context=canvasView
289  menu=QPopupMenu()
290  caption = QLabel( "<font color=darkblue><u><b>Port Menu</b></u></font>",menu )
291  caption.setAlignment( Qt.AlignCenter )
292  menu.insertItem( caption )
293  menu.insertItem("Connect", self.connect)
294  return menu
def gui.CItems.ControlItem.selected (   self)
The canvas item has been selected

Definition at line 315 of file CItems.py.

References gui.CItems.ControlItem.port.

316  def selected(self):
317  """The canvas item has been selected"""
318  #print "control port selected"
319  item=Item.adapt(self.port)
320  item.selected()
def gui.CItems.ControlItem.tooltip (   self,
  view,
  pos 
)

Definition at line 310 of file CItems.py.

References YACS::HMI::presentationtype_parser.height(), and YACS::HMI::presentationtype_parser.width().

311  def tooltip(self,view,pos):
312  r = QRect(pos.x(), pos.y(), self.width(), self.height())
313  s = QString( "gate:")
314  view.tip( r, s )

Member Data Documentation

gui.CItems.ControlItem.context

Definition at line 287 of file CItems.py.

Referenced by gui.CItems.ControlItem.connect(), gui.GraphViewer.PortItem.connect(), and gui.CItems.PortItem.connect().

gui.CItems.ControlItem.item

Definition at line 275 of file CItems.py.

gui.CItems.ControlItem.node

Definition at line 274 of file CItems.py.

Referenced by gui.CItems.Cell.customEvent(), and gui.CItems.Cell.selected().

gui.CItems.ControlItem.port

Definition at line 270 of file CItems.py.

Referenced by gui.CItems.ControlItem.connect(), gui.CItems.PortItem.connect(), gui.sessions.Sessions.getChildren(), gui.Items.ItemOutPort.link(), gui.Items.ItemOutStream.link(), gui.CItems.ControlItem.selected(), and gui.CItems.PortItem.selected().


The documentation for this class was generated from the following file: