summaryrefslogtreecommitdiff
path: root/src/findbar.cc
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-09-12 22:48:18 +0200
committerjcid <devnull@localhost>2008-09-12 22:48:18 +0200
commit1289d19d8b8ccebb8a67adaece6ca8b6a92d2ac8 (patch)
treed9a88a546225e809ba4fedb6bb1d5437d02575a6 /src/findbar.cc
parentb4a7fddab9a30824c5c2bdfdf24e969938e5ed4e (diff)
- Fixed a crash bug with repush and non-viewable content.
Diffstat (limited to 'src/findbar.cc')
-rw-r--r--src/findbar.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/findbar.cc b/src/findbar.cc
index 0807a4fa..78f55df1 100644
--- a/src/findbar.cc
+++ b/src/findbar.cc
@@ -10,13 +10,13 @@
*/
#include <fltk/events.h>
+#include <fltk/Window.h>
#include "findbar.hh"
#include "msg.h"
#include "pixmaps.h"
#include "uicmd.hh"
#include "bw.h"
-#include "ui.hh"
/*
* Local sub class
@@ -31,12 +31,12 @@ public:
int MyInput::handle(int e)
{
- _MSG("findbar NewInput::handle()\n");
+ _MSG("findbar MyInput::handle()\n");
int ret = 1, k = event_key();
unsigned modifier = event_state() & (SHIFT | CTRL | ALT | META);
if (modifier == 0) {
if (e == KEY && k == EscapeKey) {
- _MSG("findbar NewInput: caught EscapeKey\n");
+ _MSG("findbar CustInput: caught EscapeKey\n");
ret = 0;
}
}
@@ -55,7 +55,7 @@ void Findbar::search_cb(Widget *, void *vfb)
bool case_sens = fb->cb->value();
if (key[0] != '\0')
- a_UIcmd_findtext_search((BrowserWindow *) fb->ui->user_data(),
+ a_UIcmd_findtext_search((BrowserWindow *) fb->window()->user_data(),
key, case_sens);
}
@@ -83,7 +83,7 @@ void Findbar::hide_cb(Widget *, void *vfb)
/*
* Construct text search bar
*/
-Findbar::Findbar(int width, int height, UI *ui) :
+Findbar::Findbar(int width, int height) :
Group(0, 0, width, height)
{
int button_width = 70;
@@ -93,8 +93,7 @@ Findbar::Findbar(int width, int height, UI *ui) :
int x = border;
height -= 2 * border;
- this->ui = ui;
- this->hide();
+ Group::hide();
begin();
hidebutton = new HighlightButton(x, border, 16, height, 0);
@@ -113,7 +112,7 @@ Findbar::Findbar(int width, int height, UI *ui) :
i->callback(search_cb2, this);
// todo: search previous would be nice
- findb = new HighlightButton(x, border, button_width, height, "&Next");
+ findb = new HighlightButton(x, border, button_width, height, "Next");
x += button_width + gap;
findb->tooltip("Find next occurrence of the search phrase");
findb->add_shortcut(ReturnKey);
@@ -140,7 +139,7 @@ int Findbar::handle(int event)
int k = event_key();
unsigned modifier = event_state() & (SHIFT | CTRL | ALT | META);
- if (modifier == 0 && k == EscapeKey) {
+ if (event == KEY && modifier == 0 && k == EscapeKey) {
hide();
ret = 1;
}
@@ -170,6 +169,7 @@ void Findbar::hide()
BrowserWindow *bw;
Group::hide();
- if ((bw = (BrowserWindow *) ui->user_data()))
+ if ((bw = (BrowserWindow *) this->window()->user_data()))
a_UIcmd_findtext_reset(bw);
+ a_UIcmd_focus_main_area(bw);
}