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:
Creating Floating Pages with Pronto Script
This thread has 2 replies. Displaying all posts.
Post 1 made on Thursday September 23, 2010 at 09:29
PHBPR
Lurking Member
Joined:
Posts:
September 2010
2
Hi Everyone,

I own a Pronto TSU9400 with an extender (RFX9600) in my system and I am currently trying to improve my Remote´s Navigation experience, trying to make more fluid. I wanted help regarding prontoscript. Since I am not a programmer, I thought the people here in the forum might be able to help me out.

Here is what I would like to do :

In many pages of my remote, I wanted to have a "pop up" page which would appear/disapear from the top of the current page (it is partially transparent) upon the pressing of a hard button in the remote.

For example, I am watching a Bluray movie when someone shows up in the room. I need to pause the player and right after I need to access the Lutron Control to undim the lights.

The idea is that the remote is at the Bluray control page, then upon touching a hard button, the Lutron Control Panel would show up on top of the current page and I could undim the lights. After pressing again the same hard button, it disappears from the screen and I am back at the Bluray control page.

Well, the Lutron thing is but one example, the fact is that I would also like to make such "temporary page visits" for other reasons. For example, check the general system status, access and send commands to other zones, access the sat tv control to change the channel while listening to music from my CD (without resetting the preamp´s input from cd to sat) and etc...Then I need to get back to wherever I was.

I managed to make it work within an activity group of pages. However, I wanted to define such pages as something global, meaning, I would like to design the page just once, put it on the Home group of pages and then call it from any other page in the system that I am in, within any activity by touching a hard button within that particular activity.

I made it work within the activity. Here is how I made it work this way.

I created a template panel called LUTRONPANEL. On top of it I put 7 buttons to control the Lutron System (scenes 1 through 4, up, down and switch off). Grouped the panel and the panel all together and put it on top of each page I want it to show up when called. This makes me copy that same template on top of each page in the system that uses it....As you can see, doesn´t look that smart, but works.

Below here, are the scripts I have currently running:

1) when the specific page starts (this defines the variables/objects and make the whole Lutron Control Panel invisible at the page entry):

*******
this group of commands defines the variables/objects
*******

var lutronpanel;
lutronpanel = widget("LUTRONPANEL");

var scene1;
scene1 = widget("SCENE1");
var scene2;
scene2 = widget("SCENE2");
var scene3;
scene3 = widget("SCENE3");
var scene4;
scene4 = widget("SCENE4");

var lutrondesligar;
lutrondesligar = widget("LUTRONDESLIGAR");
var dimup;
dimup = widget("DIMUP");
var dimdown;
dimdown = widget("DIMDOWN");

*****
this group of instructions make the components of the Lutron Panel invisible at page start
*******

lutronpanel.visible = !lutronpanel.visible;
scene1.visible = !scene1.visible;
scene2.visible = !scene2.visible;
scene3.visible = !scene3.visible;
scene4.visible = !scene4.visible;
lutrondesligar.visible = !lutrondesligar.visible;
dimup.visible = !dimup.visible;
dimdown.visible = !dimdown.visible;

2) script in the hard button to call the Lutron Panel:
(this changes the status of the Lutron Control Panel fcomponents rom invisible to visible, thus, making the Lutron Control Panel show up on top of the current page)

lutronpanel.visible = !lutronpanel.visible;
scene1.visible = !scene1.visible;
scene2.visible = !scene2.visible;
scene3.visible = !scene3.visible;
scene4.visible = !scene4.visible;
lutrondesligar.visible = !lutrondesligar.visible;
dimup.visible = !dimup.visible;
dimdown.visible = !dimdown.visible;


From reading the Pronto DEv Guide, I thought it might be possible to do what I wanted using System.setGlobal() / getGlobal() commands. Makes sense?

Again, instead of copying the said Lutron Control Panel on top of each page that I want to access it from and turning it visible status on/off, I wanted to create a template in the Home section and then call it from any page within any activity I wanted by simply pressing a given hard button. That would substantially facilitate the navigation and make the program a lot lighter and probably faster.

I will post a copy of the specific CCF file mentioned herein in this forum, that way you guys can see actually what I am talking about and the solution at work. I will advise about it and provide the path to it in a post I will add here later today.

Thanks to all

Paulo
Paulo Rocha
RJ, Brazil
Post 2 made on Friday September 24, 2010 at 04:25
BluPhenix
Long Time Member
Joined:
Posts:
December 2008
371
What you can do:

Make the lutron page in a separate Resources activity with a background panel and all the buttons with associated action lists. Give tags to all widgets.

Then with a hard key press create dynamic widgets with which will display a copy of the page you created in the Resources activity. You use the provided code at the activity level or in a library at system level so that the popup will be available on every page or you can just confine it to some activities/pages.

So you can do (pseudocode):


whateverHardButton.onPress = function () {
var background = GUI.addPanel();
backgroundRes = CF.widget("Resource", "lutron", "background");
button1 = GUI.addButton();
button1Res = CF.widget("Resource", "lutron", "button1");
button2 = GUI.addButton();
button2Res = CF.widget("Resource", "lutron", "button2");
//etc.

//and copy the attributes for each widget from the resource widget on the resource page:
background.setImage(getImage(backgroundRes,0), 0);
background.visible=true;

button1.setImage(getImage(button1Res,0),0);
button1.setImage(getImage(button1Res,1),1);
button1.visible=true;

//and copy the action list of the button
button1.onPress = function () {
button1Res.scheduleActions();
}

//or use some PS
button1.onPress = function () {
//PS code
}

//Do the above for every button you have on the resource page.

//Add an "x" button to the Resource page to be used to close this popup

var closeButton = addButton();
//copy the attributes like you did for the other buttons

//define the closure of the popup:
closeButton.onPress = function() {
background.remove();
button1.remove();
//etc
}
}

This should be it. I know that it might look a bit messy, but it's the best I can do for now. Anyway explore the realm of dynamically created widgets.

This way you can change the attributes of the widgets on the resource page, and the popup will change to reflect the resource page. So you don't need to copy all the edited widgets on every single page where you need this popup, that you have to do when you use the hide on the edge of the screen technique.

In the example above every time you press the hard key all of the dynamic widgets are recreated and given attributes which can take time, how much depends on the number of the widgets created this way. You can optimize things y putting everything in a class and then just hide/unhide the widgets, but I'll leave it for you to explore this on your own for now.
OP | Post 3 made on Saturday September 25, 2010 at 01:04
PHBPR
Lurking Member
Joined:
Posts:
September 2010
2
Thanks
I will try it and get back to you.
Paulo
Paulo Rocha
RJ, Brazil


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