|
|
|
The following page was printed from RemoteCentral.com:
Topic: | Buttons Order & Listing This thread has 6 replies. Displaying all posts. |
|
Post 1 made on Saturday October 2, 2010 at 00:03 |
nicroman Lurking Member |
Joined: Posts: | August 2010 2 |
|
|
I might be completely dumb, but couldn't find the information in this forum nor in the pronto script documentation...
Question 1: How one can enumerate buttons insides a page ?
Looking at the Page description in documentation, it states that a Page is basically an array of widgets... But accessing the page with an index does only return an error. Additional question: Is it possible to find "groups" in the configuration file ? or is this only available to the PEP UI ?
Question 2: How one can "re-order" buttons in a page ?
Let say you have button 1 on top of button 2 on top of button 3.... How (from prontoscript) can we move button 1 between button 2 and button 3 ? (of course, if the question before returns some kind of array, it all becomes easier ;) ).
|
|
Post 2 made on Saturday October 2, 2010 at 01:46 |
alpha Long Time Member |
Joined: Posts: | September 2003 258 |
|
|
If you create the buttons Dynamically you can change the order of the buttons that are Dynamically created. Here is a example of a Button taken from PS Developers Guide. Example 3.5. Dynamically created button var w; w = GUI.addButton(); w.setColor(0x000000, 0); /* Black */ w.setBgColor(0x701919, 0); /* Midnight Blue */ w.setColor(0x000000, 1); /* Black */ w.setBgColor(0x00a5ff, 1); /* Orange */ w.left = 10; w.top = 100; w.width = 80; w.height = 30; w.fontSize = 20; w.label = "Go!"; w.visible = true;
If you made three button this way and called them u,v,and w . Change the order when creating them.
w,v,u or v,w,u or w,u,v .....
|
Project Boredom 2 is here. [Link: mediafire.com]------------------------ Check Version 1 & 2 out in the files section. |
|
Post 3 made on Saturday October 2, 2010 at 01:50 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,999 |
|
|
On October 2, 2010 at 00:03, nicroman said...
I might be completely dumb, but couldn't find the information in this forum nor in the pronto script documentation...
Question 1: How one can enumerate buttons insides a page ?
Enumeration is not possible although I've requested such a feature. You must know the tags (aka ProntoScript names) of Activities, Pages, Widgets (Buttons, and Panels). I also requested that instead of PageEnter/Exit, we have OnPageEnter/OnPageExit events.| Question 2: How one can "re-order" buttons in a page ? ZOrder is the term you are looking for and you cannot change the ZOrder. Again, a feature I've previously requested. The only way to bring a widget to the front is to create a new one dynamically which is documented in the post above.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
OP | Post 4 made on Saturday October 2, 2010 at 12:22 |
nicroman Lurking Member |
Joined: Posts: | August 2010 2 |
|
|
Yes I'm already doing dynamic UI, and I saw (by experience) that buttons are ordered the same order they were created... It was all about pre-existing widgets & enumerations....
zOrder like in IE ? I knew (and tried) the z-index "regular" javascript property with no result.... never thought about the zOrder... but since you are saying it is not working :(
Bah... I will have to find some other solution.
Too bad enumerating widgets is not possible :(
|
|
Post 5 made on Saturday October 2, 2010 at 14:47 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,999 |
|
|
The only way to change order is effectively to destroy and recreate widgets. However, you can't do that with those widgets that are predefined on a page using the editor.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
Post 6 made on Saturday October 2, 2010 at 15:18 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
With regard to enumeration, When I build "Lists" wherein i wish to be able to seperately address each item (Gnerally a button) in in the list. I do that by adopting a simple naming convention for the items prontoscrip tag of the form "Item_0", "Item_1", "Item_2"...
You can then address them inside an iterative procedure such as for(i=...) by referring to them as "Item_"+i. You have to be careful about things like "Item_"+a+b due to Javascriopts overloading of the Plus operator to mean both addition and concatenation. One of the nuances of Javascript I really detest.
|
|
Post 7 made on Sunday October 3, 2010 at 08:42 |
buzz Super Member |
Joined: Posts: | May 2003 4,382 |
|
|
I use Barry's approach. If you are absolutely consistent about names, lots of scripting techniques are possible. At the end of each activity I define a page of "jump" buttons. At this point one can easily script executeActions() or scheduleActions() and jump to pages. Consistent names make this much easier.
I have an action queue that can be a mix of IR commands and jumps and the scheduling can be synchronous (execute in order, on time) or asynchronous (add to beginning of execution queue). I keep the queue sorted by execution time.
After you have come this far, dealing with one of those dumb TV sets, that require MANY seconds to get their heads together after PowerOn, is very easy. Now I can delay the TV's input selection command as long as necessary without holding up the whole program. I absolutely hate those "Please Wait" delay techniques. For the user, the program seems to execute much faster because the program lands on the appropriate device almost immediately. Rather than staring at a slowly progressing bar, the user can have a cable channel selected and the volume set before the lazy TV is ready.
It was a little creepy the first few times that I used this feature because I landed on the device page so promptly. Seemingly too promptly, because I knew that many of the IR commands had yet to be issued and the lazy TV Input command was still 10 seconds out.
Note that this works very well in conjunction with the RFX9400 or RFX9600. If the customer is too cheap to go for the RFX, I will not use this technique because the operator is likely to move the remote to a bad location before the TV input selection IR command is issued. (I'm still working on my sales technique. I must be doing something wrong. For the customer who can justify a Pronto, I can't imagine why the addition of an RFX9400 could break the deal, but it sometimes does.)
|
|
|
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.
|
|