Hi Alex,
You can create different subclasses of TabPanel that will each build
the proper ContainerControl, or you can have only one subclass that
looks at the window it is on to then select the proper container
control.
For the latter, this would work like this:
If you have for example an aplication that keeps track of the cars
owned by people, and their maintenance records, you could have 3
windows: PeopleWindow, VehicleWindow, MaintenanceWindow.
Then, the Insert and Append methods of your pgTabPanel subclass could
call the method InstantiateAppropriateContainer:
Select Case Self
Case PeopleWindow
New PeopleContainer...
Case VehicleWindow
New VehicleContainer....
Case MaintenanceWindow
New MaintenanceContainer...
Else
Masgbox "Ooops!"
End Select
(I have not tried this code, maybe "Self" doesn't work exactly as I'm
expecting as I know in one of the recent RB releases some tinkering
was done to "Self" and "Me" but I think you get what I mean.)
Cheers,
Marc
PS: Even better: add a property to each window that tells which
container to use and then your (single subclass) pgTabPanel only has
to look up that property! This is in your train of thoughts. You
surely can have a property of type ContainerControl--or at least
Object--that will hold a container control. I haven't tried any of
this. ;-)
Post by Alex HochbergerOr if you have RB Pro just make a Container Control that you then can
instantiate in code for each TabPanel. That's by far the easiest in
my book.
Marc,
So I'm following your advice, the Contrainer Control is a bit
awkward to work with, but I think that it will work. The only thing
that I'm trying to figure out is how to specify the Container that I
create an instance of.
Assume: class pgTabPanel -- supports the bindings
Each time I use the pgTabPanel, I'm going to want to designate
different controls, I think. So on each Window that I'm using it I'll
new ContainerControl1 not new ContainerControl, and I can't just
specify the name in a properties field, can I? I was thinking of
creating a function in pgTabPanel called "getContainerInstance" that I
would then reimplement in each instance of the pgTabPanel, does that
make sense?
This is where I am lost, please advise.
Alex
_______________________________________________
Postgresql mailing list
http://aliacta.com/mailman/listinfo/postgresql_aliacta.com