Alex Hochberger
2007-09-26 20:44:01 UTC
I am creating a subclass of TabPanel, to use with pgSQL4RB.
Here is my process:
Drag the TabPanel in, put the controls in the single tab penel.
The TabPanel has a Dictionary with the controls in that panel. On the
Open Event, I populate the dictionary.
I have implemented the binding so from the DB Query, I create panels
for each relevant entry. I want to place a copy of each control from
the Dictionary on each panel, this is where I am stuck.
Since I need to create a new Subclass from the pgSQL4RB controls to
support an extra field from the database, I suppose I can handle all
the supported controls with IsA statements, but I was hoping to just
copy them, with references in my Dictionary of Dictionaries that I can
walk through.
Here is my populate code NOTE myControls is a Dictionary of all the
Controls. I've successfully populated it already, and nuked the
original Tab, so now the Controls only exist in the Dictionary.
for i = 0 to me.PanelCount - 1
PanelControls = new Dictionary
for j = 0 to UBound(me.myControls)
oldControl = myControls(j)
newControl = New oldControl
newControl.PanelIndex = i
PanelControls.Value(j) = newControl
next j
TabControls.Value(i) = PanelControls
next i
I get a compile-time error:
There is no class with this name.
newControl = new oldControl
and oldControl is highlighted.
If this approach fails, I am certain I can walk through them, and use
IsA to create new Instances of my Subclass, and pull the relevant
information from them, but that SEEMS less elegant.
Alex
Here is my process:
Drag the TabPanel in, put the controls in the single tab penel.
The TabPanel has a Dictionary with the controls in that panel. On the
Open Event, I populate the dictionary.
I have implemented the binding so from the DB Query, I create panels
for each relevant entry. I want to place a copy of each control from
the Dictionary on each panel, this is where I am stuck.
Since I need to create a new Subclass from the pgSQL4RB controls to
support an extra field from the database, I suppose I can handle all
the supported controls with IsA statements, but I was hoping to just
copy them, with references in my Dictionary of Dictionaries that I can
walk through.
Here is my populate code NOTE myControls is a Dictionary of all the
Controls. I've successfully populated it already, and nuked the
original Tab, so now the Controls only exist in the Dictionary.
for i = 0 to me.PanelCount - 1
PanelControls = new Dictionary
for j = 0 to UBound(me.myControls)
oldControl = myControls(j)
newControl = New oldControl
newControl.PanelIndex = i
PanelControls.Value(j) = newControl
next j
TabControls.Value(i) = PanelControls
next i
I get a compile-time error:
There is no class with this name.
newControl = new oldControl
and oldControl is highlighted.
If this approach fails, I am certain I can walk through them, and use
IsA to create new Instances of my Subclass, and pull the relevant
information from them, but that SEEMS less elegant.
Alex