Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Adding an Icon to a control
Wed, Aug 9 2017 9:05 AMPermanent Link

Uli Becker

Hi,

I created a custom control derived from TControl with a base- and a
caption-element. It's called "TCaptionPanel" and just looks like a
BasicPanel with a centered caption.

Now I tried to add an icon to the control and had a look at the TButton
control to study how it's done.

When compiling the changes I get this error:

"[Error] CaptionPanel.wbs (136,13): Cannot create an instance of the
class TCaptionPanelIcon when it contains abstract methods"

procedure TCaptionPanel.InitializeProperties;
begin
   inherited InitializeProperties;
   FIcon := TCaptionPanelIcon.Create(Self);  <------------- Error here
   InterfaceState := NORMAL_STATE_NAME;
   FCaption := 'Caption';
end;

The complete code is attached.

What am I doing wrong?

Thanks Uli



Attachments: CaptionPanel.wbs TCaptionPanel.wbi
Thu, Aug 10 2017 1:16 AMPermanent Link

Michael Dreher

Uli Becker wrote:

 // When compiling the changes I get this error:
 //
 // "[Error] CaptionPanel.wbs (136,13): Cannot create an instance of the
 // class TCaptionPanelIcon when it contains abstract methods"

There's an abstract method

        function GetFontIconElement: TElement; virtual; abstract;

in TIconProperties you did not override.

M. Dreher
Thu, Aug 10 2017 4:26 AMPermanent Link

Uli Becker

Michael,

>           function GetFontIconElement: TElement; virtual; abstract;
>
> in TIconProperties you did not override.


Yes, I missed that. Thanks very much.

If someone is interested there are some more problems with the attached
code - once these are fixed, I'll post the component here again.

Uli
Thu, Aug 10 2017 2:36 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


I'm working with Uli on this, almost there...

Tim Young
Elevate Software
www.elevatesoft.com
Image