dialogs/LDElementDialog.py
changeset 1696 8043f32de7b8
parent 1571 486f94a8032c
child 1698 ae3e819252fc
equal deleted inserted replaced
1695:a63bb4025852 1696:8043f32de7b8
     3 
     3 
     4 # This file is part of Beremiz, a Integrated Development Environment for
     4 # This file is part of Beremiz, a Integrated Development Environment for
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
     6 #
     6 #
     7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
     7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
       
     8 # Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
     8 #
     9 #
     9 # See COPYING file for copyrights details.
    10 # See COPYING file for copyrights details.
    10 #
    11 #
    11 # This program is free software; you can redistribute it and/or
    12 # This program is free software; you can redistribute it and/or
    12 # modify it under the terms of the GNU General Public License
    13 # modify it under the terms of the GNU General Public License
    48         @param controller: Reference to project controller
    49         @param controller: Reference to project controller
    49         @param tagname: Tagname of project POU edited
    50         @param tagname: Tagname of project POU edited
    50         @param type: Type of LD element ('contact or 'coil')
    51         @param type: Type of LD element ('contact or 'coil')
    51         """
    52         """
    52         BlockPreviewDialog.__init__(self, parent, controller, tagname, 
    53         BlockPreviewDialog.__init__(self, parent, controller, tagname, 
    53               size=wx.Size(350, 320 if type == "contact" else 380),
       
    54               title=(_("Edit Contact Values")
    54               title=(_("Edit Contact Values")
    55                      if type == "contact"
    55                      if type == "contact"
    56                      else _("Edit Coil Values")))
    56                      else _("Edit Coil Values")))
    57         
    57         
    58         # Init common sizers
    58         # Init common sizers
   116             # Only select BOOL variable and avoid input for coil
   116             # Only select BOOL variable and avoid input for coil
   117             if (type == "contact" or var_type != "Input") and \
   117             if (type == "contact" or var_type != "Input") and \
   118                value_type == "BOOL":
   118                value_type == "BOOL":
   119                 self.ElementVariable.Append(name)
   119                 self.ElementVariable.Append(name)
   120         
   120         
       
   121         self.Fit()
   121         # Normal radio button is default control having keyboard focus
   122         # Normal radio button is default control having keyboard focus
   122         self.ModifierRadioButtons[element_modifiers[0]].SetFocus()
   123         self.ModifierRadioButtons[element_modifiers[0]].SetFocus()
   123     
   124     
   124     def GetElementModifier(self):
   125     def GetElementModifier(self):
   125         """
   126         """