18 from wx.lib.mixins.listctrl
import TextEditMixin
20 from ..editor.listeditor
import AutoWidthColumnList, ListEditorBase
21 from ..widgets
import RIDEDialog, HelpLabel, ButtonWithHandler
26 _CONFIG_HELP =
"""The specified command string will be split from whitespaces into a command
27 and its arguments. If either the command or any of the arguments require
28 internal spaces, they must be written as '<SPACE>'.\n
29 The command will be executed in the system directly without opening a shell.
30 This means that shell commands and extensions are not available. For example,
31 in Windows batch files to execute must contain the '.bat' extension and 'dir'
32 command does not work.\n
34 robot.bat --include smoke C:\\my_tests
35 svn update /home/robot
36 C:\\Program<SPACE>Files\\App\\prg.exe argument<SPACE>with<SPACE>space,
37 Run configurations are stored in the RIDE settings file.
44 RIDEDialog.__init__(self, title=
'Manage Run Configurations')
47 self.SetBackgroundColour(Colour(self.color_background))
48 self.SetOwnBackgroundColour(Colour(self.color_background))
49 self.SetForegroundColour(Colour(self.color_foreground))
50 self.SetOwnForegroundColour(Colour(self.color_foreground))
52 self.SetLayoutDirection(wx.Layout_LeftToRight)
57 self.SetSizer(wx.BoxSizer(wx.VERTICAL))
62 self.SetSize((750, 400))
66 self.Sizer.Add(editor, flag=wx.GROW, proportion=1)
70 help = HelpLabel(self, label=_CONFIG_HELP)
72 self.Sizer.Add(help, border=5, flag=wx.TOP)
75 line = wx.StaticLine(self, size=(20, -1), style=wx.LI_HORIZONTAL)
76 if wx.VERSION < (4, 1, 0):
77 self.Sizer.Add(line, border=5, flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP)
79 self.Sizer.Add(line, border=5, flag=wx.GROW | wx.RIGHT | wx.TOP)
82 buttons = self.CreateStdDialogButtonSizer(wx.OK|wx.CANCEL)
83 self.SetBackgroundColour(Colour(self.color_background))
84 self.SetForegroundColour(Colour(self.color_foreground))
85 for item
in self.GetChildren():
86 if isinstance(item, (wx.Button, wx.BitmapButton, ButtonWithHandler)):
87 item.SetBackgroundColour(Colour(self.color_secondary_background))
88 item.SetOwnBackgroundColour(Colour(self.color_secondary_background))
89 item.SetForegroundColour(Colour(self.color_secondary_foreground))
90 item.SetOwnForegroundColour(Colour(self.color_secondary_foreground))
91 self.Sizer.Add(buttons, flag=wx.ALIGN_CENTER | wx.ALL, border=5)
101 _buttons = [
'New',
'Remove']
105 _columns = [
'Name',
'Command',
'Documentation']
109 ListEditorBase.__init__(self, parent, self.
_columns_columns, configs)
116 return config.name, config.command, config.doc
125 self.
_list_list.new_item()
138 ListEditorBase.OnDelete(self, event)
148 last_index = property(
lambda self: self.ItemCount - 1)
150 def __init__(self, parent, columns, color_foreground, color_background, data):
151 AutoWidthColumnList.__init__(self, parent, columns, color_foreground=color_foreground,
152 color_background=color_background, data=data)
153 TextEditMixin.__init__(self)
155 self.SetBackgroundColour(Colour(color_background))
156 self.SetForegroundColour(Colour(color_foreground))
163 self.SetColumnWidth(1, 250)
175 for n
in range(self.GetColumnCount()):
176 loc = loc + self.GetColumnWidth(n)
177 locations.append(loc)
184 self.
_parent_parent.editor_open()
185 TextEditMixin.OpenEditor(self, col, row)
189 self.InsertItem(self.ItemCount,
'')
190 self.Select(self.ItemCount-1,
True)
194 return [ self.
_get_row_get_row(row)
for row
in range(self.ItemCount) ]
197 return [ self.GetItem(row, col).GetText()
for col
in range(3)]
200 TextEditMixin.CloseEditor(self, event)
208 self.Parent.new_config(lastrow)
210 self.Parent.edit_config(self.curRow, self.
_get_row_get_row(self.curRow))
211 self.Select(self.curRow)
212 self.
_parent_parent.editor_closed()
color_secondary_background
color_secondary_foreground
def OnDelete(self, event)
def _create_buttons(self)
def _create_ui(self, configs)
def _create_editor(self, configs)
def __init__(self, configs, plugin)
def edit_config(self, index, data)
def OnDelete(self, event)
def __init__(self, parent, configs)
def new_config(self, data)
def OnRemove(self, event)
def _create_list(self, columns, data)
def get_column_values(self, config)
def OpenEditor(self, col, row)
def CloseEditor(self, event=None)
def open_editor(self, row)
def __init__(self, parent, columns, color_foreground, color_background, data)
def _calculate_col_locs(self)
Calculates and returns initial locations of colums.
def _set_command_column_width(self)