Home » Community » Newbie corner » Many Widget Factories one class
Many Widget Factories one class [message #38317] |
Sun, 09 December 2012 23:25 |
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
|
|
|
Goto Forum:
Current Time: Tue Apr 29 01:51:07 CEST 2025
Total time taken to generate the page: 0.00665 seconds
|