Newbie question: use of fields for mobile phone sim

Sarah Reichelt sarahr at genesearch.com.au
Wed Jan 26 22:00:44 EST 2005


> Since I'm creating a prototype of a mobile phone application in
> Revolution, the boss would like it to be "as close as possible" to the
> real thing.  To give some context, take a look at this picture:
> http://img93.exs.cx/my.php?loc=img93&image=generic8gy.jpg
> Each line must be 29 pixels high, and the text 42 pixels over from the
> left.  There may be different icons on each line, which are 7 pixels
> over, and vertically centered on each 29 pixel-high line.
>
> Now, I'm wondering the best way to implement this.  The text in each
> line will be pulled from a stack containing names (imagine a list of
> contacts).  Is it better to:
>
> A) Create several single-line fields?  The problem with this comes into
> play when there are more than 8 items...figuring out scrolling could be
> awful.
> B) Create a multi-line field.  This seems easier, but how do I put
> different images on each line?  If the user scrolls up and down, I'd
> like the correct image to stay on the correct line.
> C) Something I haven't thought of yet?
>
> The thought of different icons (and dealing with the transparency) is
> giving me headaches.  How do I best approach this as a Revolution
> newbie?
>
Hi Jason,

This is an interesting application for Revolution.
A single scrolling field is probably the easiest. Set your font and 
make sure the fixedLineHeight is set so that you get your 29 pixels per 
line.
For the icons, the easiest thing is to use the imageSource which allows 
you to insert a picture instead of a single character in any field.
e.g.
put "XLine 1" into your field.
The X can be any character even a space, it's just a placeholder for 
the image.
Now import an image into your stack and give it a useful name say 
"ContactPic"
Then type this in the Message Box:
set the imageSource of char 1 of field "MyList" to "ContactPic"
Your image will then appear instead of the letter X in the field.

Transparency is just a matter of getting the image right in a graphics 
editor and then saving it as a gif or png so the transparency is 
preserved. When you import it into Rev, the transparency should still 
be there although I have had trouble with GraphicConverter's pngs.

Unless you have a lot of large images, I would recommend importing them 
all into your stack and giving them logical names. You can then hide 
them but still use them for button icons or imageSources.

Cheers,
Sarah



More information about the use-livecode mailing list