diff options
| author | Paulb23 | 2017-10-29 23:14:33 +0000 |
|---|---|---|
| committer | Paulb23 | 2017-10-29 23:21:06 +0000 |
| commit | 9dddce75d0e27558372efdc0a3e8e79051cfb87c (patch) | |
| tree | f2d163a844dbce47453ea5c3729875da8cc39056 /scene/gui/line_edit.h | |
| parent | 619e4eb23df037d152bf7776c5447d46293aadff (diff) | |
| download | godot-9dddce75d0e27558372efdc0a3e8e79051cfb87c.tar.gz godot-9dddce75d0e27558372efdc0a3e8e79051cfb87c.tar.zst godot-9dddce75d0e27558372efdc0a3e8e79051cfb87c.zip | |
Diffstat (limited to 'scene/gui/line_edit.h')
| -rw-r--r-- | scene/gui/line_edit.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 661f9b60b..bece29a37 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -56,6 +56,7 @@ public: MENU_CLEAR, MENU_SELECT_ALL, MENU_UNDO, + MENU_REDO, MENU_MAX }; @@ -92,10 +93,22 @@ private: bool drag_attempt; } selection; + struct TextOperation { + int cursor_pos; + String text; + }; + List<TextOperation> undo_stack; + List<TextOperation>::Element *undo_stack_pos; + + void _clear_undo_stack(); + void _clear_redo(); + void _create_undo_state(); + Timer *caret_blink_timer; static void _ime_text_callback(void *p_self, String p_text, Point2 p_selection); void _text_changed(); + void _emit_text_change(); bool expand_to_text_length; bool caret_blink_enabled; @@ -166,6 +179,7 @@ public: void cut_text(); void paste_text(); void undo(); + void redo(); void set_editable(bool p_editable); bool is_editable() const; |
