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

Popup ListBox
Author: Message:
7d5
New Member
*


Posts: 3
Joined: Oct 2008
O.P. Popup ListBox
Hello ppl,

I was wondering if there was a way to create a "popup ListBox" that popups next to the cursor once you start typing. Something like the autocomplete feature that we see in modern IDEz.

Any suggestions?
10-30-2008 09:02 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Popup ListBox
Hmm, that's actually a good question. I think it's possible to do this by manually positioning the ListBox control just beneath the Edit control, then fill the list every time the text changes and hide it when the Edit control loses its focus. Although it'd require quite some code to get it working I'm afraid.

I'll try to find time to have a look at this today.

Hmm, seems like I misinterpreted your idea of auto-completion. I was thinking in the likes of a search bar where you'd get suggestions in a list below it. (see the Firefox search bar for example)

What you're asking for is an IntelliSense feature like we can see in the Plus! Live script editor or Visual Studio. This is much harder to do I'm afraid... :(

Anyway, if anyone was looking for something which can do this...
[Image: 5y1rxdzv-PlusScript-AutoComplete.PNG]
...check out the attachment. :)

.plsc File Attachment: AutoComplete Example.plsc (6.08 KB)
This file has been downloaded 130 time(s).

This post was edited on 10-31-2008 at 04:27 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-31-2008 09:17 AM
Profile E-Mail PM Web Find Quote Report
7d5
New Member
*


Posts: 3
Joined: Oct 2008
O.P. RE: Popup ListBox
Your answer is perfect...and thinking of it......it could actually be used like the intellisense feature. the Mozillla example u were implying means that it only checks to c if you're gettin' closer to any of the static choices available. But why have the choices static? isn't it possible to dynamically generate values in the listbox depending on the input in the textbox? 

-------------------------------------------------------------------

One more thing....can't i have this listbox appear on normal Wnd and not a PlusWnd? something like this

Exmaple

This post was edited on 10-31-2008 at 11:11 PM by 7d5.
10-31-2008 10:32 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Popup ListBox
quote:
Originally posted by 7d5
But why have the choices static? isn't it possible to dynamically generate values in the listbox depending on the input in the textbox?
That's already implemented. Instead of passing an array as fourth argument to the constructor, you can pass a function in the following format:
code:
function AutoCompleteCallback(oAutoComplete, sInputText) {
     //oAutoComplete = the instance of the AutoComplete class
     //sInputText = the current text input
}
The function should then return an array of strings to display in the list. If you want to hide the list, simply return an empty array. So yes, you could implement all those fancy AJAX stuff and such. :P
quote:
Originally posted by 7d5
One more thing....can't i have this listbox appear on normal Wnd and not a PlusWnd? something like this

Exmaple
I'm afraid you can't. The Plus! Live scripting API gives us abilities to work with custom Plus! windows, but modifying a chat window isn't possible. It'd require advanced hooking methods such as the ones Plus! Live uses, but I think enabling this for use by scripts would be very complicated and thus it's not available to use by scripts.

I can assure you: if it would have been available to scripts, you'd already have seen a script using it somewhere before! :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
11-01-2008 08:00 AM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Popup ListBox
It is possible. I have made an external command helper in my script Date Calculator which uses a hard-coded array of command parameters. You may want to twist it a bit with the AutoComplete class to allow for dynamic arrays and there you go.
11-01-2008 02:16 PM
Profile PM Find Quote Report
7d5
New Member
*


Posts: 3
Joined: Oct 2008
O.P. RE: Popup ListBox
Hello Matti,

I guess you triger the window by trying to right click on one of the contacts and then highlighting "Messenger Plus! features" which shows an extra item called "Open"

Is this how you show the autocomplete window?
11-07-2008 10:45 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