From 287986b28a9290cc46ef585bfcc47782ea55cc70 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 22 Sep 2003 21:55:08 +0000 Subject: [project @ 2003-09-22 21:55:08 by bursa] Experimental textarea editing code. svn path=/import/netsurf/; revision=309 --- riscos/gui.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'riscos/gui.c') diff --git a/riscos/gui.c b/riscos/gui.c index 8c9a83b30..f67ebb338 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -1368,8 +1368,13 @@ void ro_gui_keypress(wimp_key* key) { gui_window* g; - if (key == NULL) - return; + if (key->i == -1 && key->c < 256) { + g = ro_lookup_gui_from_w(key->w); + if (g) { + browser_window_key_press(g->data.browser.bw, (char) key->c); + return; + } + } g = ro_lookup_gui_toolbar_from_w(key->w); if (g != NULL) @@ -1686,20 +1691,10 @@ void gui_gadget_combo(struct browser_window* bw, struct gui_gadget* g, unsigned ro_gui_create_menu(combo_menu, pointer.pos.x - 64, pointer.pos.y, bw->window); } -void gui_edit_textarea(struct browser_window* bw, struct gui_gadget* g) +void gui_window_place_caret(gui_window *g, int x, int y, int height) { - FILE* file; - - xosfile_create_dir(".WWW", 77); - xosfile_create_dir(".WWW.NetSurf", 77); - file = fopen("/WWW/NetSurf/TextArea", "w"); - if (g->data.textarea.text != 0) - fprintf(file, "%s", g->data.textarea.text); - fprintf(stderr, "closing file.\n"); - fclose(file); - - xosfile_set_type(".WWW.NetSurf.TextArea", osfile_TYPE_TEXT); - xos_cli("filer_run .WWW.NetSurf.TextArea"); + wimp_set_caret_position(g->data.browser.window, -1, + x * 2, -(y + height) * 2, height * 2, -1); } void ro_msg_datasave(wimp_message* block) @@ -1799,10 +1794,7 @@ void ro_msg_dataload(wimp_message* block) if (click_boxes[i].box->gadget->type == GADGET_TEXTAREA && data->file_type == 0xFFF) { /* load the text in! */ - if (click_boxes[i].box->gadget->data.textarea.text != 0) - xfree(click_boxes[i].box->gadget->data.textarea.text); - click_boxes[i].box->gadget->data.textarea.text = load(data->file_name); - gui_redraw_gadget(bw, click_boxes[i].box->gadget); + /* TODO */ } } } -- cgit v1.2.3