Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: purplesanz on March 23, 2020, 02:12:44 AM

Title: [ListEntry] ### Format Instead Of #?
Post by: purplesanz on March 23, 2020, 02:12:44 AM
Is it possible to have a [ListEntry] that looks like this:

001
002
003
etc.

...instead of the default 1, 2, 3?

Thank you in advance.
Title: Re: [ListEntry] ### Format Instead Of #?
Post by: keilmillerjr on March 23, 2020, 03:25:01 AM
Use a magic function and return a string formatted how you wish. :)
Title: Re: [ListEntry] ### Format Instead Of #?
Post by: purplesanz on March 23, 2020, 11:59:24 AM
Thank you for your reply.

So far, I have this:

local listbox = fe.add_listbox( x, y, w, h );
listbox.charsize = 25;
listbox.align = Align.Left;
listbox.format_string = "[ListEntry]";

But I don't understand how to do what you said. Could you please give me an example? perhaps for 01 or 00001?
Title: Re: [ListEntry] ### Format Instead Of #?
Post by: jedione on March 23, 2020, 12:21:37 PM
maby like

listbox.format_string = "0[ListEntry]";

would be  ..
01-09
010-099
0100-0999   hmm

Title: Re: [ListEntry] ### Format Instead Of #?
Post by: purplesanz on March 23, 2020, 12:39:11 PM
That's exactly what I tried last night!

But what I'm trying to achieve, is:

001
009
010
099
100
101
etc.
Title: Re: [ListEntry] ### Format Instead Of #?
Post by: keilmillerjr on March 23, 2020, 02:00:36 PM
No. A magic function. Read the docs. There is a good example. Working OT at an atf facility so not home to provide examples myself, but can help if you get a start.

https://github.com/mickelson/attract/blob/master/Layouts.md#magic
http://www.squirrel-lang.org/doc/squirrel3.html
Title: Re: [ListEntry] ### Format Instead Of #?
Post by: jedione on March 23, 2020, 03:13:51 PM
mabey somthing like this not shure if it works

Code: [Select]
fe.add_text( "[ListEntry] [[ListSize]]",
0, 0, 400, 20 );

no...it dont :-\