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

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » why no 'Ctrl* Ctrl::Clone() const = 0' (virtual constructor)
why no 'Ctrl* Ctrl::Clone() const = 0' (virtual constructor) [message #28376] Tue, 31 August 2010 11:11 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi guys

why does Ctrl not have Clone method? this would make possible to generic clone a bunch of controls (with some additioanl helpers) without knowing their type (i.e. control factory that is cloned)

Ctrl* Ctrl::Clone() const = 0;

//i.e. EditValue
Ctrl* EditValue::Clone() const 
{
EditField * pc = new EditField();
pc->SetData(GetData());
pc->SetStyle(style);
pc->SetFont(font);
//etc those specific things
return pc;
}


this is a step towords a MVC like xml specifiable/parsable object inspector, which can be cloned itself..
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dockable toolbars
Next Topic: ColumnList RefreshCursor public
Goto Forum:
  


Current Time: Mon Sep 14 11:23:31 GMT+2 2026

Total time taken to generate the page: 0.00620 seconds