Shoutbox

controls in menus - 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: controls in menus (/showthread.php?tid=69406)

controls in menus by h.robertson on 12-12-2006 at 03:34 PM

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?
RE: controls in menus by Felu on 12-12-2006 at 03:41 PM

No thats not possible. Use a configuration window for the it instead?


RE: controls in menus by h.robertson on 12-12-2006 at 03:47 PM

ok

you're absolutly 100% sure its not possible? have you tried?


RE: controls in menus by Spunky on 12-12-2006 at 04:08 PM

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 *-)


RE: controls in menus by h.robertson on 12-12-2006 at 05:07 PM

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
RE: controls in menus by Spunky on 12-12-2006 at 05:08 PM

Make sure the file is saved as Unicode (Unicode-16? :s)


RE: controls in menus by gravier on 12-13-2006 at 12:03 PM

Hi,

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

Thx.


RE: controls in menus by NanaFreak on 12-13-2006 at 12:08 PM

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


RE: controls in menus by Eljay on 12-13-2006 at 12:24 PM

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".