:github_url: hide .. _class_ScriptEditorBase: ScriptEditorBase ================ **繼承:** :ref:`VBoxContainer` **<** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` 用於在 :ref:`ScriptEditor` 中編輯腳本的基礎編輯器。 .. rst-class:: classref-introduction-group 說明 ---- 用於在 :ref:`ScriptEditor` 中編輯腳本的基礎編輯器。不包含文件專案。 .. rst-class:: classref-reftable-group 方法 ---- .. table:: :widths: auto +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_syntax_highlighter`\ (\ highlighter\: :ref:`EditorSyntaxHighlighter`\ ) | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Control` | :ref:`get_base_editor`\ (\ ) |const| | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 訊號 ---- .. _class_ScriptEditorBase_signal_edited_script_changed: .. rst-class:: classref-signal **edited_script_changed**\ (\ ) :ref:`🔗` 校驗腳本後發出。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_go_to_help: .. rst-class:: classref-signal **go_to_help**\ (\ what\: :ref:`String`\ ) :ref:`🔗` 使用者請求特定的文件頁面時發出。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_go_to_method: .. rst-class:: classref-signal **go_to_method**\ (\ script\: :ref:`Object`, method\: :ref:`String`\ ) :ref:`🔗` 使用者請求查看腳本中的指定方法時發出,類似於 :ref:`request_open_script_at_line`\ 。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_name_changed: .. rst-class:: classref-signal **name_changed**\ (\ ) :ref:`🔗` 校驗腳本後,或者所編輯資源發生更改時發出。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_replace_in_files_requested: .. rst-class:: classref-signal **replace_in_files_requested**\ (\ text\: :ref:`String`\ ) :ref:`🔗` 使用者請求在檔案系統中搜尋與替換文字時發出。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_request_help: .. rst-class:: classref-signal **request_help**\ (\ topic\: :ref:`String`\ ) :ref:`🔗` 使用者請求本文幫助時發出。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_request_open_script_at_line: .. rst-class:: classref-signal **request_open_script_at_line**\ (\ script\: :ref:`Object`, line\: :ref:`int`\ ) :ref:`🔗` 使用者請求查看腳本中的指定行時發出,類似於 :ref:`go_to_method`\ 。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_request_save_history: .. rst-class:: classref-signal **request_save_history**\ (\ ) :ref:`🔗` 使用者進行本文跳轉,並且該條目在同一個腳本中時發出。 .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_request_save_previous_state: .. rst-class:: classref-signal **request_save_previous_state**\ (\ state\: :ref:`Dictionary`\ ) :ref:`🔗` Emitted when the user changes current script or moves caret by 10 or more columns within the same script. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_signal_search_in_files_requested: .. rst-class:: classref-signal **search_in_files_requested**\ (\ text\: :ref:`String`\ ) :ref:`🔗` 使用者請求在檔案系統中搜索文字時發出。 .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 方法說明 -------- .. _class_ScriptEditorBase_method_add_syntax_highlighter: .. rst-class:: classref-method |void| **add_syntax_highlighter**\ (\ highlighter\: :ref:`EditorSyntaxHighlighter`\ ) :ref:`🔗` Adds an :ref:`EditorSyntaxHighlighter` to the open script. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditorBase_method_get_base_editor: .. rst-class:: classref-method :ref:`Control` **get_base_editor**\ (\ ) |const| :ref:`🔗` 返回用於編輯腳本的底層 :ref:`Control`\ 。文字腳本對應 :ref:`CodeEdit`\ 。 .. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)` .. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)` .. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)` .. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)` .. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)` .. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)` .. |void| replace:: :abbr:`void (無回傳值。)`