Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
array of panels
This thread has 6 replies. Displaying all posts.
Post 1 made on Friday January 11, 2008 at 16:21
themoose&1
Long Time Member
Joined:
Posts:
December 2007
15
Inorder to be able to scroll through texts on the display I defined as many panels (each 20 heigh by 600 wide) as I wanted to have textlines on the screen. These panels are named TextLinePanel0, TextLinePanel1 etc. In my manipulations with texts I have to address these panels in an 'absolute way'.
Is there some way to define like an array of panels, getting TextLinePanel[0], TextLinePanel[1]...., this would make my life much easier.
Post 2 made on Friday January 11, 2008 at 16:42
Digit
Long Time Member
Joined:
Posts:
December 2007
11
Maybe this
[Link: files.binkey.nl]
will give you some idea. It doesn't have an array of panels, but it does scroll and doesn't make life hard either.
Robert Hekkers
www.hekkers.net
Building an automated and online home
OP | Post 3 made on Friday January 11, 2008 at 18:10
themoose&1
Long Time Member
Joined:
Posts:
December 2007
15
Thx Robert, looks nice.
My application though is a TV Guide in which I also highlight a 'cursor line' while scrolling and highlight the program (on a textline) that is currently on air. This I cannot do with one panel displaying all program info at once.
Post 4 made on Friday January 11, 2008 at 19:54
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
I have several scrolling methods that I use. One of them is similar to what you describe.

Another One however does scroll (from a users standpoint) arbitrary text of unlimited size through a fixed window using a single panel. I use it to display DVD overviews in a DVD librarian I wrote The scrolling is very smooth and is exactly one line at a time. Hold down the page screen and the scroll just moves until you release the key or the begining/end is reached. Instead of an array of panels I used an array of text lines and dumped the appropriate lines into the single panel starting at the point in the array of lines I wanted at the top. It happens so fast that it actually appears to smoothly scroll to the eye. Something about motion as perceived by the eye and a speed of 15 times per second or 75 miliseconds
Post 5 made on Friday January 11, 2008 at 21:44
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,003
Since you need a different background per line, you cannot resort to using my scrolled text panel approach that I created for the RSS example. You will therefore need to define your text panels 0-9 as you did as tagged widgets. Unfortunately, the best you can do is to define 10 widgets such as you have done and then initialize an array with them.

var arrWidgets = [];

for(var i=0;i<10;i++)
{
arrWidgets[i] = GUI.widget('TextPanel'+i);
}

Then, with the widgets in an array, you can address just like a regular array. ProntoScript does not currently support creation of widget arrays or creating widgets dynamically such as new Widget(). Another bit of a pain is usually you want to change the background and possibly text colors. You cannot do this via scripting either. As a result, you must define several "layered" widgets for a single row of your list. They are as follows (layers from back to front):

1. Panel for background color default
2. Panel for background color selected
3. Panel for text color default
4. Panel for text color selected
5. Possibly a Panel for text color disabled.
6. Possible Button if you want to click the item.

Then, you maintain state of each entry of your list and toggle visibility as required for the various layers. For example, an unselected but pressable item would have Widgets 1, 3, and 6 where visible=true. All others have visible=false.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Saturday January 12, 2008 at 06:36
themoose&1
Long Time Member
Joined:
Posts:
December 2007
15
Thx Lyndel, that array definition was what I was looking for. Apparently the array variables inheret the properties (.label, .top etc) from the widgets, as was what I required. Your 'layer' description was indeed the way I handled my cursor highlighting.
Post 7 made on Saturday January 12, 2008 at 13:16
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,003
They do. The following is covered in the Flanagan book.

What one should realize is that Arrays, Widgets, Images, Pages, Activities, etc are Javascript Objects and not Javascript Primitives (Boolean, Number, String).

When you assign an Object to a variable, a "reference" to the Object is stored, not the "value" or "copy" of the Object.

If you assign Primitives to a variable, a copy is made.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse