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

Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GetProperty() / SetProperty() for Ctrl
Re: properties like in C# [message #31025 is a reply to message #31021] Tue, 01 February 2011 16:13 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

kohait00 wrote on Tue, 01 February 2011 14:45

now what's the benefit of it? imagine the Ctrls beeing able to be parametrized like

EditInt ei;

ei.min = 100;
ei.max = 200;
ei.data = 150;
ei.show = true;
ei.rect = Rect(0,0, 100,200);
...


while i know it's not much better than current design rule of daisychaining methods, it makes code even bit more clean


Hi kohait

Actually it is not better in any way... The underlaying code is more complex and the efficiency of chaining is better (both performance-wise and typing-wise). And the readability is IMHO exactly the same:
EditInt ei;

ei.SetMin(100)
  .SetMax(200)
  .SetData(150)
  .Show()
  .SetRect(Rect(0,0, 100,200));

Those are the basic reasons why all the previous proposals to add properties were vetted... You might find some more details by searching the forum.

Best regards,
Honza

PS: Plus having both properties and SetX()/GetX() functions leads to a unnecessary duplicity.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Drag and Drop between instances [FEATURE REQUEST]
Next Topic: PrinterJob prints blank pages in linux
Goto Forum:
  


Current Time: Tue Jul 14 13:42:26 GMT+2 2026

Total time taken to generate the page: 0.00819 seconds