Set the initial properties for the various widgets. :param `dark_toggle`: Boolean indicating if only the properties related to the colour scheme should be set or everything.
(self, dark_toggle=None)
| 268 | self.__do_layout() |
| 269 | |
| 270 | def __set_properties(self, dark_toggle=None): |
| 271 | ''' |
| 272 | Set the initial properties for the various widgets. |
| 273 | |
| 274 | :param `dark_toggle`: Boolean indicating if only the properties |
| 275 | related to the colour scheme should be set or everything. |
| 276 | ''' |
| 277 | # Colour Scheme Dictionaries |
| 278 | self.dark_dict = config.DARK_MODE |
| 279 | self.normal_dict = config.NORMAL_MODE |
| 280 | |
| 281 | # Colour Scheme |
| 282 | if not self.options.Get("DarkMode", False): |
| 283 | self.bg_colour = self.normal_dict["BG"] |
| 284 | self.txt_colour = self.normal_dict["TXT"] |
| 285 | self.lne_colour = self.normal_dict["LNE"] |
| 286 | self.lbl_colour = self.normal_dict["LBL"] |
| 287 | self.hl1_colour = self.normal_dict["HL1"] |
| 288 | self.hl2_colour = self.normal_dict["HL2"] |
| 289 | self.hl3_colour = self.normal_dict["HL3"] |
| 290 | else: |
| 291 | self.bg_colour = self.dark_dict["BG"] |
| 292 | self.txt_colour = self.dark_dict["TXT"] |
| 293 | self.lne_colour = self.dark_dict["LNE"] |
| 294 | self.lbl_colour = self.dark_dict["LBL"] |
| 295 | self.hl1_colour = self.dark_dict["HL1"] |
| 296 | self.hl2_colour = self.dark_dict["HL2"] |
| 297 | self.hl3_colour = self.dark_dict["HL3"] |
| 298 | |
| 299 | # Set default colors |
| 300 | self.SetBackgroundColour(self.bg_colour) |
| 301 | self.SetForegroundColour(self.txt_colour) |
| 302 | self.grid.SetDefaultCellBackgroundColour(self.bg_colour) |
| 303 | self.grid.SetDefaultCellTextColour(self.txt_colour) |
| 304 | self.grid.SetGridLineColour(self.lne_colour) |
| 305 | self.grid.SetLabelBackgroundColour(self.bg_colour) |
| 306 | self.grid.SetLabelTextColour(self.lbl_colour) |
| 307 | self.status_label.SetForegroundColour(self.lbl_colour) |
| 308 | |
| 309 | # Do not reset window size etc. if only changing colour scheme. |
| 310 | if dark_toggle: |
| 311 | return |
| 312 | |
| 313 | self.SetTitle(config.GUI_TITLE) |
| 314 | self.SetSize((720, 400)) |
| 315 | self.SetMenuBar(self.menubar) |
| 316 | # Insert columns based on parameters provided in col_def |
| 317 | |
| 318 | # self.grid.CreateGrid(0, 0) |
| 319 | if self.grid.GetNumberCols() < len(self.columns): |
| 320 | self.grid.AppendCols(len(self.columns)) |
| 321 | self.grid.SetColLabelSize(self.grid.GetDefaultRowSize() + 2) |
| 322 | self.grid.SetRowLabelSize(0) |
| 323 | self.grid.EnableEditing(0) |
| 324 | self.grid.DisableCellEditControl() |
| 325 | self.grid.EnableDragRowSize(0) |
| 326 | self.grid.EnableDragGridSize(0) |
| 327 | self.grid.SetSelectionMode(wx.grid.Grid.SelectRows) |
no test coverage detected