def __edit_command_of_class(self, class_name, cmd_name): cmd_unpath = self.__get_cmd_path( class_name, cmd_name, True ) win = scripteditordlg.create_window( app.get_top_window(), cmd_unpath ) win.display()
def on_new_cmd(self, event): # Ask for a command prototype dlg = newcmddlg.NewCommandDialog(self) result_ok = dlg.ShowModal() == wx.ID_OK if result_ok: cmd_proto = dlg.get_command_prototype() dlg.Destroy() # Create and add the new command to the selected class if result_ok: # Get the class name for the new command class_name = self.tree_classes.get_selected_class_name() if class_name is None: cjr.show_error_message( "Cannot add commands to the selected class") return # Create an empty command for the selected class from a template self.__add_command(class_name, 'command', cmd_proto) # Add the new command to the command list self.list_cmds.Append(cmd_proto) servers.get_script_server().refreshclass(str(class_name)) # Open for editing the new command script cmd_unpath = self.__get_cmd_path(class_name, cmd_proto, True) win = scripteditordlg.create_window(app.get_top_window(), cmd_unpath) win.display()
def on_new_cmd(self, event): # Ask for a command prototype dlg = newcmddlg.NewCommandDialog(self) result_ok = dlg.ShowModal() == wx.ID_OK if result_ok: cmd_proto = dlg.get_command_prototype() dlg.Destroy() # Create and add the new command to the selected class if result_ok: # Get the class name for the new command class_name = self.tree_classes.get_selected_class_name() if class_name is None: cjr.show_error_message( "Cannot add commands to the selected class" ) return # Create an empty command for the selected class from a template self.__add_command( class_name, 'command', cmd_proto ) # Add the new command to the command list self.list_cmds.Append( cmd_proto ) servers.get_script_server().refreshclass( str(class_name) ) # Open for editing the new command script cmd_unpath = self.__get_cmd_path(class_name, cmd_proto, True) win = scripteditordlg.create_window( app.get_top_window(), cmd_unpath ) win.display()
def __add_commands_of_action(self, class_name): # Ask for the InitAction prototype dlg = newcmddlg.NewInitActionCmdDlg(self) result_ok = dlg.ShowModal() == wx.ID_OK if result_ok: init_proto = dlg.get_command_prototype() else: init_proto = 'b_init_o' dlg.Destroy() # Add action commands self.__add_command(class_name, 'action_init', init_proto) self.__add_command(class_name, 'action_run', 'b_run_v') self.__add_command(class_name, 'action_end', 'v_end_v') # Open InitAction script so the user doesn't # forget to set the parameters if result_ok: cmd_unpath = self.__get_cmd_path(class_name, init_proto, True) win = scripteditordlg.create_window( app.get_top_window(), cmd_unpath ) win.display() app.get_top_window().emit_app_event( events.ActionAdded(class_name) )
def on_edit(self, event): sel = self.list_box_scripts.GetSelection() if sel != wx.NOT_FOUND: script_to_edit = guisettings.Repository.getsettingvalue( guisettings.ID_ScriptList)[sel] win = scripteditordlg.create_window(self.GetParent(), script_to_edit['path']) win.display()
def on_edit(self, event): sel = self.list_box_scripts.GetSelection() if sel != wx.NOT_FOUND: script_to_edit = guisettings.Repository.getsettingvalue( guisettings.ID_ScriptList )[sel] win = scripteditordlg.create_window( self.GetParent(), script_to_edit['path'] ) win.display()
def __add_commands_of_action(self, class_name): # Ask for the InitAction prototype dlg = newcmddlg.NewInitActionCmdDlg(self) result_ok = dlg.ShowModal() == wx.ID_OK if result_ok: init_proto = dlg.get_command_prototype() else: init_proto = 'b_init_o' dlg.Destroy() # Add action commands self.__add_command(class_name, 'action_init', init_proto) self.__add_command(class_name, 'action_run', 'b_run_v') self.__add_command(class_name, 'action_end', 'v_end_v') # Open InitAction script so the user doesn't # forget to set the parameters if result_ok: cmd_unpath = self.__get_cmd_path(class_name, init_proto, True) win = scripteditordlg.create_window(app.get_top_window(), cmd_unpath) win.display() app.get_top_window().emit_app_event(events.ActionAdded(class_name))
def __edit_command_of_class(self, class_name, cmd_name): cmd_unpath = self.__get_cmd_path(class_name, cmd_name, True) win = scripteditordlg.create_window(app.get_top_window(), cmd_unpath) win.display()
def on_new_script(self, event): """Open an empty script editor""" scripteditordlg.create_window(self.get_frame())
def __open_script(self, filename): scripteditordlg.create_window(self.get_frame(), filename)
def open_editor(self, obj_path): scripteditordlg.create_window( self.GetParent(), self.__get_script_path(obj_path) )