3 questions from a newbie

Klaus Major klaus at major-k.de
Thu Mar 31 10:26:10 EST 2005


Dag Rob,

> I am in my second trial period, still trying to
> complete a application.
> For this time I cannot find a solution for:
>
> 1.
> how to import an icon from elswhere?
> I cannot find the good one in the build-in iconlist

An icon is NOTHING else than a "simple" image displayed INSIDE a button!

Do this:

1. Import an image (jpg, gif, png)...
2. Note its ID in the inspector "Basic Poperties"...
3. Create a button and make it as big as the image, set its "show name" 
to false...
4. Set its icon to the ID of the image -> "Icons and Borders" -> icon...

Et voila, you created your first own "icon" :-)

> 2.
> In a listbox-field I want the selectedt line be hilited permanently
> until a next line is clicked. Now the the line is hilited for the
> tihe mouse is pressed down.

Create a listfield (scrollabel or not) and UNCHECK "autohilite" in the 
inspector

Then put this into the script of that field:

on mouseup
   set the hilitedlines of me to word 2 of the mouseline
end mouseup

Done :-)

But please remember that the current behaviour IS the way listfields 
are supposed to work!

> 3.
> In the same listboxfield I want to choose a line just by pressing down
> a key: f.i. the R to get the first line beginning with a R.

Put this into the script of the card where your field is on:

I refger to "fld 1" in my script!

on keyUp lekey
   if lekey = "a" then
     set the scroll of fld 1 to 0
     set the hilitedlines of fld 1 to 1
     exit keyup
   end if
   put lineOffset(return & lekey, field 1) into lo
   set the scroll of field 1 to lo * the effective textHeight of field 1
   if lo = 0 then
     beep
   else
     set the hilitedlines of fld 1 to (lo + 1)
     ##send "mouseup" to fld 1
    ## Just in case you would like to "auto click" that line
   end if
end keyUp

Not tested! :-)

> The only way to choose now is with mouse or arrow-keys.
>
> Please reply to my own emailaddress too !!!!
> Thanks a lot
> Rob
>
> robmeyer at hetnet.nl
> www.japrosoft.com

Tot dan & groetjes

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list