def get_filters(self): return [ ( self.views[i].filter.name, self.checks[i].GetValue(), self.views[i].GetValue() ) for i in filter_view.filter_ids() ]
def BindCallbacks(self): """ Connect up event handlers """ callbacks = [ (wx.EVT_CLOSE, [ (ID_MAIN_FRAME, self.OnClose) ]), (wx.EVT_MENU, [ (wx.ID_EXIT, self.OnExit), (wx.ID_OPEN, self.OnOpen), (wx.ID_SAVE, self.OnSave), (ID_IMPORT_XTALS, self.OnImportXtals), (ID_EXPORT_XTALS, self.OnExportXtals), (wx.ID_ABOUT, self.OnAbout), ]), (wx.EVT_TEXT, [ (ID_DATASET_NAME, self.OnDatasetName), ]), (wx.EVT_BUTTON, [ (ID_READ_ENERGIES, self.OnReadEnergies), (ID_SELECT_EXPOSURES, self.OnSelectExposures), (ID_APPEND_ROW, self.OnAppendRow), (ID_DELETE_ROW, self.OnDeleteRow), (ID_CLEAR_ENERGIES, self.OnClearEnergies), (ID_CLEAR_EXPOSURES, self.OnClearExposures), (ID_CALIBRATE, self.OnCalibrate), (ID_FIND_XTALS, self.OnFindXtals), ]), (wx.EVT_LIST_END_LABEL_EDIT, [ (ID_EXPOSURE_LIST, self.OnListEndLabelEdit), ]), (wx.EVT_SLIDER, [ (ID_EXPOSURE_SLIDER, self.OnExposureSlider), ]), (wx.EVT_CHECKBOX, [ (ID_SHOW_XTALS, self.OnShowXtals), ]), (wx.EVT_RADIOBOX, [ (ID_VIEW_TYPE, self.OnViewType), ]), (wx.EVT_CHOICE, [ (ID_SPECTROMETER, self.OnSpectrometerChange), (ID_DISPERSIVE_DIR, self.OnDispersiveDir), ]), (EVT_RANGE_ACTION_CHANGED, [ (ID_IMAGE_PANEL, self.OnImageAction), ]), (EVT_RANGE_CHANGED, [ (ID_IMAGE_PANEL, self.OnImageXtals), ]), (EVT_COORDS, [ (ID_IMAGE_PANEL, self.OnImageCoords), ]), ] for event, bindings in callbacks: for id, callback in bindings: self.view.Bind(event, callback, id=id) for id in filter_ids(): self.view.Bind(EVT_FILTER_CHANGED, self.OnFilterChange, id=id) self.view.Bind(wx.EVT_CHECKBOX, self.OnFilterCheck, id=id)
def get_filters(self): return [(self.views[i].filter.name, self.checks[i].GetValue(), self.views[i].GetValue()) for i in filter_view.filter_ids()]