Expand on text field keyboard shortcuts

- Clipboard support
- Text will now wrap when a word is longer than the width of the destination rect (doesn't just apply to text fields, but is most relevant there)
- Edit menu stub added in scenario editor code
- Rich text keys (eg cut, copy, paste, select all) are no longer processed by the dialog itself; only the text field processes them; this just means that if they were set as button equivalents they would no longer work (you'd have to set the raw equivalent instead, eg ctrl+C instead of copy).
- Text fields now rely on SFML's TextEntered event for actual input - the practical result of this is that your keyboard layout is honoured (though non-ASCII characters just display as boxes).
- In a similar vein, shift is not auto-applied to the input keys, so you'd have to set shift+2 instead of @ as the key equivalent (this actually fixes some stuff, such as in the spellcasting dialog, since I was already setting shift+2 instead of @).
This commit is contained in:
2014-12-19 03:44:18 -05:00
parent 8e26881331
commit 728c294d0e
10 changed files with 257 additions and 131 deletions

View File

@@ -169,6 +169,7 @@ void update_item_menu() {
void handle_apple_menu(int item_hit);
void handle_file_menu(int item_hit);
void handle_edit_menu(int item_hit);
void handle_scenario_menu(int item_hit);
void handle_town_menu(int item_hit);
void handle_outdoor_menu(int item_hit);
@@ -186,8 +187,11 @@ void handle_monst_menu(int item_hit);
}
// TODO: Implement edit menu (much work to be done here!)
// TODO: Fix edit menu being disabled while a modal dialog is onscreen.
// This means setting autoenable to false for the Edit menu and finding a
// way to make the menuitems work instead of just doing nothing.
-(void) editMenu:(id) sender {
(void) sender; // Suppress "unused parameter" warning
handle_edit_menu([[sender representedObject] intValue]);
}
-(void) scenMenu:(id) sender {