editors/Viewer.py
changeset 1609 0d961dc6f58f
parent 1608 e8efeeb718ab
child 1619 163d3a883575
equal deleted inserted replaced
1608:e8efeeb718ab 1609:0d961dc6f58f
  2960             if isinstance(block, SFC_Step):
  2960             if isinstance(block, SFC_Step):
  2961                 choices.append(block.GetName())
  2961                 choices.append(block.GetName())
  2962         dialog = wx.SingleChoiceDialog(self.ParentWindow,
  2962         dialog = wx.SingleChoiceDialog(self.ParentWindow,
  2963               _("Edit jump target"), _("Please choose a target"),
  2963               _("Edit jump target"), _("Please choose a target"),
  2964               choices, wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
  2964               choices, wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
  2965         dialog.SetSelection(choices.index(jump.GetTarget()))
  2965         try:
       
  2966             indx = choices.index(jump.GetTarget())
       
  2967             dialog.SetSelection(indx)
       
  2968         except ValueError:
       
  2969             pass
       
  2970 
  2966         if dialog.ShowModal() == wx.ID_OK:
  2971         if dialog.ShowModal() == wx.ID_OK:
  2967             value = dialog.GetStringSelection()
  2972             value = dialog.GetStringSelection()
  2968             rect = jump.GetRedrawRect(1, 1)
  2973             rect = jump.GetRedrawRect(1, 1)
  2969             jump.SetTarget(value)
  2974             jump.SetTarget(value)
  2970             rect = rect.Union(jump.GetRedrawRect())
  2975             rect = rect.Union(jump.GetRedrawRect())