U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » ColumnList - Set(Value key, Value val) - Working right?
Re: ColumnList - Set(Value key, Value val) - Working right? [message #29163 is a reply to message #29161] Fri, 08 October 2010 11:16 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
It's a very small bug. See the definition of the Set functions:
    void         Set(int ii, const Value& key, const Value& val, bool canselect = true);
    void         Set(int ii, const Value& key, const Value& val, const Display& display, bool canselect = true);
    void         Set(int ii, const Value& val, bool canselect = true);
    void         Set(int ii, const Value& val, const Display& display, bool canselect = true);

    void         Set(const Value& key, const Value& val, const Display& display, bool canselect);
    void         Set(const Value& key, const Value& val, bool canselect);

You are intending to call Set(Value, Value) but there is no candiate for that, the closest being Set(Value, Value, bool). As there is an implicit declared from Value to int the compiler is actually choosing Set(int, Value), which sets the value using an index.

The quick solution is to add the canselect parameter to your call:
Value id = codelist.GetData();
codelist.Set(id, "Hello World!", true);

but the function definition should also be changed to have a default value.
 
Read Message
Read Message
Read Message
Previous Topic: Window move virtual function
Next Topic: VC10 not recognized in autosetup
Goto Forum:
  


Current Time: Sat Sep 26 13:54:46 GMT+2 2026

Total time taken to generate the page: 0.02301 seconds