diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2012-10-31 16:12:53 +0000 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2012-10-31 16:12:53 +0000 |
commit | f3ffb15def9ba38f78188197d63db7021411a284 (patch) | |
tree | 8e10f37adae29467e0bb294f0730d2c0ab98c457 /pdf/pdf_form.c | |
parent | dd9efe6a20d4d00d712ca5dc065f64ab594c5b99 (diff) | |
download | mupdf-f3ffb15def9ba38f78188197d63db7021411a284.tar.xz |
Forms: add focus and blur actions
Diffstat (limited to 'pdf/pdf_form.c')
-rw-r--r-- | pdf/pdf_form.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pdf/pdf_form.c b/pdf/pdf_form.c index 781c49a8..6295044b 100644 --- a/pdf/pdf_form.c +++ b/pdf/pdf_form.c @@ -2013,9 +2013,14 @@ int pdf_pass_event(pdf_document *doc, pdf_page *page, fz_ui_event *ui_event) switch (ui_event->event.pointer.ptype) { case FZ_POINTER_DOWN: - doc->focus = NULL; - pdf_drop_obj(doc->focus_obj); - doc->focus_obj = NULL; + if (doc->focus_obj) + { + /* Execute the blur action */ + execute_additional_action(doc, doc->focus_obj, "AA/Bl"); + doc->focus = NULL; + pdf_drop_obj(doc->focus_obj); + doc->focus_obj = NULL; + } if (annot) { @@ -2026,7 +2031,8 @@ int pdf_pass_event(pdf_document *doc, pdf_page *page, fz_ui_event *ui_event) hp->gen = pdf_to_gen(annot->obj); hp->state = HOTSPOT_POINTER_DOWN; changed = 1; - /* Exectute the down action */ + /* Exectute the down and focus actions */ + execute_additional_action(doc, annot->obj, "AA/Fo"); execute_additional_action(doc, annot->obj, "AA/D"); } break; |