Пример #1
0
 def _create_background_pickers(self, colors_sizer):
     row = 0
     for key, label in (('background assign',
                         'Variable Background'), ('background keyword',
                                                  'Keyword Background'),
                        ('background mandatory',
                         'Mandatory Field Background'),
                        ('background optional',
                         'Optional Field Background'),
                        ('background must be empty',
                         'Mandatory Empty Field Background'),
                        ('background unknown', 'Unknown Background'),
                        ('background error',
                         'Error Background'), ('background highlight',
                                               'Highlight Background')):
         lbl = wx.StaticText(self, wx.ID_ANY, label)
         btn = widgets.PreferencesColorPicker(self, wx.ID_ANY,
                                              self._settings, key)
         colors_sizer.Add(btn, (row, 2),
                          flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                          border=4)
         colors_sizer.Add(lbl, (row, 3),
                          flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT,
                          border=4)
         row += 1
Пример #2
0
 def create_colors_sizer(self):
     container = wx.GridBagSizer()
     column = 0
     row = 0
     for settings_key, label_text in (
         ('argument', 'Argument foreground'),
         ('comment', 'Comment foreground'),
         ('error', 'Error foreground'),
         ('gherkin', 'Gherkin keyword foreground'),
         ('heading', 'Heading foreground'),
         ('import', 'Import foreground'),
         ('variable', 'Variable foreground'),
         ('tc_kw_name', 'Keyword definition foreground'),
         ('separator', 'Separator'),
         ('setting', 'Setting foreground'),
         ('syntax', 'Syntax characters'),
         ('background', 'Text background'),
     ):
         if column == 4:
             column = 0
             row += 1
         label = wx.StaticText(self, wx.ID_ANY, label_text)
         button = widgets.PreferencesColorPicker(self, wx.ID_ANY,
                                                 self._settings,
                                                 settings_key)
         container.Add(button, (row, column),
                       flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                       border=4)
         self._color_pickers.append(button)
         column += 1
         container.Add(label, (row, column),
                       flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT,
                       border=8)
         column += 1
     return container
Пример #3
0
 def create_colors_sizer(self):
     container = wx.GridBagSizer()
     row = 0
     column = 0
     for settings_key, label_text in (
         ('foreground', 'Text foreground'),
         ('background', 'Text background'),
         ('error', 'Error foreground'),
     ):
         if column == 4:
             column = 0
             row += 1
         label = wx.StaticText(self, wx.ID_ANY, label_text)
         button = widgets.PreferencesColorPicker(self, wx.ID_ANY,
                                                 self._settings,
                                                 settings_key)
         container.Add(button, (row, column),
                       flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                       border=4)
         self._color_pickers.append(button)
         column += 1
         container.Add(label, (row, column),
                       flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT,
                       border=8)
         column += 1
     return container
Пример #4
0
 def _create_foreground_pickers(self, colors_sizer):
     row = 0
     for key, label in (
         ('text user keyword', 'User Keyword Foreground'),
         ('text library keyword', 'Library Keyword Foreground'),
         ('text commented', 'Comments Foreground'),
         ('text variable', 'Variable Foreground'),
         ('text string', 'Default Foreground'),
         ('text empty', 'Empty Foreground'),
     ):
         lbl = wx.StaticText(self, wx.ID_ANY, label)
         btn = widgets.PreferencesColorPicker(
             self, wx.ID_ANY, self._settings, key)
         colors_sizer.Add(btn, (row, 0),
                          flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=4)
         colors_sizer.Add(lbl, (row, 1),
                          flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=4)
         row += 1