What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Pass object to a Wnd

Pages: (2): « First « 1 [ 2 ] Last »
Pass object to a Wnd
Author: Message:
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
36 / Male / Flag
Joined: Jul 2006
O.P. RE: Pass object to a Wnd
So maybe we phrased it a bit awkward...
But, a method/function is nothing more than an extended form of variable, so you can 'pass' methods

And when I mean, 'to pass an object/method to a window' I mean passing it to the CreateWnd function, wich would add it to the window, it's just how you phrase it

Objects, Methods and variables can all be properties of an object. When you create a constructor for your own custom object, you'll learn such things...

And as we stated before, we would like to 'pass' a 'variable/method/object' to the CreateWnd 'function' wich 'adds' them to the 'Window' so we can use them in the OnWindowCtrlClicked event, perhaps as callback, or perhaps as an settings object...
And we would like to make it standalone, instead of using a global var, especially for callbacks, this would be a great improvement
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-13-2006 06:25 PM
Profile PM Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
RE: Pass object to a Wnd
I think I know what Shondoit is asking for. He basically wants to give Window class custom properties.

Like:

code:
function createWindow(){
          var WndTest = MsgPlus.CreateWnd("interface.xml", "WndTest");
          WndTest.CustomProperty = "This is a custom property.";
}

function OnWndTestEvent_CtrlClicked(PlusWnd, ControlId){
         Debug.Trace(PlusWnd.CustomProperty);
}


[Image: clb2.jpg]
08-13-2006 06:44 PM
Profile E-Mail PM Web Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
36 / Male / Flag
Joined: Jul 2006
O.P. RE: RE: Pass object to a Wnd
Exactly, but you could also use:
code:
function createWindow(){
          var WndTest = MsgPlus.CreateWnd("interface.xml", "WndTest");
          WndTest.CustomProperty = function (x,y) { return x*y }
}

function OnWndTestEvent_CtrlClicked(PlusWnd, ControlId){
         Debug.Trace(PlusWnd.CustomProperty(2, 5));
}

Or
code:
function createWindow(){
          var WndTest = MsgPlus.CreateWnd("interface.xml", "WndTest");
          WndTest.CustomProperty = MyObject { x:3; y:4 }
}

function OnWndTestEvent_CtrlClicked(PlusWnd, ControlId){
         Debug.Trace(PlusWnd.CustomProperty.x);
}

My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-13-2006 06:47 PM
Profile PM Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
RE: Pass object to a Wnd
Right, but Cookie asked that question and there doesnt seem to be a way to do it. Though I do agree that would make things a big easier (and tidy).
[Image: clb2.jpg]
08-13-2006 06:54 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Pass object to a Wnd
quote:
Originally posted by Shondoit
So maybe we phrased it a bit awkward...
Indeed you did. And as such both of you requested a different thing (while you probably meant the same thing).

quote:
Originally posted by Shondoit
Objects, Methods and variables can all be properties of an object. When you create a constructor for your own custom object, you'll learn such things...
I did learned such things... see my previous request.

This post was edited on 08-13-2006 at 10:36 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-13-2006 10:27 PM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On