Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » operator<<= in tree control reference example
Re: operator<<= in tree control reference example [message #30518 is a reply to message #30498] Thu, 06 January 2011 11:53 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
cbpporter wrote on Wed, 05 January 2011 23:07

Well <<= is pretty standard for U++, and comes often in pair with ~, which does the opposite. For controls it is SetValue/GetValue. It is just one of the conventions you need to learn and what contributes to the learning curve of U++. It is the same with standard C++ and << for streams and other conventions.

The reason "=" is not used because it would be confusing. You use "=" between different types, but only if they are near identical/easily convertible. Like different representation of the same data. But an EditField is not a Value. It has a Value. This is why we use <<=, or the "kind of assign operator, but more of s take this value and use it" operator.



Actually I can't even see how that operator<<= works.
edit is declared like this
Array<EditString> edit;

and the code does
edit.Top() <<= n;
where n is a String. So the LHS is EditString&. The only operator<<= I can find is in the Ctrl base class
   const Value& operator<<=(const Value& v)   { SetData(v); return v; }


but the call to SetData (not SetValue?) is not virtual and just throws the data away - yet the code works ??? I must be missing something?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: recent MinMax Refresh fix not GCC compilable
Next Topic: New Select form in DocEdit or LineEdit
Goto Forum:
  


Current Time: Wed May 08 03:36:28 CEST 2024

Total time taken to generate the page: 0.01395 seconds