Charles Yeomans wrote:
I think that identifying ContainerControls and EmbeddedWindowControls
only continues to confuse the issue. ContainerControls do not show up
in the control list of a window. The associated EmbeddedWindowControl
objects do.
That'd be tolerable if there were some way to get from the
EmbeddedWindowControl to the ContainerControl, or even if there were
some other pair of methods (analogous to ControlCount and Control) that
lets you iterate over container controls.
But as far as I can tell, there is not either of these. Container
controls show up in a window's "Contents" list in the debugger, but
there is no way for our code to get the same list.
This hit home for me just yesterday: I have a window subclass that can
do all sorts of automatic things with its contents, such as disabling
controls at appropriate times or telling certain kinds of contents to do
certain things at the appropriate times. It does this by iterating over
the Controls list and using IsA (with class or interface specifiers) as
needed to cast and notify each one.
But this strategy comes to a screeching halt as soon as any of those
items are a ContainerControl rather than a simple control. There is no
way for the window to discover these things among its contents. I have
to fall back on declaring some event, which the user must remember to
implement, for getting references to that stuff.
I guess it's feature-request time... and meanwhile, I guess I add an
event to return a list of container controls. But it's not pretty.
--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|