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 » 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: Sun Apr 28 16:38:56 CEST 2024

Total time taken to generate the page: 0.03117 seconds