What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Window does not show up

Window does not show up
Author: Message:
Sh4wn
New Member
*


Posts: 14
Joined: Jul 2006
O.P. Window does not show up
I'm making a script, and I want a configuration window. But the problem is, when I click the menu entry of my script, no window shows up. I've added some Debug.Trace() in the same event, and they appear in the debugger console.

My interface.xml file is valid (I Created and validated it with XML Spy).

These are my files:

interface.xml
code:
<?xml version="1.0" encoding="UTF-8"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd">
    <GlobalColors>
        <GlobalColor Id="green">
            <Red>80</Red>
            <Green>200</Green>
            <Blue>65</Blue>
            <Alpha>220</Alpha>
        </GlobalColor>
        <GlobalColor Id="red">
            <Red>250</Red>
            <Green>0</Green>
            <Blue>0</Blue>
            <Alpha>220</Alpha>
        </GlobalColor>
        <GlobalColor Id="white">
            <Red>255</Red>
            <Green>255</Green>
            <Blue>255</Blue>
            <Alpha>255</Alpha>
        </GlobalColor>
        <GlobalColor Id="black">
            <Red>0</Red>
            <Green>0</Green>
            <Blue>0</Blue>
            <Alpha>255</Alpha>
        </GlobalColor>
        <GlobalColor Id="grey">
            <Red>223</Red>
            <Green>223</Green>
            <Blue>223</Blue>
            <Alpha>255</Alpha>
        </GlobalColor>
        <GlobalColor Id="ref">
            <BaseColor>
                <Saturation>2.5</Saturation>
                <Brightness>0.8</Brightness>
                <Transparency>220</Transparency>
            </BaseColor>
        </GlobalColor>
    </GlobalColors>
    <Window Id="WndFileCfg" Version="1">
        <Attributes>
            <Caption>Configure File Sender</Caption>
        </Attributes>
        <TitleBar>
            <Title>
                <Text>Configure File Sender</Text>
            </Title>
        </TitleBar>
        <Position Width="350" Height="275"/>
        <DialogTmpl>
            <BottomBar Style="Plain">
                <RightControls>
                    <Control xsi:type="ButtonControl" Id="btnClose">
                        <Position Top="0" Width="60" Left="0"/>
                        <Caption>Close</Caption>
                    </Control>
                </RightControls>
            </BottomBar>
        </DialogTmpl>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblTitle">
                <Position Top="10" Width="250" Left="10"/>
                <Color>
                    <GlobalColor>ref</GlobalColor>
                </Color>
                <Font>
                    <Bold>true</Bold>
                    <Size>12</Size>
                </Font>
                <Caption>File Sender Configuration</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>


Sendfiles.js
code:
/******************************************************************
*  Script made by Lucas van dijk
*
*  This script sends a specific file on command
*******************************************************************/

// Global vars
var valid_files = new Array();
valid_files[0] = new File("boten anna", "C:\\Documents and Settings\\Lucas\\My Documents\\My Music\\BassHunter - Boten Anna.mp3");
valid_files[1] = new File("file sender", "C:\\Program Files\\Messenger Plus! Live\\Scripts\\Sendfiles\\Sendfiles.plsc");

function OnEvent_Initialize(MessengerStart)
{
    // Nothing here @ the moment   
}

function OnEvent_Uninitialize(MessengerExit)
{
}

function trim(string)
{
    // Remove whitesc
    while(string.charAt(0) == ' ')
    {
        string = string.substring(1);
    }
   
    while(string.charAt(string.length - 1) == ' ')
    {
        string = string.substr(0, string.length - 1);
    }
   
    return string;
}

function OnEvent_ChatWndReceiveMessage(wnd, user, message, kind)
{
    if(message.charAt(0) == "!")
    {
        var command = trim(message.substring(1, message.indexOf(" ")));
        var param = trim(message.substring(message.indexOf(" ")));
       
        Debug.Trace("Command: " + command + ", param: " + param);
       
        switch(command)
        {
            case "send":
                var valid = false;
               
                for(var i = 0; i < valid_files.length; i++)
                {
                    if(param == valid_files[i].getName())
                    {
                        wnd.SendFile(valid_files[i].getPath());
                        valid = true;
                        break;
                    }
                }
               
                if(!valid)
                {
                    var message;
                    message = "Het opgegeven bestand is niet geldig.\nJe kan kiezen uit de volgende bestanden:\n\n";
               
                    for(var i = 0; i < valid_files.length; i++)
                    {
                        message += (i+1) + ". " + valid_files[i].getName() + "\n";
                    }
               
                    wnd.SendMessage(message);
                }
            break;
        }
    }
}                       
               
function OnGetScriptMenu(Location)
{
    return "<ScriptMenu><MenuEntry Id='MenuFileCfg'>Configure File Sender</MenuEntry></ScriptMenu>";
}

function OnEvent_MenuClicked(id, Location, wnd)
{
    if(id == "MenuFileCfg")
    {
        Debug.Trace("Create CFG window..");
        MsgPlus.CreateWnd("interface.xml", "WndFileCfg");
        Debug.Trace("Done.");
    }
}

function OnWndFileCfgEvent_CtrlClicked(wnd, ctrl_id)
{
    switch(ctrl_id)
    {
        case "btnClose":
            wnd.Close();
        break;
    }
}


What's the problem?

Omfg, no identing here ^o)

This post was edited on 07-14-2006 at 08:48 AM by Sh4wn.
07-14-2006 08:47 AM
Profile E-Mail PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Window does not show up
Did you save it as a Unicode document? Open and save in wordpad should do it. Although I just skimmed through the code, but try the Unicode first.
07-14-2006 09:05 AM
Profile E-Mail PM Web Find Quote Report
Sh4wn
New Member
*


Posts: 14
Joined: Jul 2006
O.P. RE: Window does not show up
Ah great thanks! Got it working. :D
07-14-2006 09:10 AM
Profile E-Mail PM Find Quote Report
« 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