Shoutbox

Interface help - 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: Interface help (/showthread.php?tid=70731)

Interface help by plus on 01-15-2007 at 08:52 PM

This might be alot to ask. I have being trying to create a script that works, its almost done.
I  am stuck on the interface window how can i make it so theres a text box that when i click save it will change the word test (below) to the text that is inputed in the box.

code:
    function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
    {
       return sMessage.replace("hi", "test");
    }



one more thing,

Is there a way if somone types web (example) the script will send back wed2

Thanks in advance(Y)
RE: Interface help by matty on 01-15-2007 at 09:33 PM

Have you read and looked at the examples in the Scripting Documentation for windows?

We can't keep giving you the answers!


RE: Interface help by plus on 01-15-2007 at 09:39 PM

Yes i am sorry but i dont understand it. Most of it i do but most i dont.


RE: RE: Interface help by deAd on 01-15-2007 at 09:49 PM

quote:
Originally posted by .2007
Most of it i do but most i dont.

....what's that supposed to mean? :P

Why don't you search the forums and look at other scripts for examples before you keep posting? It'll really help, and you'll probably learn a lot more than if we just continue to post code for you :P
RE: Interface help by matty on 01-15-2007 at 09:51 PM

Unless you post code that you have tried I wont give you any. I will fix it if you post it.


RE: Interface help by CookieRevised on 01-15-2007 at 09:53 PM

What is there to not understand?

Tackle your problem step by step with logic questions, and you'll see that what you ask here is actually extremely easy...

Problem: You need to get a string from 'somewhere' so you can use it to replace a text.

How you should think:
1) That 'somewhere' is a textbox
2) A textbox is a control placed on a Plus! window
3) How do you grab text from a control placed on a Plus! window? See Plus! scripting documentation 'The PlusWnd Object'...
4) Simply take a look at the list of all the properties and functions from this object in the documentation and you'll notice the function "GetControlText", click on the link to read the details about this function.

Second problem: How to catch a button press
How you should think: Similar to the first problem and look up Events Reference > Interface Windows Events
No rocket science involved here, just some logic sense and reading...

PS: and look at other scripts...

Learn to self-study and look things up.

PS: It is not that we don't want to help, it is just that by giving you straight answers you will not learn to do anything yourself.


RE: Interface help by plus on 01-15-2007 at 10:05 PM

I look up the first one and got,
Syntax
[string] GetControlText(
    [string] ControlId
);

How dose that help....


RE: RE: Interface help by deAd on 01-15-2007 at 10:51 PM

quote:
Originally posted by .2007
I look up the first one and got,
Syntax
[string] GetControlText(
    [string] ControlId
);

How dose that help....

Well that tells you how to call it and what it returns...it's part of the PlusWnd object so you'd call it from a PlusWnd object instance. That definition also shows you what the parameters are. There's a description of each parameter below too that goes into more detail.
RE: Interface help by plus on 01-15-2007 at 10:56 PM

Do i copy it into the script then it will make a interface window


RE: Interface help by matty on 01-15-2007 at 11:02 PM

quote:
Originally posted by .2007
Do i copy it into the script then it will make a interface window
No, you need to create an Interface window in XML.

code:
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd">
   
<Window Id="SoundTransfer400" Version="1">
    <Attributes>
        <ShowInTaskbar>false</ShowInTaskbar>
    </Attributes>
   
    <TitleBar>
        <AllowMinimize>false</AllowMinimize>
        <AllowClose>false</AllowClose>
    </TitleBar>
   
    <Position Width="200" Height="60"/>
   
    <DialogTmpl>   
        <BottomBar Style="None">
            <LeftControls>
                <Control xsi:type="ProgressControl" Id="PrgWait">
                     <Position Top="5" Width="100" Left="0" Height="10"/>
                    <Marquee/>
                </Control>
            </LeftControls>

            <RightControls>
                <Control xsi:type="ButtonControl" Id="BtnCancel">
                    <Position Top="0" Width="50" Left="0"/>
                    <Caption>&amp;Cancel</Caption>
                </Control>
            </RightControls>
        </BottomBar>
    </DialogTmpl>
   
    <Elements>
        <Element xsi:type="ImageElement" Id="ImgSound">
            <Position Top="5" Left="6"/>
            <Image><Name>icon-speaker</Name></Image>
        </Element>
    </Elements>
   
    <Controls>
        <Control xsi:type="StaticControl" Id="LblMessage">
            <Position Top="5" Width="150" Left="32" Height="20"/>
            <Attributes>
                <WrapText>true</WrapText>
            </Attributes>
            <Caption>Please wait...\nThe sound is being sent.</Caption>
        </Control>
    </Controls>
</Window>

</Interfaces>


Taken right from the scripting documentation
RE: RE: Interface help by deAd on 01-15-2007 at 11:18 PM

quote:
Originally posted by Matty
quote:
Originally posted by .2007
Do i copy it into the script then it will make a interface window
No, you need to create an Interface window in XML.

And before you ask how (:P) check the scripting documentation or other scripts for examples.
RE: Interface help by plus on 01-16-2007 at 04:19 PM

i have made a xml thing


RE: Interface help by Plik on 01-16-2007 at 07:21 PM

quote:
Originally posted by .2007
i have made a xml thing
err...
[Image: go_you.gif]

Does it work now then? :P