mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-14 14:15:29 +01:00
[TextBox, TextArea] Add context menu.
This commit is contained in:
parent
fe43a1821d
commit
8c0b0c8b30
1 changed files with 6 additions and 2 deletions
|
@ -65,12 +65,16 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
|
|||
_cl = -1;
|
||||
|
||||
context_menu = [
|
||||
menuItem("Copy", function() /*=>*/ { clipboard_set_text(_current_text) }, THEME.copy),
|
||||
menuItem("Copy", function() /*=>*/ { clipboard_set_text(_current_text); }, THEME.copy),
|
||||
menuItem("Paste", function() /*=>*/ { var _text = clipboard_get_text(); if(onModify) onModify(_text); }, THEME.paste),
|
||||
];
|
||||
|
||||
context_menu_selecting = [
|
||||
menuItem("Copy", function() /*=>*/ { clipboard_set_text(_current_text) }, THEME.copy),
|
||||
menuItem("Copy", function() /*=>*/ {
|
||||
var minc = min(cursor, cursor_select);
|
||||
var maxc = max(cursor, cursor_select);
|
||||
clipboard_set_text(string_copy(_input_text, minc + 1, maxc - minc));
|
||||
}, THEME.copy),
|
||||
menuItem("Paste", function() /*=>*/ { var _text = clipboard_get_text(); if(onModify) onModify(_text); }, THEME.paste),
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue