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:
Prontoscript question: Can I manipulate a group of widgets?
This thread has 4 replies. Displaying all posts.
Post 1 made on Saturday January 19, 2008 at 22:21
Waters_10
Long Time Member
Joined:
Posts:
October 2002
19
I'm just starting some prontoscript trials, and I know I got a lot of learning!

I'm organizing my xcf with some buttons on the left side that will be on every page. These buttons would activate more advanced buttons that don't get used that often.

My idea was to get a big panel on the opposite side, that would slide right to left and center on the screen.

After a lot trials, I got the sliding function to work and I was very happy! But then, I realized that this is an empty panel and I can't put buttons inside the panel, like I could on my old TSU1000! I tried to group the panels with some buttons, but when I do that, the panel doesn't respond to any function calling its tag.

So, since my whole config strategy revolves around these moving panels, I got to a point that I might have to rethink the whole thing, unless somebody here knows a way to group widgets and manipulate them, as a group. I guess I could write functions to move every and each button/panel, but that would be a big pain, due to big number of buttons/panels.

Any help is greatly appreciated!

Thanks
Post 2 made on Saturday January 19, 2008 at 22:25
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
You must manipulate all widgets of a group individually, even if they are "grouped" in the editor.

For my own personal use, I wrote a class named WidgetSet that allows you to add widgets to the set and then show/hide/move them as a group. This class is not publicly available but it is not hard to write.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 3 made on Sunday January 20, 2008 at 07:18
MVis
Long Time Member
Joined:
Posts:
July 2007
94
I did this when first experimenting with prontoscript and found it worked but wasn't ideal. I ended up having the buttons included as part of the image on the panel and after sliding the panel in, set a bunch of existing hidden buttons to visible over the fake panel buttons

Last edited by MVis on January 20, 2008 07:34.
OP | Post 4 made on Sunday January 20, 2008 at 11:24
Waters_10
Long Time Member
Joined:
Posts:
October 2002
19
[quote]
For my own personal use, I wrote a class named WidgetSet that allows you to add widgets to the set and then show/hide/move them as a group. This class is not publicly available but it is not hard to write.[/quote]
Could you give me some more pointers? I didn't know you could create a custom class. Is that documented in the dev guide?

[quote]I did this when first experimenting with prontoscript and found it worked but wasn't ideal. I ended up having the buttons included as part of the image on the panel and after sliding the panel in, set a bunch of existing hidden buttons to visible over the fake panel buttons[/quote]
Thanks for the suggestion. I won't do this, because I'll be adding a lot of stuff later, new panels, new buttons, new activities and I don't want to keep redoing it later.


For now, I'll probably edit my sliding function, to work with the number of pixels to move, instead of start and end point, like it was working before. Then I'll try to move them all together this way. Let's see how this works out.

Thanks!
Post 5 made on Monday January 21, 2008 at 01:41
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
Classes per se in Javascript are achieved using Constructor Functions and Prototypes.

Javascript classes are not inheritance-based like java and other Object Oriented languages. However, there are various techniques for simulating inheritance.

Douglas Crockford wrote some early articles on the subject that can be found using Google.


In a button or page script, you can do the following.

If you do it in an Activity, use Diagnostics.log() vs System.print() as since a page is not yet loaded, System.print() will never show up on a _PS_DEBUG_ panel. There are ways to make this happen but they involved the use of CF.activity().scheduleAfter() to invoke System.print() after some time period.


// Define a class.
function MyClass()
{
this.message = 'hello there';
}

// overload toString on standard Javascript Object for all instances (class-level prototype) of MyClass.
MyClass.prototype.toString() = function ()
{
return this.message;
}; // note the use of semicolon here as you are assigning a function to a prototype member field.

MyClass.prototype.getMessage = function()
{
return this.message;
};// note the use of semicolon here as you are assigning a function to a prototype member field.

MyClass.prototype.setMessage = function (newMessage)
{
this.message = newMessage;
};// note the use of semicolon here as you are assigning a function to a prototype member field.

// Now, create and use one of these objects..
var instance = new myClass();

System.print(instance);
instance.setMessage('hello again');
System.print(instance);
System.print(instance.getMessage());
// End of example.

Now that you've got this example, search the web for Javascript classes.

IMO, it is NOT Philips' responsibility to instruct on the technical aspects of Javascript.

They suggested references in the appendix of the Dev Guide including the Flanagan book where this topic is covered in explicit detail.
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