开发者

How do I avoid an "abstract error" with a TCustomGrid descendant?

开发者 https://www.devze.com 2023-01-08 22:36 出处:网络
Whats the minimum I have to do to descend a new control from TCustomGrid, and get it on a form in the IDE without getting \'Abstract Error\' within the IDE?

Whats the minimum I have to do to descend a new control from TCustomGrid, and get it on a form in the IDE without getting 'Abstract Error' within the IDE?

I have开发者_运维技巧 tried everything for days, but Im a bit of a delphi noob atm, zero percent success with TCustomGrid :(

If someone could help me out just getting a basic descendant of TCustomGrid which does nothing but implement the base TCustomGrid behavious it would be much a appreciated. Thanks.

Edit - I know how to do the basics of creating controls, I just cant do it with TCustomGrid


"Abstract Error" usually means that there are virtual abstract functions you'll have to implement to make the class work. For TCustomGrid, this should be the DrawCell method, as you can see here.

For a complete detailed example on how to build an own grid based on TCustomGrid, see this tutorial.


You only get abstract errors if you neglect to override and provide an implementation for a method that was declared virtual abstract in either TCustomGrid or any of its ancestors.

So the solution would be to find all of these (use ctrl-click on the class names to get from ancestor to ancestor) and provide an override. Start with an empty implementation of your overrides. That may cause other errors and broken/unexpected behaviour, but should get you past the abstract errors.

0

精彩评论

暂无评论...
验证码 换一张
取 消