Board index » cppbuilder » Why can't I 'copy' forms in a project

Why can't I 'copy' forms in a project

After selecting 'File|New...' I get a tabbed dialog of things I might
want to create.  On some of these tabs are pre-built dialogs that I can
either Copy, Inherit from or Use directly.  There is also a page for the
current project.  This page disables all options but 'Inherit'.  Why?

I understand that most frequently I should create a common base class,
rather than duplicate funtionality.  However, to insist this is the only
way of doing things risks introducing accidental inheritance, where the
class structure is based on what was convenient with the data at the
time, rather than how the data is percieved to be structured.

I am currently working on a database app, and I frequently many controls
hooked up to a datasource.  If I am editting similar tables, I will have
a similar form.  In such circumstances it would be far easier to create
a copy than start anew.  However, this is what borland seem to insist I
do by conciously crippling one of their dialogs.  Can someone explain?

AlisdairM

 

Re:Why can't I 'copy' forms in a project


Quote
AlisdairM wrote:

> After selecting 'File|New...' I get a tabbed dialog of things I might
> want to create.  On some of these tabs are pre-built dialogs that I can
> either Copy, Inherit from or Use directly.  There is also a page for the
> current project.  This page disables all options but 'Inherit'.  Why?

To copy it you would have the same class name in your project which isn't
allowed.

Quote
> I understand that most frequently I should create a common base class,
> rather than duplicate funtionality.  However, to insist this is the only
> way of doing things risks introducing accidental inheritance, where the
> class structure is based on what was convenient with the data at the
> time, rather than how the data is percieved to be structured.

Then add the form to the Object Repository itself and you should be able to copy
it then I think (haven't tried).

Quote
> I am currently working on a database app, and I frequently many controls
> hooked up to a datasource.  If I am editting similar tables, I will have
> a similar form.  In such circumstances it would be far easier to create
> a copy than start anew.  However, this is what borland seem to insist I
> do by conciously crippling one of their dialogs.  Can someone explain?

> AlisdairM

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
Maybe it was infatuation or the thrill of the chase.
Maybe you were always beyond my reach and my heart was playing safe.
But was that love in your eye I saw or the reflection of mine?
Give me time, won't you give me that time!
Welcome back to the circus.            (Fish)

Re:Why can't I 'copy' forms in a project


Quote
"Jeff Overcash (TeamB)" wrote:
> To copy it you would have the same class name in your project which isn't
> allowed.

OK, I obviously mis-understood this option.
I had presumed I would get a TFormXX with all the same
components/events/etc.
Maybe I should submit a feature request <sheepish grin>

AlisdairM

Re:Why can't I 'copy' forms in a project


Hi, there AlisdaiM,

I always rename the Form or DataModule, use "Save As..." and add the
previous Form or DataModule.

This works...

Erwin

AlisdairM <"alisdair.meredith"@NO_SPAM_PLE...@benettonformula.com> schreef
in berichtnieuws 38f333fb@dnews...

Quote
> After selecting 'File|New...' I get a tabbed dialog of things I might
> want to create.  On some of these tabs are pre-built dialogs that I can
> either Copy, Inherit from or Use directly.  There is also a page for the
> current project.  This page disables all options but 'Inherit'.  Why?

> I understand that most frequently I should create a common base class,
> rather than duplicate funtionality.  However, to insist this is the only
> way of doing things risks introducing accidental inheritance, where the
> class structure is based on what was convenient with the data at the
> time, rather than how the data is percieved to be structured.

> I am currently working on a database app, and I frequently many controls
> hooked up to a datasource.  If I am editting similar tables, I will have
> a similar form.  In such circumstances it would be far easier to create
> a copy than start anew.  However, this is what borland seem to insist I
> do by conciously crippling one of their dialogs.  Can someone explain?

> AlisdairM

Re:Why can't I 'copy' forms in a project


Quote
Keuning wrote:
> I always rename the Form or DataModule, use "Save As..." and add the
> previous Form or DataModule.
> This works...

I also do this, but first you must remember to rename the form, then I
find that BCB is usually trying to save it in some dumb folder
completely unrelated to my project.  Then there is the temptation to do
the work and then save.  Oops, messed up the original too...

OK, these are only minor irritations, but they all add up real quick!

I guess it's a sign of the quality of the product when it's these minor
things I'm complaining about rather than the code!

AlisdairM

Other Threads