Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New properties on TMDIChildForm

1 view
Skip to first unread message

Poul Christiansen

unread,
Oct 20, 2002, 5:43:14 PM10/20/02
to
I have Created a new Form Class similar to this:

class TMyForm : public TForm
{
__published: // IDE-managed Components
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private: // User declarations
public: // User declarations
__fastcall TMyForm(TComponent* Owner);
};


I would like to add new published properties to this form, but I can't seem
to make it work.

Can anybody point me in a direction, so I can create these new published
properties?

--
Best Regards

Poul Christiansen


Clayton Arends

unread,
Oct 21, 2002, 12:55:16 AM10/21/02
to
"Remy Lebeau (TeamB)" <gamb...@yahoo.com> wrote in message
news:3db35049$1...@newsgroups.borland.com...

> However, if you're wanting those properties to be displayed in the Object
> Inspector, that won't work for forms, unfortunately. You can't extend
> forms like that. At least, I've never seen it doable before.

I used to think the same away until I ran across this page:

http://www.gexperts.org/opentools/

Do a search for "published" on the page and you will find a technique that
seems to work for me. I've only tried it out once and you have to make sure
you do everything perfectly.

This is the order I did things in:

1. Open existing design-time package
2. Create new form. Add PACKAGE modifier to declaration
3. Add published properties
4. Add the following includes to the CPP of the file:

#include <DesignEditors.hpp>
#include <DesignIntf.hpp>

5. Add the following Register() function to the form CPP file:

namespace Formunitname // Put appropriate name here, of course
{
void __fastcall PACKAGE Register()
{
RegisterCustomModule(__classid(TTheForm), __classid(TCustomModule));
}
}

6. Add "designide.bpi" to the package "requires" list
7. Add the form to the repository

A very important point is you must "Inherit" from the form and not just use
it. So it would seem that this trick is limited but if the project is
configured "just right" it could be a beneficial trick.

- Clayton


Remy Lebeau (TeamB)

unread,
Oct 21, 2002, 1:29:48 AM10/21/02
to
Very interesting, thanks.


Gambit

"Clayton Arends" <clayto...@hotmail.com> wrote in message
news:3db388a7$1...@newsgroups.borland.com...

Remy Lebeau (TeamB)

unread,
Oct 21, 2002, 4:02:22 PM10/21/02
to

"Poul Christiansen" <p...@e-soft.dk> wrote in message
news:3db4545c$1...@newsgroups.borland.com...

> It says I have to Add DsgnIntf/DesignIntf to the uses clause of a unit.

That applies to Pascal, not C++. The C++ equivilent is to include the
header file for the unit, ie:

#include <DsgnIntf.hpp>
or
#include <DesignIntf.hpp>


Gambit


Jeff Overcash (TeamB)

unread,
Oct 21, 2002, 4:04:46 PM10/21/02
to

Poul Christiansen wrote:
>
> This seems like what I need, but I can't seem to make it work with my BCB5
> Pro.


>
> It says I have to Add DsgnIntf/DesignIntf to the uses clause of a unit.
>

> I have searched my disk - I only have a "dsgnintf.pas".
> How do I use this with BCB5?
>

DsgnIntf.hpp should be in your VCL directory.

--
Jeff Overcash (TeamB) On waves of silver I dreamed of gold
(Please do not email 'Till I lost the peace that dreaming gives
me directly unless I dreamed of the moment of my own death
asked. Thank You) That no one ever dreams and lives (Marillion)

Poul Christiansen

unread,
Oct 21, 2002, 4:38:47 PM10/21/02
to
When I attempt to compile my new package - I get an "Error in module
BaseForm: Incorrect field declaration in class TQBaseForm"

Any ideas?

--
Best Regards

Poul Christiansen


"Remy Lebeau (TeamB)" <gamb...@yahoo.com> wrote in message

news:3db45c4e$1...@newsgroups.borland.com...

Clayton Arends

unread,
Oct 21, 2002, 7:35:33 PM10/21/02
to
"Poul Christiansen" <p...@e-soft.dk> wrote in message
news:3db4545c$1...@newsgroups.borland.com...

> This seems like what I need, but I can't seem to make it work with my
> BCB5 Pro.

The instructions I gave applied to BCB6. I haven't tried it in BCB5 yet.
I'll play with that later tonight and post my results, unless someone else
does so first.

- Clayton


Clayton Arends

unread,
Oct 22, 2002, 2:35:49 PM10/22/02
to
"Clayton Arends" <clayto...@hotmail.com> wrote in message
news:3db597bd$1...@newsgroups.borland.com...

> I tested this out in BCB5 and it works as well.

Amazingly, this also works with BCB4.

- Clayton


0 new messages