On Aug 29, 2006, at 2:36 AM, Chuck Pelto wrote:
Greetings All,
Managed to get the static text (ST) addressing sorted out. A faux
pas on my part.
Got an interesting thing going on now with the embedding.
As mentioned earlier, the ST is embedded in a rectangle control
(RC), which is a modified version of a regular rectangle control,
i.e., a sub-class of Rectangle Control.
Maybe I'm going about the embedding wrong. I've set the ST up as a
property of the RC.
I've got three such RCs appearing in a window.
During the OPEN process each RC has the ST associated with it is
declared and properties thereof set, including the text that is to
be displayed.
However, when I look at the window, only the first of the three RCs
is showing an ST and THAT ST has the text of the last of the three
RCs in it.
So, if I'm fouled up in my understanding of how to embed an ST
object in another control object, e.g., an RC, where can I find
information on how to do that properly?
The term 'embedding' is not appropriate. Based on your posts, you
either want the rectangle to be the parent of the statictext or you
want the rectangle subclass to have a statictext control in the sense
of composition or perhaps both.
If you want a rectangle control to be the parent of a statictext
control: In this relationship, both controls belong to the window. To
achieve the parent-child relationship, drag your rectangle control
onto the window, then drag the static text control within the
rectangle control. When properly done, when you select the statictext
the border of the rectangle will highlight in red. This means that
the rectangle is the container, ie., the parent of the statictext.
This relationship sets certain links between the controls as
described in the User's Guide relating to disabling and movement.
On the other hand, the approach that you describe suggests something
else. You may want a composition structure in which the rectangle
subclass "has a" statictext control as a property. In this case, give
your rectangle subclass a property, say MyStaticText as statictext.
You can now write code in the subclass which references MyStaticText.
To make it work, drag your subclass onto a window and drag a
StaticText1 onto the window. In the open event of the rectangle
control put:
If StaticText1 <> nil then
MyStaticText = self.StaticText1
End
Best,
Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>