summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-09-02 14:41:36 +0200
committerjcid <devnull@localhost>2008-09-02 14:41:36 +0200
commit3e6aed4bf51baf13ff9d3ea2478291ad570ce3d0 (patch)
treedebc683c5fc6ce167acf55f904b81ed6e0d75bd1
parent614a7b0ab6440821a3be0a0693ca7ff6f18d528a (diff)
- Made forms show their action URL upon enter/leave mouse events (safety).
-rw-r--r--ChangeLog1
-rw-r--r--src/form.cc34
2 files changed, 35 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 00a2555a..b566988f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
{