dialogs/SFCDivergenceDialog.py
branchwxPython4
changeset 3303 0ffb41625592
parent 2591 5f685bcd3ad6
child 3750 f62625418bff
equal deleted inserted replaced
3302:c89fc366bebd 3303:0ffb41625592
    56         # Init common sizers
    56         # Init common sizers
    57         self._init_sizers(2, 0, 7, None, 2, 1)
    57         self._init_sizers(2, 0, 7, None, 2, 1)
    58 
    58 
    59         # Create label for divergence type
    59         # Create label for divergence type
    60         type_label = wx.StaticText(self, label=_('Type:'))
    60         type_label = wx.StaticText(self, label=_('Type:'))
    61         self.LeftGridSizer.AddWindow(type_label, flag=wx.GROW)
    61         self.LeftGridSizer.Add(type_label, flag=wx.GROW)
    62 
    62 
    63         # Create radio buttons for selecting divergence type
    63         # Create radio buttons for selecting divergence type
    64         divergence_buttons = [
    64         divergence_buttons = [
    65             (SELECTION_DIVERGENCE, _('Selection Divergence')),
    65             (SELECTION_DIVERGENCE, _('Selection Divergence')),
    66             (SELECTION_CONVERGENCE, _('Selection Convergence')),
    66             (SELECTION_CONVERGENCE, _('Selection Convergence')),
    78         for type, label in poss_div_btns:
    78         for type, label in poss_div_btns:
    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             self.TypeRadioButtons[type] = radio_button
    84             self.TypeRadioButtons[type] = radio_button
    85             if first:
    85             if first:
    86                 focusbtn = type
    86                 focusbtn = type
    87             first = False
    87             first = False
    88 
    88 
    89         # Create label for number of divergence sequences
    89         # Create label for number of divergence sequences
    90         sequences_label = wx.StaticText(self,
    90         sequences_label = wx.StaticText(self,
    91                                         label=_('Number of sequences:'))
    91                                         label=_('Number of sequences:'))
    92         self.LeftGridSizer.AddWindow(sequences_label, flag=wx.GROW)
    92         self.LeftGridSizer.Add(sequences_label, flag=wx.GROW)
    93 
    93 
    94         # Create spin control for defining number of divergence sequences
    94         # Create spin control for defining number of divergence sequences
    95         self.Sequences = wx.SpinCtrl(self, min=2, max=20, initial=2)
    95         self.Sequences = wx.SpinCtrl(self, min=2, max=20, initial=2)
    96         self.Bind(wx.EVT_SPINCTRL, self.OnSequencesChanged, self.Sequences)
    96         self.Bind(wx.EVT_SPINCTRL, self.OnSequencesChanged, self.Sequences)
    97         self.LeftGridSizer.AddWindow(self.Sequences, flag=wx.GROW)
    97         self.LeftGridSizer.Add(self.Sequences, 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