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

Menu problem
Author: Message:
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
38 / Male / Flag
Joined: Mar 2006
O.P. Menu problem
code:
function OnGetScriptMenu(Location)
{
    var myMenu = "<ScriptMenu>";
    myMenu += "<MenuEntry Id=\"mnuNew\">New</MenuEntry>";
    myMenu += "<Separator/>";
    myMenu += "<MenuEntry Id=\"mnuAbout\">About...</MenuEntry>";
    myMenu += "</ScriptMenu>";
    return myMenu;
}
   
function OnEvent_MenuClicked(MenuItemId, Location, OriginWind)
{
    if (MenuItemId == "mnuNew") {
        WndNew = MsgPlus.CreateWnd("New.xml", "mnuNew");           
    } else if (MenuItemId == "mnuAbout") {
        WndAbout = MsgPlus.CreateWnd("About.xml", "mnuAbout");
}

that's some code I've got to make a menu (for a script that I'm probably going to need more help on once I get my head around exactly what i'm doing!)

However I can't now get the windows to show.

The menus are created properly, there's no errors in the debug window, the xml files load successfully in the tester (and I've tried substituting one for a menu window from another script which works)

I'm at a complete loss :S
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5425 days, 23 hours, 48 minutes, 39 seconds ago
01-21-2009 10:14 AM
Profile E-Mail PM Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
37 / Male / Flag
Joined: Jul 2007
RE: Menu problem
jscript code:
function OnEvent_MenuClicked(MenuItemId, Location, OriginWind)
{
    if (MenuItemId == "mnuNew") {
        WndNew = MsgPlus.CreateWnd("New.xml", "mnuNew");           
    } else if (MenuItemId == "mnuAbout") {
        WndAbout = MsgPlus.CreateWnd("About.xml", "mnuAbout");
}
The "else if" block has no closing curled bracket.
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
01-21-2009 10:28 AM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Menu problem
Did you save the New.xml in Unicode?

EDIT: And what mynetx said, although you didn't mention a syntax error so I wasn't looking that deep into it :p

This post was edited on 01-21-2009 at 10:30 AM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
01-21-2009 10:30 AM
Profile PM Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
38 / Male / Flag
Joined: Mar 2006
O.P. RE: Menu problem
There's no syntax error, I just didn't copy it properly into here, lol

and yeah, New.xml is saved as Unicode, and as I said I tried another xml file in its place from a script who's menus do load...and still nothing

it's really bizarre

This post was edited on 01-21-2009 at 11:09 AM by djdannyp.
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5425 days, 23 hours, 48 minutes, 39 seconds ago
01-21-2009 11:08 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Menu problem
Just try:
code:
function OnEvent_MenuClicked(MenuItemId, Location, OriginWind)
{
        WndNew = MsgPlus.CreateWnd("New.xml", "mnuNew");           
}

<Eljay> "Problems encountered: shit blew up" :zippy:
01-21-2009 11:16 AM
Profile PM Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
37 / Male / Flag
Joined: Jul 2007
RE: Menu problem
Maybe you should pack us a copy of the script and attach it to let us debug it.
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
01-21-2009 11:18 AM
Profile E-Mail PM Web Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
38 / Male / Flag
Joined: Mar 2006
O.P. RE: Menu problem
Here it is

The script itself probably doesn't work yet (infact it almost certainly doesn't work)

But it's not much use if I can't load the menus, lol

It's really bizarre.....i tried using Spunky's suggested code with literally nothing else in the code (except obviously the code to construct the menu)

the OnEvent_MenuClicked does get called properly (as shown in the debut window)....but just nothing shows

Edit: Attachment removed

This post was edited on 01-21-2009 at 02:26 PM by djdannyp.
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5425 days, 23 hours, 48 minutes, 39 seconds ago
01-21-2009 12:16 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Menu problem
The problem lies in the fact that you're trying to use some kind of menu identifier as window identifier.

In your JScript:
js code:
WndNew = MsgPlus.CreateWnd("New.xml", "mnuNew");
In your interfaces XML:
xml code:
<Window Id="options" Version="1">
The "mnuNew" should be replaced by "options" so that Plus! can find the right window to load. Same goes for the about window: you defined it as "About" in your interfaces but you try to open "mnuAbout".
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-21-2009 12:25 PM
Profile E-Mail PM Web Find Quote Report
djdannyp
Elite Member
*****

Avatar
Danny <3 Sarah

Posts: 3546
Reputation: 31
38 / Male / Flag
Joined: Mar 2006
O.P. RE: Menu problem
Woo, that got it sorted.....can't believe it was something so stupid!
[Image: 1ftt0hpk-signature.png]
AutoStatus Script || Facebook Status Script
5425 days, 23 hours, 48 minutes, 39 seconds ago
01-21-2009 02:26 PM
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