def edit_entry_show(self, mouse): ''' show edit entry frame ''' self.frame_edit_entry_radio.grid_remove() self.frame_edit_entry_spinbox.grid_remove() self.frame_edit_entry_text.grid_remove() x = str(self.listbox_edit_b.get(tk.ACTIVE)) y = f.read_until_space(x) z = self.zodb.return_attr_type(self.tmp_ID, y) if z == int: self.dynamic_spinbox.delete(0, 'end') self.dynamic_spinbox.insert( 'end', self.zodb.return_param_value(self.tmp_ID, y)) self.frame_edit_entry_spinbox.grid() elif z == str: self.dynamic_entry.delete(0, 'end') self.dynamic_entry.insert( 'end', self.zodb.return_param_value(self.tmp_ID, y)) self.frame_edit_entry_text.grid() elif z == bool: self.v.set(self.zodb.return_param_value( self.tmp_ID, y)) # v.set() allows changing of content of self.frame_edit_entry_radio.grid() # radio buttons to match param y = self.zodb.return_name(self.tmp_ID) + "\n" + y self.edit_entry_label.configure(text=y) self.frame_edit_entry.grid()
def edit_save_radio(self): ''' save bool input ''' x = str(self.listbox_edit_b.get(tk.ACTIVE)) y = f.read_until_space(x) if y == "group" or y == "parent": return self.zodb.update_record(self.tmp_ID, y, self.v.get()) self.listbox_edit_a_select(1) self.frame_edit_entry.grid_remove()
def edit_save_spinbox(self): ''' save int input ''' x = str(self.listbox_edit_b.get(tk.ACTIVE)) y = f.read_until_space(x) if y == "group" or y == "parent": self.dynamic_spinbox.delete(0, 'end') return self.zodb.update_record(self.tmp_ID, y, self.dynamic_spinbox.get()) self.listbox_edit_a_select(1) self.dynamic_spinbox.delete(0, 'end') self.frame_edit_entry.grid_remove()
def edit_param_input_save(self): ''' save new param ''' z = self.w.get() x = self.edit_param_entry.get() y = f.read_until_space(x) if z == 0: self.zodb.update_record(self.tmp_ID, y, 0) elif z == 1: self.zodb.update_record(self.tmp_ID, y, "empty") elif z == 2: self.zodb.update_record(self.tmp_ID, y, False) self.listbox_edit_a_select(1) self.frame_edit_entry_param_input.grid_remove()