# {py:mod}`simvx.editor.command_palette` ```{py:module} simvx.editor.command_palette ``` ```{autodoc2-docstring} simvx.editor.command_palette :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`PaletteMode ` - ```{autodoc2-docstring} simvx.editor.command_palette.PaletteMode :summary: ``` * - {py:obj}`Command ` - ```{autodoc2-docstring} simvx.editor.command_palette.Command :summary: ``` * - {py:obj}`CommandRegistry ` - ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry :summary: ``` * - {py:obj}`CommandPalette ` - ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette :summary: ``` ```` ### Functions ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`fuzzy_score ` - ```{autodoc2-docstring} simvx.editor.command_palette.fuzzy_score :summary: ``` * - {py:obj}`scan_project_files ` - ```{autodoc2-docstring} simvx.editor.command_palette.scan_project_files :summary: ``` * - {py:obj}`search_files ` - ```{autodoc2-docstring} simvx.editor.command_palette.search_files :summary: ``` * - {py:obj}`register_editor_commands ` - ```{autodoc2-docstring} simvx.editor.command_palette.register_editor_commands :summary: ``` ```` ### API `````{py:class} PaletteMode :canonical: simvx.editor.command_palette.PaletteMode Bases: {py:obj}`enum.Enum` ```{autodoc2-docstring} simvx.editor.command_palette.PaletteMode ``` ````{py:attribute} COMMAND :canonical: simvx.editor.command_palette.PaletteMode.COMMAND :value: > 'auto(...)' ```{autodoc2-docstring} simvx.editor.command_palette.PaletteMode.COMMAND ``` ```` ````{py:attribute} FILE :canonical: simvx.editor.command_palette.PaletteMode.FILE :value: > 'auto(...)' ```{autodoc2-docstring} simvx.editor.command_palette.PaletteMode.FILE ``` ```` ````{py:method} __new__(value) :canonical: simvx.editor.command_palette.PaletteMode.__new__ ```` ````{py:method} __repr__() :canonical: simvx.editor.command_palette.PaletteMode.__repr__ ```` ````{py:method} __str__() :canonical: simvx.editor.command_palette.PaletteMode.__str__ ```` ````{py:method} __dir__() :canonical: simvx.editor.command_palette.PaletteMode.__dir__ ```` ````{py:method} __format__(format_spec) :canonical: simvx.editor.command_palette.PaletteMode.__format__ ```` ````{py:method} __hash__() :canonical: simvx.editor.command_palette.PaletteMode.__hash__ ```` ````{py:method} __reduce_ex__(proto) :canonical: simvx.editor.command_palette.PaletteMode.__reduce_ex__ ```` ````{py:method} __deepcopy__(memo) :canonical: simvx.editor.command_palette.PaletteMode.__deepcopy__ ```` ````{py:method} __copy__() :canonical: simvx.editor.command_palette.PaletteMode.__copy__ ```` ````{py:method} name() :canonical: simvx.editor.command_palette.PaletteMode.name ```` ````{py:method} value() :canonical: simvx.editor.command_palette.PaletteMode.value ```` ````` ````{py:function} fuzzy_score(query: str, target: str) -> int :canonical: simvx.editor.command_palette.fuzzy_score ```{autodoc2-docstring} simvx.editor.command_palette.fuzzy_score ``` ```` ````{py:function} scan_project_files(project_path: pathlib.Path | str | None, max_files: int = 5000) -> list[str] :canonical: simvx.editor.command_palette.scan_project_files ```{autodoc2-docstring} simvx.editor.command_palette.scan_project_files ``` ```` ````{py:function} search_files(query: str, files: list[str]) -> list[str] :canonical: simvx.editor.command_palette.search_files ```{autodoc2-docstring} simvx.editor.command_palette.search_files ``` ```` `````{py:class} Command :canonical: simvx.editor.command_palette.Command ```{autodoc2-docstring} simvx.editor.command_palette.Command ``` ````{py:attribute} name :canonical: simvx.editor.command_palette.Command.name :type: str :value: > None ```{autodoc2-docstring} simvx.editor.command_palette.Command.name ``` ```` ````{py:attribute} callback :canonical: simvx.editor.command_palette.Command.callback :type: collections.abc.Callable :value: > None ```{autodoc2-docstring} simvx.editor.command_palette.Command.callback ``` ```` ````{py:attribute} shortcut :canonical: simvx.editor.command_palette.Command.shortcut :type: str :value: ```{autodoc2-docstring} simvx.editor.command_palette.Command.shortcut ``` ```` ````{py:attribute} category :canonical: simvx.editor.command_palette.Command.category :type: str :value: ```{autodoc2-docstring} simvx.editor.command_palette.Command.category ``` ```` ````` `````{py:class} CommandRegistry() :canonical: simvx.editor.command_palette.CommandRegistry ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry.__init__ ``` ````{py:method} register(name: str, callback: collections.abc.Callable, shortcut: str = '', category: str = '') -> None :canonical: simvx.editor.command_palette.CommandRegistry.register ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry.register ``` ```` ````{py:property} commands :canonical: simvx.editor.command_palette.CommandRegistry.commands :type: list[simvx.editor.command_palette.Command] ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry.commands ``` ```` ````{py:method} execute(name: str) -> bool :canonical: simvx.editor.command_palette.CommandRegistry.execute ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry.execute ``` ```` ````{py:method} search(query: str) -> list[simvx.editor.command_palette.Command] :canonical: simvx.editor.command_palette.CommandRegistry.search ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry.search ``` ```` ````{py:method} __len__() -> int :canonical: simvx.editor.command_palette.CommandRegistry.__len__ ```{autodoc2-docstring} simvx.editor.command_palette.CommandRegistry.__len__ ``` ```` ````` `````{py:class} CommandPalette(state: simvx.editor.state.State | None = None, **kwargs) :canonical: simvx.editor.command_palette.CommandPalette Bases: {py:obj}`simvx.core.ui.core.Control` ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.__init__ ``` ````{py:method} register_command(name: str, callback: collections.abc.Callable, shortcut: str = '', category: str = '') -> None :canonical: simvx.editor.command_palette.CommandPalette.register_command ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.register_command ``` ```` ````{py:method} show(mode: simvx.editor.command_palette.PaletteMode = PaletteMode.COMMAND) :canonical: simvx.editor.command_palette.CommandPalette.show ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.show ``` ```` ````{py:method} show_files() :canonical: simvx.editor.command_palette.CommandPalette.show_files ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.show_files ``` ```` ````{py:method} hide() :canonical: simvx.editor.command_palette.CommandPalette.hide ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.hide ``` ```` ````{py:method} toggle() :canonical: simvx.editor.command_palette.CommandPalette.toggle ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.toggle ``` ```` ````{py:property} mode :canonical: simvx.editor.command_palette.CommandPalette.mode :type: simvx.editor.command_palette.PaletteMode ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.mode ``` ```` ````{py:method} is_popup_point_inside(point) -> bool :canonical: simvx.editor.command_palette.CommandPalette.is_popup_point_inside ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.is_popup_point_inside ``` ```` ````{py:method} popup_input(event) :canonical: simvx.editor.command_palette.CommandPalette.popup_input ```{autodoc2-docstring} simvx.editor.command_palette.CommandPalette.popup_input ``` ```` ````{py:method} dismiss_popup() :canonical: simvx.editor.command_palette.CommandPalette.dismiss_popup ```` ````{py:method} process(dt: float) :canonical: simvx.editor.command_palette.CommandPalette.process ```` ````{py:method} draw(renderer) :canonical: simvx.editor.command_palette.CommandPalette.draw ```` ````{py:method} draw_popup(renderer) :canonical: simvx.editor.command_palette.CommandPalette.draw_popup ```` ````{py:attribute} size_x :canonical: simvx.editor.command_palette.CommandPalette.size_x :value: > 'Property(...)' ```` ````{py:attribute} size_y :canonical: simvx.editor.command_palette.CommandPalette.size_y :value: > 'Property(...)' ```` ````{py:attribute} anchor_left :canonical: simvx.editor.command_palette.CommandPalette.anchor_left :value: > 'Property(...)' ```` ````{py:attribute} anchor_top :canonical: simvx.editor.command_palette.CommandPalette.anchor_top :value: > 'Property(...)' ```` ````{py:attribute} anchor_right :canonical: simvx.editor.command_palette.CommandPalette.anchor_right :value: > 'Property(...)' ```` ````{py:attribute} anchor_bottom :canonical: simvx.editor.command_palette.CommandPalette.anchor_bottom :value: > 'Property(...)' ```` ````{py:attribute} margin_left :canonical: simvx.editor.command_palette.CommandPalette.margin_left :value: > 'Property(...)' ```` ````{py:attribute} margin_top :canonical: simvx.editor.command_palette.CommandPalette.margin_top :value: > 'Property(...)' ```` ````{py:attribute} margin_right :canonical: simvx.editor.command_palette.CommandPalette.margin_right :value: > 'Property(...)' ```` ````{py:attribute} margin_bottom :canonical: simvx.editor.command_palette.CommandPalette.margin_bottom :value: > 'Property(...)' ```` ````{py:property} size :canonical: simvx.editor.command_palette.CommandPalette.size :type: simvx.core.math.types.Vec2 ```` ````{py:attribute} touch_mode :canonical: simvx.editor.command_palette.CommandPalette.touch_mode :type: str :value: > 'mouse' ```` ````{py:property} theme :canonical: simvx.editor.command_palette.CommandPalette.theme :type: simvx.core.ui.types.Theme | None ```` ````{py:property} mouse_over :canonical: simvx.editor.command_palette.CommandPalette.mouse_over :type: bool ```` ````{py:property} focused :canonical: simvx.editor.command_palette.CommandPalette.focused :type: bool ```` ````{py:property} disabled :canonical: simvx.editor.command_palette.CommandPalette.disabled :type: bool ```` ````{py:method} get_theme() -> simvx.core.ui.types.Theme :canonical: simvx.editor.command_palette.CommandPalette.get_theme ```` ````{py:method} queue_redraw() :canonical: simvx.editor.command_palette.CommandPalette.queue_redraw ```` ````{py:method} get_minimum_size() -> simvx.core.math.types.Vec2 :canonical: simvx.editor.command_palette.CommandPalette.get_minimum_size ```` ````{py:method} get_rect() -> tuple[float, float, float, float] :canonical: simvx.editor.command_palette.CommandPalette.get_rect ```` ````{py:method} get_global_rect() -> tuple[float, float, float, float] :canonical: simvx.editor.command_palette.CommandPalette.get_global_rect ```` ````{py:method} is_point_inside(point) -> bool :canonical: simvx.editor.command_palette.CommandPalette.is_point_inside ```` ````{py:method} set_anchor_preset(preset: simvx.core.ui.enums.AnchorPreset) :canonical: simvx.editor.command_palette.CommandPalette.set_anchor_preset ```` ````{py:method} set_focus() :canonical: simvx.editor.command_palette.CommandPalette.set_focus ```` ````{py:method} grab_focus() :canonical: simvx.editor.command_palette.CommandPalette.grab_focus ```` ````{py:method} release_focus() :canonical: simvx.editor.command_palette.CommandPalette.release_focus ```` ````{py:method} has_focus() -> bool :canonical: simvx.editor.command_palette.CommandPalette.has_focus ```` ````{py:method} focus_next_control() :canonical: simvx.editor.command_palette.CommandPalette.focus_next_control ```` ````{py:method} focus_previous_control() :canonical: simvx.editor.command_palette.CommandPalette.focus_previous_control ```` ````{py:method} grab_mouse() :canonical: simvx.editor.command_palette.CommandPalette.grab_mouse ```` ````{py:method} release_mouse() :canonical: simvx.editor.command_palette.CommandPalette.release_mouse ```` ````{py:method} set_drag_preview(control: simvx.core.ui.core.Control) :canonical: simvx.editor.command_palette.CommandPalette.set_drag_preview ```` ````{py:attribute} z_index :canonical: simvx.editor.command_palette.CommandPalette.z_index :value: > 'Property(...)' ```` ````{py:attribute} z_as_relative :canonical: simvx.editor.command_palette.CommandPalette.z_as_relative :value: > 'Property(...)' ```` ````{py:attribute} render_layer :canonical: simvx.editor.command_palette.CommandPalette.render_layer :value: > 'Property(...)' ```` ````{py:method} set_render_layer(index: int, enabled: bool = True) -> None :canonical: simvx.editor.command_palette.CommandPalette.set_render_layer ```` ````{py:method} is_on_render_layer(index: int) -> bool :canonical: simvx.editor.command_palette.CommandPalette.is_on_render_layer ```` ````{py:property} absolute_z_index :canonical: simvx.editor.command_palette.CommandPalette.absolute_z_index :type: int ```` ````{py:property} position :canonical: simvx.editor.command_palette.CommandPalette.position :type: simvx.core.math.types.Vec2 ```` ````{py:property} rotation :canonical: simvx.editor.command_palette.CommandPalette.rotation :type: float ```` ````{py:property} rotation_degrees :canonical: simvx.editor.command_palette.CommandPalette.rotation_degrees :type: float ```` ````{py:property} scale :canonical: simvx.editor.command_palette.CommandPalette.scale :type: simvx.core.math.types.Vec2 ```` ````{py:property} world_position :canonical: simvx.editor.command_palette.CommandPalette.world_position :type: simvx.core.math.types.Vec2 ```` ````{py:property} world_rotation :canonical: simvx.editor.command_palette.CommandPalette.world_rotation :type: float ```` ````{py:property} world_scale :canonical: simvx.editor.command_palette.CommandPalette.world_scale :type: simvx.core.math.types.Vec2 ```` ````{py:property} forward :canonical: simvx.editor.command_palette.CommandPalette.forward :type: simvx.core.math.types.Vec2 ```` ````{py:property} right :canonical: simvx.editor.command_palette.CommandPalette.right :type: simvx.core.math.types.Vec2 ```` ````{py:method} translate(offset: tuple[float, float] | numpy.ndarray) :canonical: simvx.editor.command_palette.CommandPalette.translate ```` ````{py:method} rotate(radians: float) :canonical: simvx.editor.command_palette.CommandPalette.rotate ```` ````{py:method} rotate_deg(degrees: float) :canonical: simvx.editor.command_palette.CommandPalette.rotate_deg ```` ````{py:method} look_at(target: tuple[float, float] | numpy.ndarray) :canonical: simvx.editor.command_palette.CommandPalette.look_at ```` ````{py:method} transform_points(points: list[simvx.core.math.types.Vec2]) -> list[simvx.core.math.types.Vec2] :canonical: simvx.editor.command_palette.CommandPalette.transform_points ```` ````{py:method} draw_polygon(renderer, points: list[simvx.core.math.types.Vec2], closed=True, colour=None) :canonical: simvx.editor.command_palette.CommandPalette.draw_polygon ```` ````{py:method} wrap_screen(margin: float = 20) :canonical: simvx.editor.command_palette.CommandPalette.wrap_screen ```` ````{py:attribute} strict_errors :canonical: simvx.editor.command_palette.CommandPalette.strict_errors :type: typing.ClassVar[bool] :value: > True ```` ````{py:attribute} script_error_raised :canonical: simvx.editor.command_palette.CommandPalette.script_error_raised :value: > 'Signal(...)' ```` ````{py:method} __init_subclass__(**kwargs) :canonical: simvx.editor.command_palette.CommandPalette.__init_subclass__ :classmethod: ```` ````{py:property} name :canonical: simvx.editor.command_palette.CommandPalette.name :type: str ```` ````{py:property} process_mode :canonical: simvx.editor.command_palette.CommandPalette.process_mode :type: simvx.core.descriptors.ProcessMode ```` ````{py:property} visible :canonical: simvx.editor.command_palette.CommandPalette.visible :type: bool ```` ````{py:method} reset_error() -> None :canonical: simvx.editor.command_palette.CommandPalette.reset_error ```` ````{py:method} add_child(node: simvx.core.node.Node) -> simvx.core.node.Node :canonical: simvx.editor.command_palette.CommandPalette.add_child ```` ````{py:method} remove_child(node: simvx.core.node.Node) :canonical: simvx.editor.command_palette.CommandPalette.remove_child ```` ````{py:method} reparent(new_parent: simvx.core.node.Node) :canonical: simvx.editor.command_palette.CommandPalette.reparent ```` ````{py:method} get_node(path: str) -> simvx.core.node.Node :canonical: simvx.editor.command_palette.CommandPalette.get_node ```` ````{py:method} find_child(name: str, recursive: bool = False) -> simvx.core.node.Node | None :canonical: simvx.editor.command_palette.CommandPalette.find_child ```` ````{py:method} find(node_type: type, recursive: bool = True) -> simvx.core.node.Node | None :canonical: simvx.editor.command_palette.CommandPalette.find ```` ````{py:method} find_all(node_type: type, recursive: bool = True) -> list :canonical: simvx.editor.command_palette.CommandPalette.find_all ```` ````{py:method} walk(*, include_self: bool = True) -> collections.abc.Iterator[simvx.core.node.Node] :canonical: simvx.editor.command_palette.CommandPalette.walk ```` ````{py:property} path :canonical: simvx.editor.command_palette.CommandPalette.path :type: str ```` ````{py:method} add_to_group(group: str) :canonical: simvx.editor.command_palette.CommandPalette.add_to_group ```` ````{py:method} remove_from_group(group: str) :canonical: simvx.editor.command_palette.CommandPalette.remove_from_group ```` ````{py:method} is_in_group(group: str) -> bool :canonical: simvx.editor.command_palette.CommandPalette.is_in_group ```` ````{py:method} ready() -> None :canonical: simvx.editor.command_palette.CommandPalette.ready ```` ````{py:method} enter_tree() -> None :canonical: simvx.editor.command_palette.CommandPalette.enter_tree ```` ````{py:method} exit_tree() -> None :canonical: simvx.editor.command_palette.CommandPalette.exit_tree ```` ````{py:method} physics_process(dt: float) -> None :canonical: simvx.editor.command_palette.CommandPalette.physics_process ```` ````{py:method} picked(event: simvx.core.events.InputEvent) -> None :canonical: simvx.editor.command_palette.CommandPalette.picked ```` ````{py:method} handle_input(event: simvx.core.events.TreeInputEvent) -> None :canonical: simvx.editor.command_palette.CommandPalette.handle_input ```` ````{py:method} unhandled_input(event: simvx.core.events.TreeInputEvent) -> None :canonical: simvx.editor.command_palette.CommandPalette.unhandled_input ```` ````{py:method} start_coroutine(gen: simvx.core.descriptors.Coroutine) -> simvx.core.descriptors.CoroutineHandle :canonical: simvx.editor.command_palette.CommandPalette.start_coroutine ```` ````{py:method} stop_coroutine(gen_or_handle) :canonical: simvx.editor.command_palette.CommandPalette.stop_coroutine ```` ````{py:method} clear_children() :canonical: simvx.editor.command_palette.CommandPalette.clear_children ```` ````{py:method} destroy() :canonical: simvx.editor.command_palette.CommandPalette.destroy ```` ````{py:property} app :canonical: simvx.editor.command_palette.CommandPalette.app ```` ````{py:property} tree :canonical: simvx.editor.command_palette.CommandPalette.tree :type: simvx.core.scene_tree.SceneTree ```` ````{py:method} __getitem__(key: str) :canonical: simvx.editor.command_palette.CommandPalette.__getitem__ ```` ````{py:method} get_properties() -> dict[str, simvx.core.descriptors.Property] :canonical: simvx.editor.command_palette.CommandPalette.get_properties :classmethod: ```` ````{py:method} __repr__() :canonical: simvx.editor.command_palette.CommandPalette.__repr__ ```` ````` ````{py:function} register_editor_commands(palette: simvx.editor.command_palette.CommandPalette, state: simvx.editor.state.State) -> None :canonical: simvx.editor.command_palette.register_editor_commands ```{autodoc2-docstring} simvx.editor.command_palette.register_editor_commands ``` ````