Shoutbox

[HELP] MenuButtonControl - 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: [HELP] MenuButtonControl (/showthread.php?tid=83791)

[HELP] MenuButtonControl by SmokingCookie on 05-18-2008 at 12:55 PM

Hi,

Many of you must have thought "he's been quiet for too long", well, here I am again :P (sorry :P ).

MenuButtonControls won't work, whatever I try.

Could anybody please help me?

Thanks in advance..


RE: [HELP] MenuButtonControl by matty on 05-18-2008 at 01:21 PM

Post your XML code for the control and post the Code you were using for the script portion.

Instead of just giving you the answer we want you to atleast try (which you have) so post the code and we will tell you what you did wrong.


RE: [HELP] MenuButtonControl by SmokingCookie on 05-18-2008 at 01:39 PM

XML code:

code:
            <Control xsi:type="MenuButtonControl" Id="MnuBSave">
                <Position Left="130" Top="295" Width="50" />
                <Caption>Save</Caption>
                <Menu>
                    <MenuEntry Id="MnuSaveAll">Save all notifications</MenuEntry>
                    <MenuEntry Id="MnuSaveSelected">Save selected notifications</MenuEntry>
                </Menu>
            </Control>


JS file:

code:
function OnWndNotifsEvent_CtrlClicked(PlusWnd,ControlId) {
    if(ControlId == "MnuSaveAll") {
        Debug.Trace("> Saving all notifications");
// lots of code
    }
    if(ControlId == "MnuSaveSelected") {
        Debug.Trace("> Saving selected notifications");
// lots of code
    }
}


RE: [HELP] MenuButtonControl by matty on 05-18-2008 at 01:45 PM

I forgot to ask, does the Window show? And when you click the control does anything appear in the debug window? From a quick glance everything looks ok but I don't have time to go line by line through it at the moment.


RE: [HELP] MenuButtonControl by SmokingCookie on 05-18-2008 at 01:48 PM

Window shows up nicely.
I click the control and the debugger reveals:
> Functieaanroep: "OnWndNotifsEvent_CtrlClicked"
("Functieaanroep" is Dutch for "function").


RE: [HELP] MenuButtonControl by matty on 05-18-2008 at 02:13 PM

At the top of the function do Debug.Trace(ControlId); and see what is showing when you click a control.


RE: [HELP] MenuButtonControl by SmokingCookie on 05-18-2008 at 02:26 PM

First it shows MnuBSave.

Then either MnuSaveAll or MnuSaveSelected..

So it should work (I suppose)..

EDIT::

Don;t know how, but I got it to work :D