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

Login:
Pass:
 
 

Original thread:
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.


Hosting Services by ipHouse