editors/Viewer.py
changeset 1743 c3c3d1318130
parent 1741 dd94b9a68c61
child 1744 69dfdb26f600
equal deleted inserted replaced
1742:92932cd370a4 1743:c3c3d1318130
    47 SFC_Objects = (SFC_Step, SFC_ActionBlock, SFC_Transition, SFC_Divergence, SFC_Jump)
    47 SFC_Objects = (SFC_Step, SFC_ActionBlock, SFC_Transition, SFC_Divergence, SFC_Jump)
    48 
    48 
    49 
    49 
    50 def ResetCursors():
    50 def ResetCursors():
    51     global CURSORS
    51     global CURSORS
    52     if CURSORS == None:
    52     if CURSORS is None:
    53         CURSORS = [wx.NullCursor,
    53         CURSORS = [wx.NullCursor,
    54                    wx.StockCursor(wx.CURSOR_HAND),
    54                    wx.StockCursor(wx.CURSOR_HAND),
    55                    wx.StockCursor(wx.CURSOR_SIZENWSE),
    55                    wx.StockCursor(wx.CURSOR_SIZENWSE),
    56                    wx.StockCursor(wx.CURSOR_SIZENESW),
    56                    wx.StockCursor(wx.CURSOR_SIZENESW),
    57                    wx.StockCursor(wx.CURSOR_SIZEWE),
    57                    wx.StockCursor(wx.CURSOR_SIZEWE),
  2319                 self.rubberBand.OnMotion(event, dc, self.Scaling)
  2319                 self.rubberBand.OnMotion(event, dc, self.Scaling)
  2320             elif not self.Debug and self.Mode == MODE_SELECTION and self.SelectedElement is not None:
  2320             elif not self.Debug and self.Mode == MODE_SELECTION and self.SelectedElement is not None:
  2321                 if self.DrawingWire:
  2321                 if self.DrawingWire:
  2322                     connector, errorHighlight = self.FindBlockConnectorWithError(pos, self.SelectedElement.GetConnectionDirection(), self.SelectedElement.EndConnected)
  2322                     connector, errorHighlight = self.FindBlockConnectorWithError(pos, self.SelectedElement.GetConnectionDirection(), self.SelectedElement.EndConnected)
  2323                     self.SelectedElement.ErrHighlight = errorHighlight;
  2323                     self.SelectedElement.ErrHighlight = errorHighlight;
  2324                     if not connector or self.SelectedElement.EndConnected == None:
  2324                     if not connector or self.SelectedElement.EndConnected is None:
  2325                         self.SelectedElement.ResetPoints()
  2325                         self.SelectedElement.ResetPoints()
  2326                         movex, movey = self.SelectedElement.OnMotion(event, dc, self.Scaling)
  2326                         movex, movey = self.SelectedElement.OnMotion(event, dc, self.Scaling)
  2327                         self.SelectedElement.GeneratePoints()
  2327                         self.SelectedElement.GeneratePoints()
  2328                         if movex != 0 or movey != 0:
  2328                         if movex != 0 or movey != 0:
  2329                             self.RefreshRect(self.GetScrolledRect(self.SelectedElement.GetRedrawRect(movex, movey)), False)
  2329                             self.RefreshRect(self.GetScrolledRect(self.SelectedElement.GetRedrawRect(movex, movey)), False)
  2964         connectors = step.GetConnectors()
  2964         connectors = step.GetConnectors()
  2965         dialog.SetValues({
  2965         dialog.SetValues({
  2966             "name": step.GetName(),
  2966             "name": step.GetName(),
  2967             "input": len(connectors["inputs"]) > 0,
  2967             "input": len(connectors["inputs"]) > 0,
  2968             "output": len(connectors["outputs"]) > 0,
  2968             "output": len(connectors["outputs"]) > 0,
  2969             "action": step.GetActionConnector() != None})
  2969             "action": step.GetActionConnector() is not None})
  2970         if dialog.ShowModal() == wx.ID_OK:
  2970         if dialog.ShowModal() == wx.ID_OK:
  2971             values = dialog.GetValues()
  2971             values = dialog.GetValues()
  2972             rect = step.GetRedrawRect(1, 1)
  2972             rect = step.GetRedrawRect(1, 1)
  2973 
  2973 
  2974             new_name = values["name"]
  2974             new_name = values["name"]