130 |
130 |
131 top_sizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0) |
131 top_sizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0) |
132 top_sizer.AddGrowableCol(0) |
132 top_sizer.AddGrowableCol(0) |
133 top_sizer.AddGrowableRow(0) |
133 top_sizer.AddGrowableRow(0) |
134 main_sizer.AddSizer(top_sizer, border=20, |
134 main_sizer.AddSizer(top_sizer, border=20, |
135 flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) |
135 flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) |
136 |
136 |
137 actions_label = wx.StaticText(self, label=_('Actions:')) |
137 actions_label = wx.StaticText(self, label=_('Actions:')) |
138 top_sizer.AddWindow(actions_label, flag=wx.ALIGN_BOTTOM) |
138 top_sizer.AddWindow(actions_label, flag=wx.ALIGN_BOTTOM) |
139 |
139 |
140 for name, bitmap, help in [ |
140 for name, bitmap, help in [ |
141 ("AddButton", "add_element", _("Add action")), |
141 ("AddButton", "add_element", _("Add action")), |
142 ("DeleteButton", "remove_element", _("Remove action")), |
142 ("DeleteButton", "remove_element", _("Remove action")), |
143 ("UpButton", "up", _("Move action up")), |
143 ("UpButton", "up", _("Move action up")), |
144 ("DownButton", "down", _("Move action down"))]: |
144 ("DownButton", "down", _("Move action down"))]: |
145 button = wx.lib.buttons.GenBitmapButton(self, bitmap=GetBitmap(bitmap), |
145 button = wx.lib.buttons.GenBitmapButton( |
146 size=wx.Size(28, 28), style=wx.NO_BORDER) |
146 self, bitmap=GetBitmap(bitmap), |
|
147 size=wx.Size(28, 28), style=wx.NO_BORDER) |
147 button.SetToolTipString(help) |
148 button.SetToolTipString(help) |
148 setattr(self, name, button) |
149 setattr(self, name, button) |
149 top_sizer.AddWindow(button) |
150 top_sizer.AddWindow(button) |
150 |
151 |
151 self.ActionsGrid = CustomGrid(self, size=wx.Size(-1, 250), style=wx.VSCROLL) |
152 self.ActionsGrid = CustomGrid(self, size=wx.Size(-1, 250), style=wx.VSCROLL) |
152 self.ActionsGrid.DisableDragGridSize() |
153 self.ActionsGrid.DisableDragGridSize() |
153 self.ActionsGrid.EnableScrolling(False, True) |
154 self.ActionsGrid.EnableScrolling(False, True) |
154 self.ActionsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, |
155 self.ActionsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, |
155 self.OnActionsGridCellChange) |
156 self.OnActionsGridCellChange) |
156 main_sizer.AddSizer(self.ActionsGrid, border=20, |
157 main_sizer.AddSizer(self.ActionsGrid, border=20, |
157 flag=wx.GROW | wx.LEFT | wx.RIGHT) |
158 flag=wx.GROW | wx.LEFT | wx.RIGHT) |
158 |
159 |
159 button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) |
160 button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) |
160 self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton()) |
161 self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton()) |
161 main_sizer.AddSizer(button_sizer, border=20, |
162 main_sizer.AddSizer(button_sizer, border=20, |
162 flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) |
163 flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) |
163 |
164 |
164 self.SetSizer(main_sizer) |
165 self.SetSizer(main_sizer) |
165 |
166 |
166 self.Table = ActionTable(self, [], GetActionTableColnames()) |
167 self.Table = ActionTable(self, [], GetActionTableColnames()) |
167 typelist = GetTypeList() |
168 typelist = GetTypeList() |