-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More Form Enhancements #138
base: main
Are you sure you want to change the base?
More Form Enhancements #138
Conversation
This commit enhances audio form with the ability to disable deletion of text as well as configure clipboard operations'. 1. A new enum `clipboard_flags`: We now have a new enum that offers 3 constants: `clipboard_flag_copy, clipboard_flag_cut_clipboard_paste`. This is internal, and the users don't need to use this. 2. 2 new methods for configuring whether or not you want to allow the users to use backspace or delete keys. a. `bool audio_form::set_enable_delete(int control_index, bool enabled);` b. `bool audio_form::set_delete_disabled_message(int control_index, string mesage);` 3. A new method for setting clipboard_flags: `bool audio_form::set_clipboard_flags(control_index, bool copy, bool cut, bool paste);`
release/include/form.nvgt
Outdated
paste_text(); | ||
if (key_repeating(KEY_BACK)) { | ||
if ((key_down(KEY_LCTRL) || key_down(KEY_RCTRL)) && (sel_start < 0 || sel_end < 0 || sel_start > sel_end)) { | ||
if (false == enable_delete) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (false == enable_delete) { | |
if (!enable_delete) { |
paste_text(); | ||
if (key_repeating(KEY_BACK)) { | ||
if ((key_down(KEY_LCTRL) || key_down(KEY_RCTRL)) && (sel_start < 0 || sel_end < 0 || sel_start > sel_end)) { | ||
if (false == enable_delete) { | ||
speak(delete_disabled_message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
speak(delete_disabled_message); | |
if (delete_disabled_message != "") speak(delete_disabled_message); |
release/include/form.nvgt
Outdated
delete_word_left(); | ||
return; | ||
} | ||
delete_highlighted(); | ||
} | ||
if (key_repeating(KEY_DELETE)) { | ||
if ((key_down(KEY_LCTRL) || key_down(KEY_RCTRL)) && (sel_start < 0 || sel_end < 0 || sel_start > sel_end)) { | ||
if (false == enable_delete) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (false == enable_delete) { | |
if (!enable_delete) { |
delete_word_left(); | ||
return; | ||
} | ||
delete_highlighted(); | ||
} | ||
if (key_repeating(KEY_DELETE)) { | ||
if ((key_down(KEY_LCTRL) || key_down(KEY_RCTRL)) && (sel_start < 0 || sel_end < 0 || sel_start > sel_end)) { | ||
if (false == enable_delete) { | ||
speak(delete_disabled_message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
speak(delete_disabled_message); | |
if (delete_disabled_message != "") speak(delete_disabled_message); |
THis commit adds a new method to the audio form. You can now set readonly attribute after creating a control.
This commit enhances audio form with the ability to disable deletion of text as well as configure clipboard operations'.
A new enum
clipboard_flags
: We now have a new enum that offers 3 constants:clipboard_flag_copy, clipboard_flag_cut_clipboard_paste
. This is internal, and the users don't need to use this.2 new methods for configuring whether or not you want to allow the users to use backspace or delete keys. a.
bool audio_form::set_enable_delete(int control_index, bool enabled);
b.bool audio_form::set_delete_disabled_message(int control_index, string mesage);
A new method for setting clipboard_flags:
bool audio_form::set_clipboard_flags(control_index, bool copy, bool cut, bool paste);