Board index » delphi » Streaming components

Streaming components

I am, at run time, allowing the user to create a custom form to be used by
others to edit data.  I am streaming a custom panel from a design form after
components are selected by dragging and dropping fields from a treeview on
the same form.  When the field is dropped, the application creates the
appropriate control, applies a static text label to go with the control, and
places it at the cursor coordinates on the custom panel.  The custom panel
sits on a scroll panel and has constraints of MaxWidth and MaxHeight.  As
each controls is placed on the custom panel, I am setting the control's
parent to the custom panel.  Breaking in the code and checking this for the
created control confirms this to be correct.

When I, at run time, open a new form (the one on which the user will
actually edit data ) and create a custom panel on it, I read in the stream
and the panel and all of its components come in.  The new form doesn't have
the editing toolbars or treeview that the design form did, so I need to
expand the custom panel to client align on the new form.  When I align the
new panel to client in the new form, all of the controls are more to the
right and lower than where they appeared on the original custom panel.  The
controls are all created with anchors of Left and Top, so I assumed I would
see them aligned to the left and top of the resized custom panel.   Waht am
I missing?

TIA!
Tom.

 

Re:Streaming components


I found that the CustomPanel on the original form was having Left and Top
set to negative numbers when it had its parent set to the ScrollBox.
Testing for and resetting to 0,0 fixed the problem.  Had never run into this
behavior before.  Why would creating a CustomPanel with self as the owner
and susequently setting the Parent property to the ScrollBox cause negative
values for Left and Top?

Thanks!
Tom.

Re:Streaming components


Hi Peter,
Thanks for the tip. The error message is now gone. But still none of the
components I have streamed in the file "formflds.fld" has been restored on
the form. I still miss something. Would you mind, please, tell me what it is
that I am missing? TIA

Emmanuel

Quote
"Tom Alexander" <tom...@theriver.com> wrote in message

news:3b575331_1@dnews...
Quote
> I found that the CustomPanel on the original form was having Left and Top
> set to negative numbers when it had its parent set to the ScrollBox.
> Testing for and resetting to 0,0 fixed the problem.  Had never run into
this
> behavior before.  Why would creating a CustomPanel with self as the owner
> and susequently setting the Parent property to the ScrollBox cause
negative
> values for Left and Top?

> Thanks!
> Tom.

Other Threads