Board index » delphi » ActiveX Issues! Please Help!

ActiveX Issues! Please Help!


2003-11-12 07:55:02 PM
delphi112
Hi,
I have some problems regarding conversion of VCL Component to Non-Visual
ActiveX Component.
ISSUE 1:
When I drop my Non-Visual ActiveX Component on the form, I see that the
object inspector is crowded with all kinds of unwanted properties which are
related to the TWinControl. Following are those properties:
Align, Anchors, Cursor, DragCursor, DragMode, Enabled, Font, HelpContext,
Height, HelpKeyword, HelpType, Hint, Left, ParentFont, ParentShowHint,
PopupMenu, ShowHint, TabOrder, TabStop, Tag, Top, Width.
I've seen another ActiveX control that does not have any of these
properties, except the Tag. How is this achieved? I Understand that some of
these properties like Font can be hidden by overriding the in TWinControl
wrapper and lowering its visibility. But this doesn't work for most of them.
It works for very few of the properties.
Does anyone know how to remove(or make invisible) all these unwanted
properties?
ISSUE 2:
How do I attach a property editor like stuff to a single property. I know
about Property Pages, which appear only when the user click on the "Property
Pages" icon. What I am interested in is something like what appears for
'TFont' property. In the Object Inspector, for a TFont property, there's a
small button, which when clicked, a different dialog pops up. How is this
done for ActiveX Components?
If I have a property like:
property SomeProperty: TSomeOtherClass read GetSomeProperty write
SetSomeProperty
when it is converted to ActiveX and the property is published, a combo-box
appears for that property, to which no values can be set. How can I prevent
this, and have a decent property dialog for this property? Can I attach that
to a particular property page to a property so that its popped up when
clicked?
ISSUE 3:
My Non-Visual ActiveX control, when dropped on the form is immovable. It is
also not clickable, and it is resizable. How can I override all this? I also
need to draw a bitmap onto it. How do I do this?
ISSUE 4:
Which is the most ideal class from which I can inherit my wrapper class?
TWinControl or TWidgetControl or TCustomControl.
Thanks in advance,
 
 

Re:ActiveX Issues! Please Help!

Hi Again,
for ISSUE 3, I meant TGraphicControl and not TWidgetControl
and I have one more ISSUE!
ISSUE 5:
I have a TMetafileCanvas property which should be exposed to the ActiveX
user, and I have no idea how to do this!!! Anybody has any ideas regarding
this?
Thanks Again.
"Sam" <XXXX@XXXXX.COM>writes
Quote
Hi,

I have some problems regarding conversion of VCL Component to Non-Visual
ActiveX Component.

ISSUE 1:
When I drop my Non-Visual ActiveX Component on the form, I see that the
object inspector is crowded with all kinds of unwanted properties which
are
related to the TWinControl. Following are those properties:
Align, Anchors, Cursor, DragCursor, DragMode, Enabled, Font, HelpContext,
Height, HelpKeyword, HelpType, Hint, Left, ParentFont, ParentShowHint,
PopupMenu, ShowHint, TabOrder, TabStop, Tag, Top, Width.

I've seen another ActiveX control that does not have any of these
properties, except the Tag. How is this achieved? I Understand that some
of
these properties like Font can be hidden by overriding the in TWinControl
wrapper and lowering its visibility. But this doesn't work for most of
them.
It works for very few of the properties.

Does anyone know how to remove(or make invisible) all these unwanted
properties?

ISSUE 2:
How do I attach a property editor like stuff to a single property. I know
about Property Pages, which appear only when the user click on the
"Property
Pages" icon. What I am interested in is something like what appears for
'TFont' property. In the Object Inspector, for a TFont property, there's a
small button, which when clicked, a different dialog pops up. How is this
done for ActiveX Components?

If I have a property like:
property SomeProperty: TSomeOtherClass read GetSomeProperty write
SetSomeProperty
when it is converted to ActiveX and the property is published, a combo-box
appears for that property, to which no values can be set. How can I
prevent
this, and have a decent property dialog for this property? Can I attach
that
to a particular property page to a property so that its popped up when
clicked?

ISSUE 3:
My Non-Visual ActiveX control, when dropped on the form is immovable. It
is
also not clickable, and it is resizable. How can I override all this? I
also
need to draw a bitmap onto it. How do I do this?

ISSUE 4:
Which is the most ideal class from which I can inherit my wrapper class?
TWinControl or TWidgetControl or TCustomControl.


Thanks in advance,

--
Sam


 

Re:ActiveX Issues! Please Help!

Hi,
Does anybody have any clue about any of these?
Thanks,
"Sam" <XXXX@XXXXX.COM>writes
Quote
Hi,

I have some problems regarding conversion of VCL Component to Non-Visual
ActiveX Component.

ISSUE 1:
When I drop my Non-Visual ActiveX Component on the form, I see that the
object inspector is crowded with all kinds of unwanted properties which
are
related to the TWinControl. Following are those properties:
Align, Anchors, Cursor, DragCursor, DragMode, Enabled, Font, HelpContext,
Height, HelpKeyword, HelpType, Hint, Left, ParentFont, ParentShowHint,
PopupMenu, ShowHint, TabOrder, TabStop, Tag, Top, Width.

I've seen another ActiveX control that does not have any of these
properties, except the Tag. How is this achieved? I Understand that some
of
these properties like Font can be hidden by overriding the in TWinControl
wrapper and lowering its visibility. But this doesn't work for most of
them.
It works for very few of the properties.

Does anyone know how to remove(or make invisible) all these unwanted
properties?

ISSUE 2:
How do I attach a property editor like stuff to a single property. I know
about Property Pages, which appear only when the user click on the
"Property
Pages" icon. What I am interested in is something like what appears for
'TFont' property. In the Object Inspector, for a TFont property, there's a
small button, which when clicked, a different dialog pops up. How is this
done for ActiveX Components?

If I have a property like:
property SomeProperty: TSomeOtherClass read GetSomeProperty write
SetSomeProperty
when it is converted to ActiveX and the property is published, a combo-box
appears for that property, to which no values can be set. How can I
prevent
this, and have a decent property dialog for this property? Can I attach
that
to a particular property page to a property so that its popped up when
clicked?

ISSUE 3:
My Non-Visual ActiveX control, when dropped on the form is immovable. It
is
also not clickable, and it is resizable. How can I override all this? I
also
need to draw a bitmap onto it. How do I do this?

ISSUE 4:
Which is the most ideal class from which I can inherit my wrapper class?
TWinControl or TWidgetControl or TCustomControl.


Thanks in advance,

--
Sam


 

Re:ActiveX Issues! Please Help!

Quote
Hi,
Greetings.
Quote
ISSUE 1:
When I drop my Non-Visual ActiveX Component on the form, I see that the
object inspector is crowded with all kinds of unwanted properties which are
related to the TWinControl. Following are those properties:
Align, Anchors, Cursor, DragCursor, DragMode, Enabled, Font, HelpContext,
Height, HelpKeyword, HelpType, Hint, Left, ParentFont, ParentShowHint,
PopupMenu, ShowHint, TabOrder, TabStop, Tag, Top, Width.

I've seen another ActiveX control that does not have any of these
properties, except the Tag. How is this achieved?
Remove the properties from the type-library.
Quote
ISSUE 3:
My Non-Visual ActiveX control, when dropped on the form is immovable. It is
also not clickable, and it is resizable. How can I override all this?
What is a "non-visual" ActiveX control?
Quote
I also need to draw a bitmap onto it. How do I do this?
Override the "Paint" method of your control.
Quote
ISSUE 4:
Which is the most ideal class from which I can inherit my wrapper class?
TWinControl or TWidgetControl or TCustomControl.
TGraphicControl
You must use a control that creates a window handle. TGraphicControl
does not so it cannot be used. TCustomControl will probably work but it
isn't available from the Wizard.
Quote
ISSUE 5:
I have a TMetafileCanvas property which should be exposed to the
ActiveX user, and I have no idea how to do this!!! Anybody has
any ideas regarding this?
That depends on how it will be used.
- Brian
 

Re:ActiveX Issues! Please Help!

Hi Brian,
Thanks for the reply.
Quote
>I've seen another ActiveX control that does not have any of these
>properties, except the Tag. How is this achieved?

Remove the properties from the type-library.
These properties does not appear in the type library. They are added in some
other way. I was able to remove some of these properties by setting the
OLEMISC_INVISIBLEATRUNTIME flag. But there are still other properties like
HelpString, HelpContext, Hint, Left, Anchors, etc visible.
Quote
What is a "non-visual" ActiveX control?
A Non-Visual ActiveX Control is one which does not appear or is seen during
runtime. It'll only be seen at design time.
Quote
Override the "Paint" method of your control.
I have been able to successfully resolve this issue.
Thanks.
"Brian Cook" <bcook@rowdydogsoftware[REMOVE].com>writes
Quote
>Hi,

Greetings.


>ISSUE 1:
>When I drop my Non-Visual ActiveX Component on the form, I see that the
>object inspector is crowded with all kinds of unwanted properties which
are
>related to the TWinControl. Following are those properties:
>Align, Anchors, Cursor, DragCursor, DragMode, Enabled, Font,
HelpContext,
>Height, HelpKeyword, HelpType, Hint, Left, ParentFont, ParentShowHint,
>PopupMenu, ShowHint, TabOrder, TabStop, Tag, Top, Width.
>
>I've seen another ActiveX control that does not have any of these
>properties, except the Tag. How is this achieved?

Remove the properties from the type-library.


>ISSUE 3:
>My Non-Visual ActiveX control, when dropped on the form is immovable. It
is
>also not clickable, and it is resizable. How can I override all this?

What is a "non-visual" ActiveX control?

>I also need to draw a bitmap onto it. How do I do this?

Override the "Paint" method of your control.


>ISSUE 4:
>Which is the most ideal class from which I can inherit my wrapper class?
>TWinControl or TWidgetControl or TCustomControl.
>TGraphicControl

You must use a control that creates a window handle. TGraphicControl
does not so it cannot be used. TCustomControl will probably work but it
isn't available from the Wizard.


>ISSUE 5:
>I have a TMetafileCanvas property which should be exposed to the
>ActiveX user, and I have no idea how to do this!!! Anybody has
>any ideas regarding this?

That depends on how it will be used.


- Brian