I am attaching two patches that get ListResource selection working properly, ie. you can click items as you wish and FltkListResource::isSelected() will now return the correct value. The first patch is my previous selection patch, unchanged. The second is a small fix that I proposed in the lout::misc::StringBuffer fix thread: it makes FltkListResource::addItem call Widget::set_selected() on fltk::Item widgets, and the call to Menu::set_item() becomes conditional on a virtual boolean hook that defaults to false, but is redefined to true in FltkOptionMenuResource() . The second patch looks bigger than it really is: most of it is just reindenting a block of code that moved inside an "if" statement. (And diff doesn't help by insisting on choosing an unnecessarily complicated set of changes.) It's not a pretty hack, but it's simple and I am wary of making deeper changes until I understand the code better. Please comment, Jeremy Henty
On Fri, May 02, 2008 at 11:42:18PM +0100, Jeremy Henty wrote:
I am attaching two patches that get ListResource selection working properly, ie. you can click items as you wish and FltkListResource::isSelected() will now return the correct value.
The first patch is my previous selection patch, unchanged. The second is a small fix that I proposed in the lout::misc::StringBuffer fix thread: it makes FltkListResource::addItem call Widget::set_selected() on fltk::Item widgets, and the call to Menu::set_item() becomes conditional on a virtual boolean hook that defaults to false, but is redefined to true in FltkOptionMenuResource() .
The second patch looks bigger than it really is: most of it is just reindenting a block of code that moved inside an "if" statement. (And diff doesn't help by insisting on choosing an unnecessarily complicated set of changes.) It's not a pretty hack, but it's simple and I am wary of making deeper changes until I understand the code better.
Please comment,
Very nice! Works great. Now I realized that it already supports submenus... Johannes
Hi Jeremy, In a nutshell: 00__html_dlist_fix.dillo2 10__html_select_multiple.dillo2 10__listresource.dw2 15__listresource_selection.dw2 16__listresource_sizerequest.dw2 committed with minor changes! Some minor changes: * Used (long) cast for 64bit compatibility (please somebody test). * single return point in FltkListResource::widgetCallback. * added some comments. * Removed: //blindly copied from FltkOptionMenuResource, is it necessary? R: yes, it's necessary. Each new added item may change the Width. On Fri, May 02, 2008 at 11:42:18PM +0100, Jeremy Henty wrote:
I am attaching two patches that get ListResource selection working properly, ie. you can click items as you wish and FltkListResource::isSelected() will now return the correct value.
The first patch is my previous selection patch, unchanged. The second is a small fix that I proposed in the lout::misc::StringBuffer fix thread: it makes FltkListResource::addItem call Widget::set_selected() on fltk::Item widgets, and the call to Menu::set_item() becomes conditional on a virtual boolean hook that defaults to false, but is redefined to true in FltkOptionMenuResource() .
Yes, it looks simple enough. Added a reminding comment anyway.
[...] Currently FltkListResource::sizeRequest() is a stub with some hardwired values that are not very useful. This patch replaces it with something more appropriate (closely following the existing implementation of FltkOptionMenuResource::sizeRequest() ).
Added some minor adjustments to fit the new size. Good work! -- Cheers Jorge.-
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jorge Arellano Cid wrote:
[..] * Used (long) cast for 64bit compatibility (please somebody test).
That would be me ;) I haven't looked into whether the added functionality works (didn't know where to look), but it compiles cleanly and runs just fine. It's nice that you kept an eye on the platform issue ;) Cheers, 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 iD8DBQFIH37koPmwNWhsaZYRAk+fAJ48XIMCFjaD/TbxOSYjciW1brFG+ACeJGvV qgdJPm591wlzYHgXEJxfG9Y= =xmAr -----END PGP SIGNATURE-----
On Mon, May 05, 2008 at 11:40:52PM +0200, Justus Winter wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jorge Arellano Cid wrote:
[..] * Used (long) cast for 64bit compatibility (please somebody test).
That would be me ;)
Gotcha!
I haven't looked into whether the added functionality works (didn't know where to look), but it compiles cleanly and runs just fine.
Please check the attached page. You should be able to select any set from the list, and to confirm it works by pressing the test button and looking at the generated URL.
It's nice that you kept an eye on the platform issue ;)
Sure. -- Cheers Jorge.-
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jorge Arellano Cid wrote:
I haven't looked into whether the added functionality works (didn't know where to look), but it compiles cleanly and runs just fine.
Please check the attached page. You should be able to select any set from the list, and to confirm it works by pressing the test button and looking at the generated URL.
Yes, that works nicely. But I noticed that I couldn't scroll the list content neither with my mouse wheel emulation nor with a real scroll wheel mouse. Playing around with dillo trying to scroll the content horizontally (which btw does not work with mouse buttons 6 and 7) I noticed that when I look at a large page (think /.), scroll down all the way to the bottom of the page and then resize the window making it wider you can see the content being re-rendered and moving towards the top of the window "escaping" the viewport. This should be easy to fix if you know where to look (which I don't at the moment...). 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 iD8DBQFIIEFLoPmwNWhsaZYRAuh4AJ4tTH93CQQT40PLwGm9hxfOb6O1tgCeIyD1 sDi8Q/ZWL5PSoVQt1DNiR2Q= =YVGC -----END PGP SIGNATURE-----
participants (4)
-
4winter@informatik.uni-hamburg.de
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
onepoint@starurchin.org