Shoutbox

[!REQUEST!] very simple, but I can't - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [!REQUEST!] very simple, but I can't (/showthread.php?tid=84935)

[!REQUEST!] very simple, but I can't by bramvandeperre on 07-20-2008 at 01:55 PM

heya folks,

I need just one tiny XML that creates a Plus! window, with the text "Hoeveel geld heb je gekregen?", a text field under it, and an OK button.

and I need the code to call the window and get what's in the textfield ;)

can someone help me please?:$

regards,
Bram


RE: [!REQUEST!] very simple, but I can't by tribbium on 07-20-2008 at 02:25 PM

Here's some simple code that will get what you want done. You can modify it to change the titles/headers or whatnot.

XML file (save in Unicode)

quote:
<Interfaces xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
<Window Id = "WindowA" Version = "1">
    <Attributes>
        <Caption>Caption Here</Caption>
    </Attributes>

    <TitleBar>
        <Title><Text>Title Here</Text></Title>
    </TitleBar>

    <Position ClientWidth = "200" ClientHeight = "68"/>

    <Controls>
        <Control xsi:type = "StaticControl" Id = "Label">
            <Position Left = "10" Top = "20" Width = "150"/>
            <Caption>Hoeveel geld heb je gerkregen?</Caption>
        </Control>
        <Control xsi:type = "EditControl" Id = "EditFld">
            <Position Left = "10" Top = "35" Width = "180"/>
        </Control>
        <Control xsi:type = "ButtonControl" Id = "OkBtn">
            <Position Left = "150" Top = "50" Width = "40"/>
            <Caption>Ok</Caption>
        </Control>
    </Controls>
</Window>
</Interfaces>

To open the window, use this line
quote:
MsgPlus.CreateWnd("ExampleWnd.xml", "WindowA");

To get the info, you'll need a function
quote:
function OnWindowAEvent_CtrlClicked (PlusWnd, ControlId)
{
    if (ControlId == "OkBtn")
    {
        PlusWnd.GetControlText ("EditFld");
    }
}

The line PlusWnd.GetControlText ("EditFld") will return you a String, and you can handle that however you wish. You might want to dummy proof and make sure that the field isn't blank or that they don't preemptively close the window.
RE: [!REQUEST!] very simple, but I can't by bramvandeperre on 07-20-2008 at 02:28 PM

I don't want to check, i will use it myself to easily update my PSM :D

hrm, doesn't work? :S

oh well i'll try a bit :D

thanks

update: nope. not even Plus!'s Interface Tester lets the xml work.. saved it as res1.xml, loaded it as res1.xml..

grr! update: Dreamweaver changed unicode to ANSI.. grmbl