def __add_tool_bar(self): self.frame_toolbar = wx.ToolBar(self, -1, style=wx.TB_HORIZONTAL | wx.TB_TEXT) self.SetToolBar(self.frame_toolbar) description = {'Open': "Open previously queried data", 'Close': "Clear queried data", 'Save': "Save queried data", # 'Print': "Print a report", 'Export': "Export data to CSV", 'Import': "DICOM import wizard", 'Settings': "User Settings", 'Database': "Database Administrator Tools", 'ROI Map': "Define ROI name aliases"} for key in self.toolbar_keys: bitmap = wx.Bitmap(ICONS[key], wx.BITMAP_TYPE_ANY) if is_windows() or is_linux(): bitmap = scale_bitmap(bitmap, 30, 30) self.frame_toolbar.AddTool(self.toolbar_ids[key], key, bitmap, wx.NullBitmap, wx.ITEM_NORMAL, description[key], "") if key in {'Close', 'Export', 'ROI Map'}: self.frame_toolbar.AddSeparator() self.Bind(wx.EVT_TOOL, self.on_save, id=self.toolbar_ids['Save']) self.Bind(wx.EVT_TOOL, self.on_open, id=self.toolbar_ids['Open']) self.Bind(wx.EVT_TOOL, self.on_export, id=self.toolbar_ids['Export']) self.Bind(wx.EVT_TOOL, self.on_toolbar_database, id=self.toolbar_ids['Database']) self.Bind(wx.EVT_TOOL, self.on_toolbar_settings, id=self.toolbar_ids['Settings']) self.Bind(wx.EVT_TOOL, self.on_toolbar_roi_map, id=self.toolbar_ids['ROI Map']) self.Bind(wx.EVT_TOOL, self.on_close, id=self.toolbar_ids['Close']) self.Bind(wx.EVT_TOOL, self.on_toolbar_import, id=self.toolbar_ids['Import'])
def OnInit(self): initialize_directories_and_settings() if is_windows(): from dvha.tools.windows_reg_edit import set_ie_emulation_level set_ie_emulation_level() self.SetAppName('DVH Analytics') self.frame = DVHAMainFrame(None, wx.ID_ANY, "") self.SetTopWindow(self.frame) self.frame.Show() return True
def __set_properties(self): self.combo_box_uncategorized_ignored.SetSelection(0) self.button_uncategorized_ignored_ignore.SetMinSize((110, 20)) self.combo_box_physician.SetValue('DEFAULT') self.update_physician_rois() self.update_variations() self.combo_box_physician.SetValue('DEFAULT') self.combo_box_tree_plot_data.SetValue('ALL') self.update_uncategorized_ignored_choices() self.window_tree.SetBackgroundColour('white') for button in self.button_physician.values(): button.SetMaxSize((25, 25)) for button in self.button_physician_roi.values(): button.SetMaxSize((25, 25)) self.update_physician_enable() self.update_merge_physician_rois() if is_windows( ): # combo_boxes here display a doubled bottom border on MSW combo_boxes = [ self.combo_box_physician, self.combo_box_physician_roi, self.combo_box_uncategorized_ignored, self.combo_box_uncategorized_ignored_roi, self.combo_box_physician_roi_merge['a'], self.combo_box_physician_roi_merge['b'] ] for combo_box in combo_boxes: combo_box.SetMinSize((combo_box.GetSize()[0], 26)) self.button_uncategorized_ignored_ignore.SetMinSize( (self.button_uncategorized_ignored_ignore.GetSize()[0], self.button_uncategorized_ignored_delete.GetSize()[1])) self.data_table_tg263.set_data(self.roi_map_gen.tg_263, columns=self.roi_map_gen.keys) self.data_table_tg263.set_column_widths(auto=True) for combo_box in self.combo_box_tg263.values(): combo_box.SetValue('All') # These combo_boxes get a height of 30 since adding TG263 combo_boxes? for combo_box in self.combo_box_physician_roi_merge.values(): combo_box.SetMaxSize((1000, 26))