To follow up a little bit -

After working with the above code I'm starting to really like it.

First a correction, where it says " $subList:=New list" change it to "
$subList:=0".
As soon as the next line is executed $sublist gets assigned a new list
anyway and this is a memory leak.

The other change I made is to write the full path to the key as another
parameter. The benefit with this is I have that path to use for updating
the c-obj when something is changed.

It turns out to be pretty simple to handle editing the values. I added an
enterable variable to the form and hide it. When I double click on the
display hList I can get all the relevant bits easily:

: (Form event=On Double Clicked)

GET LIST ITEM(Self->;*;$itemRef;$itemText)

GET LIST ITEM PARAMETER(Self->;$itemRef;Additional text;$value)

GET MOUSE($x;$y;$mousebutton)

GET LIST PROPERTIES(Self->;$appearance;$icon;$lineHeight)

OBJECT GET COORDINATES(Self->;$left;$top;$right;$bottom)


​And with a little math determine the x,y and width of where the ​to
position my hidden variable relative to the hList:

$n:=($y-$top)\$lineHeight  //  n lines from top of the list

$y:=$top+($n*$lineHeight)

$x:=$left+150  //  the 150 is arbitrary

$width:=$right-$x-18  //  18 is for the scroll bar


​Then just move it into place, make if visible and put $value into it. This
is when I realized having the full path to the value is useful - much
easier than having to work it out by walking back up the list. ​


-- 
Kirk Brooks
San Francisco, CA
=======================

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to