dialogs/SFCTransitionDialog.py
changeset 1768 691083b5682a
parent 1745 f9d32913bad4
child 1782 5b6ad7a7fd9d
equal deleted inserted replaced
1767:c74815729afd 1768:691083b5682a
    47         @param tagname: Tagname of project POU edited
    47         @param tagname: Tagname of project POU edited
    48         @param connection: True if transition value can be defined by a
    48         @param connection: True if transition value can be defined by a
    49         connection (default: True)
    49         connection (default: True)
    50         """
    50         """
    51         BlockPreviewDialog.__init__(self, parent, controller, tagname,
    51         BlockPreviewDialog.__init__(self, parent, controller, tagname,
    52               title=_('Edit transition'))
    52                                     title=_('Edit transition'))
    53 
    53 
    54         # Init common sizers
    54         # Init common sizers
    55         self._init_sizers(2, 0, 8, None, 2, 1)
    55         self._init_sizers(2, 0, 8, None, 2, 1)
    56 
    56 
    57         # Create label for transition type
    57         # Create label for transition type
    74         first = True
    74         first = True
    75         for type, label, control in [('reference', _('Reference'), reference),
    75         for type, label, control in [('reference', _('Reference'), reference),
    76                                      ('inline', _('Inline'), inline),
    76                                      ('inline', _('Inline'), inline),
    77                                      ('connection', _('Connection'), None)]:
    77                                      ('connection', _('Connection'), None)]:
    78             radio_button = wx.RadioButton(self, label=label,
    78             radio_button = wx.RadioButton(self, label=label,
    79                   style=(wx.RB_GROUP if first else 0))
    79                                           style=(wx.RB_GROUP if first else 0))
    80             radio_button.SetValue(first)
    80             radio_button.SetValue(first)
    81             self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
    81             self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
    82             self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
    82             self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
    83             if control is not None:
    83             if control is not None:
    84                 control.Enable(first)
    84                 control.Enable(first)
    98         # Add preview panel and associated label to sizers
    98         # Add preview panel and associated label to sizers
    99         self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
    99         self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
   100         self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
   100         self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
   101 
   101 
   102         # Add buttons sizer to sizers
   102         # Add buttons sizer to sizers
   103         self.MainSizer.AddSizer(self.ButtonSizer, border=20,
   103         self.MainSizer.AddSizer(
   104               flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
   104             self.ButtonSizer, border=20,
       
   105             flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
   105 
   106 
   106         self.Fit()
   107         self.Fit()
   107 
   108 
   108         # Reference radio button is default control having keyboard focus
   109         # Reference radio button is default control having keyboard focus
   109         self.TypeRadioButtons["reference"][0].SetFocus()
   110         self.TypeRadioButtons["reference"][0].SetFocus()