dialogs/SFCTransitionDialog.py
branchwxPython4
changeset 3303 0ffb41625592
parent 2591 5f685bcd3ad6
child 3750 f62625418bff
equal deleted inserted replaced
3302:c89fc366bebd 3303:0ffb41625592
    55         # Init common sizers
    55         # Init common sizers
    56         self._init_sizers(2, 0, 8, None, 2, 1)
    56         self._init_sizers(2, 0, 8, None, 2, 1)
    57 
    57 
    58         # Create label for transition type
    58         # Create label for transition type
    59         type_label = wx.StaticText(self, label=_('Type:'))
    59         type_label = wx.StaticText(self, label=_('Type:'))
    60         self.LeftGridSizer.AddWindow(type_label, flag=wx.GROW)
    60         self.LeftGridSizer.Add(type_label, flag=wx.GROW)
    61 
    61 
    62         # Create combo box for selecting reference value
    62         # Create combo box for selecting reference value
    63         reference = wx.ComboBox(self, style=wx.CB_READONLY)
    63         reference = wx.ComboBox(self, style=wx.CB_READONLY)
    64         reference.Append("")
    64         reference.Append("")
    65         for transition in controller.GetEditedElementTransitions(tagname):
    65         for transition in controller.GetEditedElementTransitions(tagname):
    78                                      ('connection', _('Connection'), None)]:
    78                                      ('connection', _('Connection'), None)]:
    79             radio_button = wx.RadioButton(self, label=label,
    79             radio_button = wx.RadioButton(self, label=label,
    80                                           style=(wx.RB_GROUP if first else 0))
    80                                           style=(wx.RB_GROUP if first else 0))
    81             radio_button.SetValue(first)
    81             radio_button.SetValue(first)
    82             self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
    82             self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
    83             self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
    83             self.LeftGridSizer.Add(radio_button, flag=wx.GROW)
    84             if control is not None:
    84             if control is not None:
    85                 control.Enable(first)
    85                 control.Enable(first)
    86                 self.LeftGridSizer.AddWindow(control, flag=wx.GROW)
    86                 self.LeftGridSizer.Add(control, flag=wx.GROW)
    87             self.TypeRadioButtons[type] = (radio_button, control)
    87             self.TypeRadioButtons[type] = (radio_button, control)
    88             first = False
    88             first = False
    89 
    89 
    90         # Create label for transition priority
    90         # Create label for transition priority
    91         priority_label = wx.StaticText(self, label=_('Priority:'))
    91         priority_label = wx.StaticText(self, label=_('Priority:'))
    92         self.LeftGridSizer.AddWindow(priority_label, flag=wx.GROW)
    92         self.LeftGridSizer.Add(priority_label, flag=wx.GROW)
    93 
    93 
    94         # Create spin control for defining priority value
    94         # Create spin control for defining priority value
    95         self.Priority = wx.SpinCtrl(self, min=0, style=wx.SP_ARROW_KEYS)
    95         self.Priority = wx.SpinCtrl(self, min=0, style=wx.SP_ARROW_KEYS)
    96         self.Bind(wx.EVT_TEXT, self.OnPriorityChanged, self.Priority)
    96         self.Bind(wx.EVT_TEXT, self.OnPriorityChanged, self.Priority)
    97         self.LeftGridSizer.AddWindow(self.Priority, flag=wx.GROW)
    97         self.LeftGridSizer.Add(self.Priority, flag=wx.GROW)
    98 
    98 
    99         # Add preview panel and associated label to sizers
    99         # Add preview panel and associated label to sizers
   100         self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
   100         self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
   101         self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
   101         self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
   102 
   102 
   103         # Add buttons sizer to sizers
   103         # Add buttons sizer to sizers
   104         self.MainSizer.AddSizer(
   104         self.MainSizer.Add(
   105             self.ButtonSizer, border=20,
   105             self.ButtonSizer, border=20,
   106             flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
   106             flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
   107 
   107 
   108         self.Fit()
   108         self.Fit()
   109 
   109