FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

selectedValue("value") for comboBox and listBox

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Sun Jan 28, 2007 11:36 pm    Post subject: selectedValue("value") for comboBox and listBox Reply with quote

I have been trying to set the display position or value for both the comboBox and listBox and it does not work. The only thing I have gotten to work is selectedIndex(index). Is it maybe because it needs to have a null value to end the string?

Will you tell me if it is working as it should, and if so, how do I use the selectedValue() property setters and getters?j

Right now, what I am doing is using two arrays: int[char[]] and char[][] to be able to get this to work. Any help would be greatly appreciated.

This is how I initialize it:
Code:


    PclassStr =
      [
        " ",
        "PM",
        "Translation",
        "DTP",
        "ContextProof",
        "Quote",
        "Interpretation",
        "VoiceOver",
        "TradosProc"
      ];

    foreach (char[] str; PclassStr)
      ProjClass.items.add(str);

    PclassInt[""] = 0;
    PclassInt[null] = 0;
    PclassInt[PclassStr[0]] = 0;
    PclassInt[PclassStr[1]] = 1;
    PclassInt[PclassStr[2]] = 2;
    PclassInt[PclassStr[3]] = 3;
    PclassInt[PclassStr[4]] = 4;
    PclassInt[PclassStr[5]] = 5;
    PclassInt[PclassStr[6]] = 6;
    PclassInt[PclassStr[7]] = 7;
    PclassInt[PclassStr[8]] = 8;


Thanks.

josé
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Mon Jan 29, 2007 5:17 pm    Post subject: Reply with quote

Items are actually stored as Object, adding char[] is only a convenience. To get the char[] back after adding, just call toString() on the item.
mylistbox.items[i].toString()
I understand how this can be confusing. I should be writing up some better documentation and/or tutorials soon.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group