diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/form.cc | 34 |
2 files changed, 35 insertions, 0 deletions
@@ -111,6 +111,7 @@ dillo-fltk2 - Allowed form inputs outside the FORM element (it's in the standard). - Fixed a segfault bug in VERBATIM mode. - Made image inputs less of a special case by using x,y in ComplexButton. + - Made forms show their action URL upon enter/leave mouse events (safety). Patches: place (AKA corvid) +- Fixed a problem with locally-installed dpis. - Added code for optional image loading (nice interface) very advanced! diff --git a/src/form.cc b/src/form.cc index cbc23af5..c1f9c2fb 100644 --- a/src/form.cc +++ b/src/form.cc @@ -132,6 +132,8 @@ class DilloHtmlReceiver: DilloHtmlReceiver (DilloHtmlForm* form2) { form = form2; } ~DilloHtmlReceiver () { } void activate (dw::core::ui::Resource *resource); + void enter (dw::core::ui::Resource *resource); + void leave (dw::core::ui::Resource *resource); void clicked (dw::core::ui::ButtonResource *resource, int buttonNo, int x, int y); }; @@ -1489,6 +1491,38 @@ void DilloHtmlReceiver::activate (dw::core::ui::Resource *resource) form->eventHandler(resource); } +/* + * Enter a form control, as in "onmouseover". + * For _pressing_ enter in a text control, see activate(). + */ +void DilloHtmlReceiver::enter (dw::core::ui::Resource *resource) +{ + DilloHtml *html = form->html; + DilloHtmlInput *input = form->getInput(resource); + const char *msg = ""; + + if ((input->type == DILLO_HTML_INPUT_SUBMIT) || + (input->type == DILLO_HTML_INPUT_IMAGE) || + (input->type == DILLO_HTML_INPUT_BUTTON_SUBMIT) || + (input->type == DILLO_HTML_INPUT_INDEX) || + ((prefs.enterpress_forces_submit || form->num_entry_fields == 1) && + ((input->type == DILLO_HTML_INPUT_PASSWORD) || + (input->type == DILLO_HTML_INPUT_TEXT)))) { + /* The control can submit form. Show action URL. */ + msg = URL_STR(form->action); + } + a_UIcmd_set_msg(html->bw, msg); +} + +/* + * Leave a form control, or "onmouseout". + */ +void DilloHtmlReceiver::leave (dw::core::ui::Resource *resource) +{ + DilloHtml *html = form->html; + a_UIcmd_set_msg(html->bw, ""); +} + void DilloHtmlReceiver::clicked (dw::core::ui::ButtonResource *resource, int buttonNo, int x, int y) { |