List_box object

Post Reply
Henko
Posts: 816
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

List_box object

Post by Henko »

Rem list_box object in function format. May be usefull in some app's.
Rem

Program slightly modified, see next posting
Last edited by Henko on Sun Apr 14, 2013 6:35 pm, edited 1 time in total.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4787
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: List_box object

Post by Mr. Kibernetik »

Very interesting code!
I have several comments:

1. You can safely write
IF BUTTON_PRESSED("ok") THEN
instead of
IF BUTTON_PRESSED("ok")=1 THEN

2. You can use GRAPHICS CLEAR x,x,x to clear screen instead of FILL RECT 0,0 TO ...

Currently if you select city twice it becomes black color again.

Henko
Posts: 816
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: List_box object

Post by Henko »

Mr. Kibernetik wrote:Very interesting code!
I have several comments:

1. You can safely write
IF BUTTON_PRESSED("ok") THEN
instead of
IF BUTTON_PRESSED("ok")=1 THEN

Yep, thanks

2. You can use GRAPHICS CLEAR x,x,x to clear screen instead of FILL RECT 0,0 TO ...

Thanks again, must read manual now and then :?

Currently if you select city twice it becomes black color again.
Indeed. The idea is that a selected item can be deselected again; but internally the item remained selected. I have changed that in the modified version.

Another change is that the width of the list_box (last item in the parameter list) will be calculated by the function if that parameter is given the value zero.

Post Reply