What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » A simple question about scripts^^

Pages: (2): « First « 1 [ 2 ] Last »
A simple question about scripts^^
Author: Message:
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: A simple question about scripts^^
quote:
Originally posted by Light86
<Window Id="WndTest" Version="1">
quote:
Originally posted by Light86
"WindowName");
those should be the same...
So use:
var WindowName = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");

This post was edited on 04-26-2007 at 03:18 PM by foaly.
04-26-2007 03:17 PM
Profile E-Mail PM Find Quote Report
Light86
Junior Member
**


Posts: 17
Joined: Apr 2007
O.P. RE: A simple question about scripts^^
Done...the code now is

code:
function OnEvent_Initialize(MessengerStart)
{
    var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}


function OnEvent_Uninitialize(MessengerExit)
{
}



But still 1 can't c any windows when 1 enter msn...1 got plus version 4.20.0.672..maybe it's this the problem?
04-26-2007 04:49 PM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: A simple question about scripts^^
This could be for following reasons (some mentioned before).
1. The file is not UTF-16 (UNICODE).
2. The XML is not valid (something is wrong with it).
3. The XML-file is not InterfaceTest.xml.
4 8 15 16 23 42
04-26-2007 05:00 PM
Profile E-Mail PM Find Quote Report
Light86
Junior Member
**


Posts: 17
Joined: Apr 2007
O.P. RE: A simple question about scripts^^
Thanks much!Now it works:D
But now..how can 1 display a picture inside this window?
04-26-2007 05:23 PM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: A simple question about scripts^^
You create a folder in your script folder called "Images". Then you put something like this in your <elements>:
code:
        <Element xsi:type="ImageElement" Id="MyImage">
            <Position Top="1" Left="1"/>
            <Image><Name>Image Name here</Name></Image>
        </Element>

It's all in the scripting documentation.
4 8 15 16 23 42
04-26-2007 05:35 PM
Profile E-Mail PM Find Quote Report
Light86
Junior Member
**


Posts: 17
Joined: Apr 2007
O.P. RE: A simple question about scripts^^
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <Window Id="WndTest" Version="1">
            <Attributes>
                <Caption>Test Window</Caption>
            </Attributes>

            <TitleBar>
                <Title><Text>Hello!</Text></Title>
            </TitleBar>

            <Position Width="180" Height="75"/>
            <DialogTmpl/>

            <Controls>
                <Control xsi:type="StaticControl" Id="LblTop">
                    <Position Left="10" Top="10" Width="150"/>
                    <Caption>Hello world!</Caption>
                </Control>
             
              <Element xsi:type="ImageElement" Id="MyImage">
              <Position Top="1" Left="1"/>
               <Image><Name>Dark.jpg</Name></Image>
                </Element>


                <Control xsi:type="ButtonControl" Id="BtnClose">
                    <Position Left="112" Top="25" Width="50"/>
                    <Caption>Close</Caption>
                </Control>
            </Controls>
        </Window>

    </Interfaces>

Something still doesn't work...1 don't know very well the xml8-)
Anyway 1 didn't c anything like "how to put an image in a window" in the script documentation...

This post was edited on 04-26-2007 at 06:12 PM by Light86.
04-26-2007 05:51 PM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: RE: A simple question about scripts^^
quote:
Originally posted by Light86
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <Window Id="WndTest" Version="1">
            <Attributes>
                <Caption>Test Window</Caption>
            </Attributes>

            <TitleBar>
                <Title><Text>Hello!</Text></Title>
            </TitleBar>

            <Position Width="180" Height="75"/>
            <DialogTmpl/>

            <Controls>
                <Control xsi:type="StaticControl" Id="LblTop">
                    <Position Left="10" Top="10" Width="150"/>
                    <Caption>Hello world!</Caption>
                </Control>
             
              <Element xsi:type="ImageElement" Id="MyImage">
              <Position Top="1" Left="1"/>
               <Image><Name>Dark.jpg</Name></Image>
                </Element>


                <Control xsi:type="ButtonControl" Id="BtnClose">
                    <Position Left="112" Top="25" Width="50"/>
                    <Caption>Close</Caption>
                </Control>
            </Controls>
        </Window>

    </Interfaces>

Something still doesn't work...1 don't know very well the xml8-)
Anyway 1 didn't c anything like "how to put an image in a window" in the script documentation...

In the <elements> tag, not the controls tag.. The XML should be like this:
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <Window Id="WndTest" Version="1">
            <Attributes>
                <Caption>Test Window</Caption>
            </Attributes>

            <TitleBar>
                <Title><Text>Hello!</Text></Title>
            </TitleBar>

            <Position Width="180" Height="75"/>
            <DialogTmpl/>

            <Elements>
                     <Element xsi:type="ImageElement" Id="MyImage">
                                <Position Top="1" Left="1"/>
                                <Image><Name>Dark.jpg</Name></Image>
                     </Element>
             </Elements>
            <Controls>
                <Control xsi:type="StaticControl" Id="LblTop">
                    <Position Left="10" Top="10" Width="150"/>
                    <Caption>Hello world!</Caption>
                </Control>
             
                <Control xsi:type="ButtonControl" Id="BtnClose">
                    <Position Left="112" Top="25" Width="50"/>
                    <Caption>Close</Caption>
                </Control>
            </Controls>
        </Window>

    </Interfaces>
I suggest you to learn XML, it will help you a lot. If this still doesn't work, try converting Dark.jpg to Dark.png, and just enter:
code:
<Image><Name>Dark</Name></Image>
4 8 15 16 23 42
04-26-2007 06:17 PM
Profile E-Mail PM Find Quote Report
Light86
Junior Member
**


Posts: 17
Joined: Apr 2007
O.P. RE: A simple question about scripts^^
It worked u're great!:D
But really xml is so useful?
Anyway there's another prob(please have a little more patienceT_T):the image is too big for this window...is there a way to increase its size?
[Solved!Thx everyone for the help!!!1 hope to post a script of mine too in this forum  someday;)]

This post was edited on 04-26-2007 at 06:38 PM by Light86.
04-26-2007 06:33 PM
Profile E-Mail PM Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
34 / Male / Flag
Joined: Oct 2004
RE: A simple question about scripts^^
quote:
Originally posted by Light86
But really xml is so useful?
Yes, it is being used more and more often with application-internet interaction and often in layout design as it provides clear, understandable, and easily parsed data. Not to mention you need to know at least a bit to create a Plus script without being spoon fed everything.

quote:
Originally posted by Light86
the image is too big for this window...is there a way to increase its size?
You already specified the window's width and height so just change the values...

Also, I suggest you read all the help topics under 'XML Schemas Reference' > 'Interface Windows' in the script documentation at http://m00.cx/mpl/docs/index.html?page=ref-interface-schema.htm (or you can download it from the Scripts Database http://www.msgpluslive.net/scripts/view/13-Official-Scripting-Documentation/
The scripting documentation is there for a reason and it is extremely useful and helpful - all script developers have to refer to it to make Plus Scripts as it is the only documentation which exists for it. Also referring to other scripts which do something similar or have features you would like to incorporate would be useful.

quote:
Originally posted by Light86
1 hope to post
'1' doesnt mean 'I' so stop using it, it's really getting on my nerves as it makes your more difficult to understand.

This post was edited on 04-27-2007 at 07:23 AM by Volv.
04-27-2007 07:16 AM
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