What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » controls in menus

controls in menus
Author: Message:
h.robertson
New Member
*


Posts: 3
Joined: Dec 2006
O.P. controls in menus
Is it possible to create controls in menus?

specificaly, i want to have a textbox or "EditControl" within the menu.
I tried this and a few variations:
code:
function OnGetScriptMenu(Location)
{
    var ScriptMenu = "<ScriptMenu>";
    ScriptMenu += "<MenuEntry Id=\"MnuInter\"><Control xsi:type=\"EditControl\" _ Id=\"txtInter\"><DefaultText>123</DefaultText></Control></MenuEntry>";
    ScriptMenu += "<Separator/>";
    ScriptMenu += "<MenuEntry Id=\"MnuAbout\">Help</MenuEntry>";
    ScriptMenu += "</ScriptMenu>";
   
    return ScriptMenu;
}

the idea is that the menu can be accessed, the value typed in, then when the focus is lost and the menu disappears, a variable is updated with the value from the text box.

and of course, the default value of the text box would be the initial value of the variable.

any ideas?
12-12-2006 03:34 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: controls in menus
No thats not possible. Use a configuration window for the it instead?
12-12-2006 03:41 PM
Profile E-Mail PM Web Find Quote Report
h.robertson
New Member
*


Posts: 3
Joined: Dec 2006
O.P. RE: controls in menus
ok

you're absolutly 100% sure its not possible? have you tried?
12-12-2006 03:47 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: controls in menus
I think it uses seperate functions to parse the XML so Control won't be recognised as an object in the OnGetScriptMenu event handler code

EDIT: This is just me probably not knowing too much again, but I'm not sure the _ works as it does it VB and so on where it tells the script the rest of the code is on the next line *-)

This post was edited on 12-12-2006 at 04:10 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
12-12-2006 04:08 PM
Profile PM Find Quote Report
h.robertson
New Member
*


Posts: 3
Joined: Dec 2006
O.P. RE: controls in menus
yer. i put the _ just for the post.

now i am having problems with the window im trying to make..

code:
function OnEvent_MenuClicked(itemid){
    if (itemid == "MnuConfig"){
    confwnd = MsgPlus.CreateWnd("ConfigWindow.xml","ConfigWindowID");
    }
}


ConfigWindow.xml:
code:
<?xml version="1.0" encoding="UTF-16"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd" Name="RealPlayer Configuration">

    <Window Id="ConfigWindowID" Version="1">
        <Attributes>
            <TopMost>true</TopMost>
        </Attributes>
        <Position Width="337" Height="236"/>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblInterval">
                <Position Top="4" Width="50" Height="33" Left="4"/>
                <Caption>Update Interval:</Caption>
            </Control>
            <Control xsi:type="EditControl" Id="txtInterval">
                <Position Top="4" Width="121" Left="60"/>
            </Control>
        </Controls>
    </Window>
</Interfaces>

i click the button on the menu and nothing happens...

i have looked at the interfaces from MsgPlusLiveRes.dll but i cant find a simple example

thanks

This post was edited on 12-12-2006 at 05:07 PM by h.robertson.
12-12-2006 05:07 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: controls in menus
Make sure the file is saved as Unicode (Unicode-16? :s)
<Eljay> "Problems encountered: shit blew up" :zippy:
12-12-2006 05:08 PM
Profile PM Find Quote Report
gravier
New Member
*

Avatar
Pwet !

Posts: 5
32 / Male / Flag
Joined: Dec 2006
RE: controls in menus
Hi,

I have the same problem as h.robertson.
How can I save the file as Unicode?

Thx.
12-13-2006 12:03 PM
Profile E-Mail PM Web Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: controls in menus
try using Wordpad it saves it in UTF-16

if you were trying to use notepad thats the reason. it saves as UTF-8

hope this helps
12-13-2006 12:08 PM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: controls in menus
quote:
Originally posted by NanaFreak
try using Wordpad it saves it in UTF-16

if you were trying to use notepad thats the reason. it saves as UTF-8

hope this helps

Notepad is perfectly capable of saving as UTF-16, just select "Unicode".
12-13-2006 12:24 PM
Profile 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