Viewer.py
changeset 720 2a9d4eafaddd
parent 716 2681a6da58d6
child 735 99699ca6eda4
equal deleted inserted replaced
719:bc2e98641bdd 720:2a9d4eafaddd
   261                         self.ParentWindow.Refresh(False)
   261                         self.ParentWindow.Refresh(False)
   262             elif values[1] == "location":
   262             elif values[1] == "location":
   263                 if pou_type == "program":
   263                 if pou_type == "program":
   264                     location = values[0]
   264                     location = values[0]
   265                     if not location.startswith("%"):
   265                     if not location.startswith("%"):
   266                         dialog = wx.SingleChoiceDialog(self.ParentWindow, _("Select a variable class:"), _("Variable class"), ["Input", "Output", "Memory"], wx.OK|wx.CANCEL)
   266                         dialog = wx.SingleChoiceDialog(self.ParentWindow, 
       
   267                               _("Select a variable class:"), _("Variable class"), 
       
   268                               ["Input", "Output", "Memory"], 
       
   269                               wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
   267                         if dialog.ShowModal() == wx.ID_OK:
   270                         if dialog.ShowModal() == wx.ID_OK:
   268                             selected = dialog.GetSelection()
   271                             selected = dialog.GetSelection()
   269                         else:
   272                         else:
   270                             selected = None
   273                             selected = None
   271                         dialog.Destroy()
   274                         dialog.Destroy()
  2230     def AddNewJump(self, bbox):
  2233     def AddNewJump(self, bbox):
  2231         choices = []
  2234         choices = []
  2232         for block in self.Blocks.itervalues():
  2235         for block in self.Blocks.itervalues():
  2233             if isinstance(block, SFC_Step):
  2236             if isinstance(block, SFC_Step):
  2234                 choices.append(block.GetName())
  2237                 choices.append(block.GetName())
  2235         dialog = wx.SingleChoiceDialog(self.ParentWindow, _("Add a new jump"), _("Please choose a target"), choices, wx.OK|wx.CANCEL)
  2238         dialog = wx.SingleChoiceDialog(self.ParentWindow, 
       
  2239               _("Add a new jump"), _("Please choose a target"), 
       
  2240               choices, wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
  2236         if dialog.ShowModal() == wx.ID_OK:
  2241         if dialog.ShowModal() == wx.ID_OK:
  2237             id = self.GetNewId()
  2242             id = self.GetNewId()
  2238             value = dialog.GetStringSelection()
  2243             value = dialog.GetStringSelection()
  2239             jump = SFC_Jump(self, value, id)
  2244             jump = SFC_Jump(self, value, id)
  2240             jump.SetPosition(bbox.x, bbox.y)
  2245             jump.SetPosition(bbox.x, bbox.y)
  2533     def EditJumpContent(self, jump):
  2538     def EditJumpContent(self, jump):
  2534         choices = []
  2539         choices = []
  2535         for block in self.Blocks.itervalues():
  2540         for block in self.Blocks.itervalues():
  2536             if isinstance(block, SFC_Step):
  2541             if isinstance(block, SFC_Step):
  2537                 choices.append(block.GetName())
  2542                 choices.append(block.GetName())
  2538         dialog = wx.SingleChoiceDialog(self.ParentWindow, _("Edit jump target"), _("Please choose a target"), choices, wx.OK|wx.CANCEL)
  2543         dialog = wx.SingleChoiceDialog(self.ParentWindow, 
       
  2544               _("Edit jump target"), _("Please choose a target"), 
       
  2545               choices, wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
  2539         dialog.SetSelection(choices.index(jump.GetTarget()))
  2546         dialog.SetSelection(choices.index(jump.GetTarget()))
  2540         if dialog.ShowModal() == wx.ID_OK:
  2547         if dialog.ShowModal() == wx.ID_OK:
  2541             value = dialog.GetStringSelection()
  2548             value = dialog.GetStringSelection()
  2542             rect = jump.GetRedrawRect(1, 1)
  2549             rect = jump.GetRedrawRect(1, 1)
  2543             jump.SetTarget(value)
  2550             jump.SetTarget(value)