def __init__(self, parent, name=None, appname="the application", filename='preferences.txt'): # Load the XRC file for our gui resources res = XmlResource(util.GetResourcePath('preferences.xrc')) self.dlgPreferences = res.LoadDialog(None, "PreferencesDialog") self.dlgPreferences.Init(name, appname) # Setup internal pubsub methods pub.subscribe(self.SetPreferenceTemplate, 'preferences.updated.template') pub.subscribe(self.SavePreferenceValues, 'preferences.updated.values') # Setup user pubsub methods pub.subscribe(self.GetPreferenceValue, 'preferences.requested.value') pub.subscribe(self.GetPreferenceValues, 'preferences.requested.values') pub.subscribe(self.SetPreferenceValue, 'preferences.updated.value') # Initialize variables self.preftemplate = [] self.values = {} self.filename = os.path.join(guiutil.get_data_dir(), filename) self.LoadPreferenceValues()
def __init__(self, parent): self.parent = parent # Set up pubsub pub.subscribe(self.OnUpdatePatient, 'patient.updated.raw_data') # Load the XRC file for our gui resources self.res = XmlResource(util.GetBasePluginsPath('anonymize.xrc'))
def pluginLoader(parent): """Function to load the plugin.""" # Load the XRC file for our gui resources res = XmlResource(util.GetBasePluginsPath('treeview.xrc')) panelTreeView = res.LoadPanel(parent, 'pluginTreeView') panelTreeView.Init(res) return panelTreeView
def get_progress_dialog(parent, title="Loading..."): """Function to load the progress dialog.""" # Load the XRC file for our gui resources res = XmlResource(util.GetResourcePath('guiutil.xrc')) dialogProgress = res.LoadDialog(parent, 'ProgressDialog') dialogProgress.Init(res, title) return dialogProgress
def pluginLoader(parent): """Function to load the plugin.""" # Load the XRC file for our gui resources res = XmlResource(util.GetBasePluginsPath("dvh.xrc")) panelDVH = res.LoadPanel(parent, "pluginDVH") panelDVH.Init(res) return panelDVH
def __init__(self, parent): self.parent = parent # Set up pubsub pub.subscribe(self.OnUpdatePatient, 'patient.updated.parsed_data') # Load the XRC file for our gui resources xrc = os.path.join(os.path.dirname(__file__), 'Analysis.xrc') self.res = XmlResource(xrc)
def PluginManager(parent, plugins, pluginsDisabled): """Prepare to show the plugin manager dialog.""" # Load the XRC file for our gui resources res = XmlResource(util.GetResourcePath('plugin.xrc')) dlgPluginManager = res.LoadDialog(parent, "PluginManagerDialog") dlgPluginManager.Init(plugins, pluginsDisabled) # Show the dialog dlgPluginManager.ShowModal()
def OnInit(self): # no-op in wxPython2.8 and later: wx.InitAllImageHandlers() wx.GetApp().SetAppName("dicompyler") # Load the XRC file for our gui resources self.res = XmlResource(util.GetResourcePath('main.xrc')) # Use the native listctrl on Mac OS X if guiutil.IsMac(): wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 0) dicompylerFrame = MainFrame(None, -1, "dicompyler", self.res) self.SetTopWindow(dicompylerFrame) dicompylerFrame.Show() return 1
def ImportDicom(parent): """Prepare to show the dialog that will Import DICOM and DICOM RT files.""" # Load the XRC file for our gui resources res = XmlResource(util.GetResourcePath('dicomgui.xrc')) dlgDicomImporter = res.LoadDialog(parent, "DicomImporterDialog") dlgDicomImporter.Init(res) # Show the dialog and return the result if (dlgDicomImporter.ShowModal() == wx.ID_OK): value = dlgDicomImporter.GetPatient() #pub.sendMessage('patient.updated.raw_data', value) else: value = {} # Block until the thread is done before destroying the dialog if dlgDicomImporter: dlgDicomImporter.t.join() dlgDicomImporter.Destroy() return value
def get_resource(): filename = os.path.join(os.getcwd(), os.path.dirname(__file__), 'hachoir_wx.xrc') return XmlResource(filename)