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:
Create new widgets via ProntoScript
This thread has 10 replies. Displaying all posts.
Post 1 made on Tuesday January 13, 2009 at 05:55
flattermann
Long Time Member
Joined:
Posts:
December 2008
16
Hi guys!

It's me again, sorry for asking so many dumb questions... :-)

Is it possible to dynamically create new widgets in ProntoScript?

Something like

var p = new Panel();
p.label = "Test";
p.top = 0;
p.left = 0;
p.width = 100;
p.height = 100;
p.visible = true;

Or is it possible to duplicate an existing widget via ProntoScript?

I would like to dynamically create new widgets or have a hidden LIBRARY page, get/copy the widgets from there and display them on the current page.

Thanks in advance!
Christian
Post 2 made on Tuesday January 13, 2009 at 10:09
pthornhill
Long Time Member
Joined:
Posts:
June 2008
53
no you can't do it. best you can do is have everything on the page and make it visible/invisible as/when needed. this is fine for a few objects but becomes and real ball ache if you want lots of objects on 1 page.

also this means you have duplication of objects which isn't great
Post 3 made on Tuesday January 13, 2009 at 10:42
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
although it is a similar method to pthornhill, you can also use setImage and getImage to dynamically load widget graphics. If I want to use a different pressed or released state image on a button widget, I can pull a different graphic from a different page or from a web or local PC location (with the help of some tcp sockets) .

ex: currentwidget.setImage(someotherwidget.getImage(0),1);

The above gets the released state graphic (0) from someotherwidget and assigns it to the pressed state of currentwidget (1).

There are a number of other things you can do to make a large number of widgets manageable: Use the group function in PEP2 to make object positioning easier. Place hidden objects off page (set the PEP2 editor to landscape and with the TSU9400 at least, you get extra editing space to work with. If you save and download the xcf with objects outside the screen bounds, they still transfer to the Pronto. The nice part is that you can use script to move the object into view as you have in your original example. Thus use 'top' and 'left' to shunt the image into place. If your code is fluid, it should look like a slide in effect.
You can hide almost anything until you have to put the drywall up!
OP | Post 4 made on Tuesday January 13, 2009 at 13:24
flattermann
Long Time Member
Joined:
Posts:
December 2008
16
Thanks again!

I already use .setImage() and .getImage() pretty often. :-)
But that did not solve the need to have all buttons pre-existing on the page. :-/

But I will take a look at the workaround with the off page-buttons, that may be a good start. So I can put all buttons on the page, but off the screen and dynamically show them by adjusting .top and .left... Sounds good...
Post 5 made on Tuesday January 13, 2009 at 14:30
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Off-screen will only work if you have a TSU9400. For a 9600/9800, you can move the groups to the edge of screen but at least 1 pixel must be visible in the editor.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 6 made on Tuesday January 13, 2009 at 15:20
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
I have asked the Pronto team for a change to PEP2 that would provide an infinite canvas for editig graphics with the "Pronto screen" shown as a movable rectangle. The coordinates of widgets would always be relative to the upper left corner of the screen rectangle no matter where it was. They allow the coordinates of a widget to be any 16 bit value so why not make it easy to deal with complex screens. For my 9400 work I always use the 9600 editor with a rectangle indicating the safe area which is always at 0,0.

I have heard nothing from the Pronto team, but we did discuss it at Cedia..
Post 7 made on Thursday January 15, 2009 at 00:25
Evohome
Active Member
Joined:
Posts:
April 2008
686
Guys,

Might be a stupid question, but why not just send your widgets to the back of the canvas, behind the background image?

I'm sure there's a reason one of you has not suggested this already; can you enlighten me?
And buyer beware of a man who chooses to be judged by numbers and salary, with no regard for character or integrity. Peter Gammons, ESPN
Post 8 made on Thursday January 15, 2009 at 06:06
tenchi
Long Time Member
Joined:
Posts:
January 2006
156
Ditto I do the same thing.

Hopefully they will address this issue with another issue I raised which is the fact you can't dynamically resize an image beyond 640x480.

On January 13, 2009 at 15:20, Barry Gordon said...
For my 9400 work I always use the 9600
editor with a rectangle indicating the safe area which
is always at 0,0.

I have heard nothing from the Pronto team, but we did
discuss it at Cedia..
Post 9 made on Saturday January 17, 2009 at 12:08
nyjklein
Long Time Member
Joined:
Posts:
June 2002
108
Unfortunately, there is no way to control the z-plane placement of widgets through Prontoscript, so you can't move things "to the back' or "to the front". You have to make sure the widgets have the right z-plane placement in PEP.

Prontoteam, how about adding that capability?

This limitation also impedes the ability to use "global" widgets placed on the System Page (PS_SYSTEM). Those widgets are always in the back.

Jeff
Post 10 made on Saturday January 17, 2009 at 21:09
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
I requested such functionality with the initial release of ProntoScript. The fact that there are now 3 layers of ZOrder to deal with in PEPV2 further complicates matters so I would not hold my breath for such a feature.

1. System Page
2. Activity Background
3. Current Page.

The best you can do for now is show/hide. ie. Widget.setVisible(true/false)
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 11 made on Sunday January 18, 2009 at 14:13
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
On January 15, 2009 at 00:25, Evohome said...
Guys,

Might be a stupid question, but why not just send your
widgets to the back of the canvas, behind the background
image?

I'm sure there's a reason one of you has not suggested
this already; can you enlighten me?

I use both methods (visible true/false and off-canvas move slide in). Essentially it's more a question of which one you know better or are more comfortable with as they both achieve the same result in the end. There are visual effect differences though.

If you use off-canvas, it is much easier to visualize and edit a complex page as you don't have layer upon layer of graphic images to sift through. Also if you use off-canvas, you can 'slide' a panel into view creating the infamous 'sliding panel effect'. Simply adjust your x and y positioning parameters in small increments and voila!
You can hide almost anything until you have to put the drywall up!


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