editors/TextViewer.py
changeset 1578 f8e2a04c4445
parent 1571 486f94a8032c
child 1613 41ca586da9dc
equal deleted inserted replaced
1577:6a3c29fdcfea 1578:f8e2a04c4445
   287                 if len(values) > 2 and pou_type == "program":
   287                 if len(values) > 2 and pou_type == "program":
   288                     var_name = values[3]
   288                     var_name = values[3]
   289                     dlg = wx.TextEntryDialog(
   289                     dlg = wx.TextEntryDialog(
   290                         self.ParentWindow,
   290                         self.ParentWindow,
   291                         _("Confirm or change variable name"),
   291                         _("Confirm or change variable name"),
   292                         'Variable Drop', var_name)
   292                         _('Variable Drop'), var_name)
   293                     dlg.SetValue(var_name)
   293                     dlg.SetValue(var_name)
   294                     var_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None
   294                     var_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None
   295                     dlg.Destroy()
   295                     dlg.Destroy()
   296                     if var_name is None:
   296                     if var_name is None:
   297                         return
   297                         return
   302                     else:
   302                     else:
   303                         location = values[0]
   303                         location = values[0]
   304                         if not location.startswith("%"):
   304                         if not location.startswith("%"):
   305                             dialog = wx.SingleChoiceDialog(self.ParentWindow,
   305                             dialog = wx.SingleChoiceDialog(self.ParentWindow,
   306                                   _("Select a variable class:"), _("Variable class"),
   306                                   _("Select a variable class:"), _("Variable class"),
   307                                   ["Input", "Output", "Memory"],
   307                                   [_("Input"), _("Output"), _("Memory")],
   308                                   wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
   308                                   wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
   309                             if dialog.ShowModal() == wx.ID_OK:
   309                             if dialog.ShowModal() == wx.ID_OK:
   310                                 selected = dialog.GetSelection()
   310                                 selected = dialog.GetSelection()
   311                             else:
   311                             else:
   312                                 selected = None
   312                                 selected = None
   338                     initval = values[0]
   338                     initval = values[0]
   339                     var_name = values[3]
   339                     var_name = values[3]
   340                     dlg = wx.TextEntryDialog(
   340                     dlg = wx.TextEntryDialog(
   341                         self.ParentWindow,
   341                         self.ParentWindow,
   342                         _("Confirm or change variable name"),
   342                         _("Confirm or change variable name"),
   343                         'Variable Drop', var_name)
   343                         _('Variable Drop'), var_name)
   344                     dlg.SetValue(var_name)
   344                     dlg.SetValue(var_name)
   345                     var_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None
   345                     var_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None
   346                     dlg.Destroy()
   346                     dlg.Destroy()
   347                     if var_name is None:
   347                     if var_name is None:
   348                         return
   348                         return
   361             elif values[1] == "Global":
   361             elif values[1] == "Global":
   362                 var_name = values[0]
   362                 var_name = values[0]
   363                 dlg = wx.TextEntryDialog(
   363                 dlg = wx.TextEntryDialog(
   364                     self.ParentWindow,
   364                     self.ParentWindow,
   365                     _("Confirm or change variable name"),
   365                     _("Confirm or change variable name"),
   366                     'Variable Drop', var_name)
   366                     _('Variable Drop'), var_name)
   367                 dlg.SetValue(var_name)
   367                 dlg.SetValue(var_name)
   368                 var_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None
   368                 var_name = dlg.GetValue() if dlg.ShowModal() == wx.ID_OK else None
   369                 dlg.Destroy()
   369                 dlg.Destroy()
   370                 if var_name is None:
   370                 if var_name is None:
   371                     return
   371                     return