aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-04-06 22:16:46 +0200
committerjcid <devnull@localhost>2008-04-06 22:16:46 +0200
commitb014c89060b0147b4f098fcf757513504ef58954 (patch)
treeb8f6abc66ed2988e64241093f84cd7f09d9a8c71
parent712128411cd5de92d8af95d7571e2773fb541bbf (diff)
- Fixed a bug in the findtext dialog.
-rw-r--r--src/dialog.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/dialog.cc b/src/dialog.cc
index 98010b8a..9958f8c8 100644
--- a/src/dialog.cc
+++ b/src/dialog.cc
@@ -159,17 +159,22 @@ static void findtext_search_cb(Widget *, void *vtf)
const char *key = tf->i->value();
bool case_sens = tf->cb->value();
+ if (key[0] != '\0')
+ a_UIcmd_findtext_search(tf->bw, key, case_sens);
+
+}
+
+/*
+ * Find next occurrence of input key
+ */
+static void findtext_search_cb2(Widget *widget, void *vtf)
+{
/*
* Somehow fltk even regards the first loss of focus for the
* window as a WHEN_ENTER_KEY_ALWAYS event.
*/
- int e = event_key();
- if ((e != ReturnKey) && (e != LeftButton))
- return;
-
- if (key[0] != '\0')
- a_UIcmd_findtext_search(tf->bw, key, case_sens);
-
+ if (event_key() == ReturnKey)
+ findtext_search_cb(widget, vtf);
}
/*
@@ -195,7 +200,7 @@ TextFinder::TextFinder(int ww, int wh, BrowserWindow *bw) :
begin();
i = new Input(0, 0, ww, ih);
i->when(WHEN_ENTER_KEY_ALWAYS);
- i->callback(findtext_search_cb, this);
+ i->callback(findtext_search_cb2, this);
cb = new CheckButton(0, ih, ww, wh-ih-bh, "Case-sensitive");