What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Combobox/editbox variables

Combobox/editbox variables
Author: Message:
ArkaneArkade
Full Member
***

Avatar
The One and Only

Posts: 193
Reputation: 5
38 / Male / Flag
Joined: Mar 2007
O.P. Combobox/editbox variables
Hey guys,

- Edit - complete change.  My original problem was solved - I was treating the ChatWnd.Contacts as a string, not iterator.  Solved it now.

I do have another thing, which I definitly need help with.  I'm hoping for perhaps a pointer to a script doing similar, or even to be old it cant be done.

Basically, I want to make a window which will have 2 controls on it - a combobox, and a editbox.  The combobox will be automatically populated with the email addresses of everyone in contact list, and I can do that part, but I want the editbox to be changeable, so that it will hold a custom string for each contact which will be shown, and can be changed as the combobox is changed. and then can be written to an xml file when save is clicked (again, I can handle the xml, it's purely the changing variables I need help with)

This post was edited on 01-09-2009 at 11:46 PM by ArkaneArkade.
[Image: adsig.jpg]
01-09-2009 09:19 PM
Profile E-Mail PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Combobox/editbox variables
Sure, that's definitly possible about changing the values. I'll write out some code after I get home in a bit.
I don't have any experience with using XML to store the data, but that shouldn't be too hard to do. I would recommend reading the data from the XML when the window opens and store it in an array relating to the email address of the contact. Store all the changes in memory until the window is destroyed to save disk operations.

Hopefully you have enumerated the ComboBox with an ItemData, otherwise you will have no way to link each value
JScript code:
/*some global vars */
var currentContact = 0;
var aContacts = Array[];
var aContactData = Array[];
 
 
function On[i]WindowId[/i]Event_ComboSelChanged (Wnd, ControlId) {
   newContact = Wnd.Combo_GetItemData(ControlId, Wnd.Combo_GetCurSel(ControlId));
   aContactData[curentContact] = Wnd.GetControlText([i]EditBoxControl[/i])
   Wnd.SetControlText([i]EditBoxControl[/i], aContactData[newContact]);
   currentContact = newContact;
}

when the window with the controls are created, the 2 arrays aContacts and aContactData should be populated with this: the key value of the arrays should just be integers, the exact valuses aren't really important. The values to fill in on aContacts should be the email addresses, and aContactData the values of the EditBox. once the window is destroyed (OK button or whatever) write out the values the user recorded back to the XML file using a for loop
JScript code:
for (var i =1; i<aContacts.Size; i++)
   // use aContacts[i] and aContactData[i] to write out the array data
   // make sure to remove the data from the array when the window is destroyed from any method: OK, Cancel, X in corner or otherwise


WDZ, fix GeSHi to allow BBCode :sad:

This post was edited on 01-10-2009 at 04:14 AM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
01-10-2009 02:15 AM
Profile PM Web Find Quote Report
ArkaneArkade
Full Member
***

Avatar
The One and Only

Posts: 193
Reputation: 5
38 / Male / Flag
Joined: Mar 2007
O.P. RE: Combobox/editbox variables
Thank you MeEtc.  I was a bit confused by your stuff, but you did manage to prompt me into an idea of my own... which I realised was exactly what you're talking about when I finished it.  All done and working now :D cheers man
[Image: adsig.jpg]
01-10-2009 07:46 AM
Profile E-Mail PM Web 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