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
> 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
Gambit
"Clayton Arends" <clayto...@hotmail.com> wrote in message
news:3db388a7$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
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)
Any ideas?
--
Best Regards
Poul Christiansen
"Remy Lebeau (TeamB)" <gamb...@yahoo.com> wrote in message
news:3db45c4e$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
> I tested this out in BCB5 and it works as well.
Amazingly, this also works with BCB4.
- Clayton