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 » Community » Newbie corner » Many Widget Factories one class
Many Widget Factories one class [message #38317] Sun, 09 December 2012 23:25
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Hi,

How can I define more than one widget factories in a single class.

I just wont to fill three ArrayCtrl's with buttons.
And I tried several times and could not figure it out.

This is what I have so far

	Tables::Tables()
	{	
		
		counter = 0;
		GetTablesCount = 0;
		
		tablesArray.AddColumn().Ctrls(THISBACK(WidgetFactory));
		tablesArray.AddColumn().Ctrls(THISBACK(WidgetFactory));
		tablesArray.AddColumn().Ctrls(THISBACK(WidgetFactory));
		tablesArray.AddColumn().Ctrls(THISBACK(WidgetFactory));
		
		
		
		ButtonGenerator(1);	
		tablesArray.SetLineCy(50);
	}
	
	void Tables::ButtonGenerator(int tableCount){
		
		for (int i = 1; i <= tableCount; ++i){
			tablesArray.Add();
		}
		
	}
	
	
	void Tables::WidgetFactory(One<Ctrl>& x)
	{
		Button& b = x.Create<Button>();
		b.SetLabel("Table " + AsString(++counter));	
		b.SizePos();	
		b <<= THISBACK1(OpenBill, counter);
	}
	



As I already mentioned I want to define other ArrayCtrl's and alsso fill them up. I tried with the same factory and did not succeed.

I Tried creating other factories it did not work either.


Thank you.

Best,
Georgi
Previous Topic: Connecting to PostgreSQL DB without reference file
Next Topic: Parameter Array reference.
Goto Forum:
  


Current Time: Mon May 06 08:28:06 CEST 2024

Total time taken to generate the page: 0.02015 seconds