Shoutbox

[Help!] List Boxes - 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!] List Boxes (/showthread.php?tid=61867)

[Help!] List Boxes by rob_botch on 06-28-2006 at 09:16 AM

I am trying to make a script which relies on calling a function when the selection in a list box is changed. The code I have so far used for the function is as follows:

function OnWndTestEvent_LstBoxSelChanged(PlusWnd,ControlId)
{
if(ControlId == LstSender)
{
Wnd.SetControlText("TxtMessage", Wnd.LstBox_GetItemText("LstMessage", Wnd.GetCurSel("LstSender")));
}
}

However, when the selection is changed by clicking, the function is not called. A function for the same window being destroyed does call.

Does anyone know why this may be happening?

Thank you!


RE: [Help!] List Boxes by Eljay on 06-28-2006 at 09:32 AM

quote:
Originally posted by rob_botch

if(ControlId == LstSender)


should be:
if(ControlId == 'LstSender')
RE: [Help!] List Boxes by rob_botch on 06-28-2006 at 09:35 AM

Thank you, this would have also have caused a problem, but the function was not even being called (it wasn't displayed in the Script Debugger, when all other functions were).

Any ideas?


RE: [Help!] List Boxes by Eljay on 06-28-2006 at 09:39 AM

the window is definitely called WndTest?


RE: [Help!] List Boxes by rob_botch on 06-28-2006 at 09:45 AM

Yes, the function:

code:
function OnWndTestEvent_Destroyed(PlusWnd,ExitCode)
{
Open = "False";
}


calls as it should.
RE: [Help!] List Boxes by Eljay on 06-28-2006 at 09:53 AM

meh looking closer there are a few problems, try this:

code:
function OnWndTestEvent_LstBoxSelChanged(PlusWnd,ControlId)
{
   if(ControlId == "LstSender")
   {
      PlusWnd.SetControlText("TxtMessage", PlusWnd.LstBox_GetItemText("LstMessage", PlusWnd.LstBox_GetCurSel("LstSender")));
   }
}

RE: [Help!] List Boxes by rob_botch on 06-28-2006 at 10:15 AM

No, that doesn't work either. Is there anything else that I have missed? Thank you,


RE: [Help!] List Boxes by Mnjul on 06-28-2006 at 04:38 PM

I confirm that Plus! does not handle events of Listboxes at all. OnWindowIdEvent_CtrlClicked, OnWindowIdEvent_LstBoxDblClicked, OnWindowIdEvent_LstBoxSelChanged do not work at all for listboxes. This is quite possibly a Plus! bug.

Download my test script and see for yourself.


RE: [Help!] List Boxes by rob_botch on 06-29-2006 at 08:56 AM

Thanks. The test program doesn't work. I think it must be a bug. At least I'm not the only one with this problem!


RE: [Help!] List Boxes by matty on 06-29-2006 at 01:18 PM

As I posted in the Beta forum I suggest using a ListView until this is fixed. You can use the Report Style list view.


RE: [Help!] List Boxes by rob_botch on 06-29-2006 at 01:20 PM

Thank you for your help. What is the difference between a List Box and a List View? I presume List Views work correctly?

Thank you


RE: [Help!] List Boxes by Patchou on 07-01-2006 at 05:18 AM

Fixed, thanks fore reporting :)