-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jorge Arellano Cid wrote:
On Wed, May 21, 2008 at 12:02:14AM +0200, Justus Winter wrote:
attached is a patch that transforms dillos find in page dialog box into a firefox style toolbar.
Nice!
Committed with some changes. See below. Corvid spotted two spelling errors. Patch is attached.
There are some issues that I cannot put my finger on... see the comments in the event handler. Maybe there's some magic about fltks event model that I did not fully understand... then again it might be fltks fault. Anyway, I'd be happy for some hints.
Ok, the comment says:
/* BUG: this is acting funny * * 1. figure out why the first EscapeKey is only * sent to the input widget if it is focused at the time * 2. ctrl-f ; type foo ; select foo and type bar ; press esc * => foo is inserted into the input box */
Fixed both in the committed version.
FLTK2 sends the event to handle() and its return value tells whether the event was handled or not. Here, the input widget was handling the event (and making the selection empty) so there was no need to propagate the event upwards, but when the selected text was already empty (second time) there was nothing to do and the event was propagated upwards.
The patch was the same as for the location bar. A custom input widget that handles keys in a slightly different way that the native Input widget. In this case (MyInput) we don't handle the escape key and let FLTK pass it upwards, and thus get the desired effect. Thanks for the explanation... It really makes sense, but for some strange reason I assumed that the events bubble the other way around...
Justus - -- gpg key fingerprint: C82D 382A AB38 1A54 5290 19D6 A0F9 B035 686C 6996 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIN3q9oPmwNWhsaZYRAoBQAKCw/pncNv/vWyN3cVGuGYoH/ZHxdQCcCrJ3 J/S96py9oODzwP24jdg496U= =SCyw -----END PGP SIGNATURE-----