K
K
KTG2017-01-24 05:01:35
Delphi
KTG, 2017-01-24 05:01:35

How to make a predefined event handler in Delphi?

The DBgrid (TDBGridEh) has a column (TColumnEh) that has an OnDataHintShow event.
There is a created class TDynamicGrid = class(TDBGridEh), it describes the ShowPanel procedure.
How to make it so that by default, the ShowPanel procedure is called for the desired column on the OnDataHintShow event?
Those. it was not necessary to prescribe it every time, but it worked for all Grids of this class.

constructor TDynamicGrid.Create(AOwner: TComponent);
  var q: TDBgridEhDataHintShowEvent;
begin
  inherited;
  // FieldPanel - параметр который содержит имя колонки, для которой предопределяем событие.
   self.FieldColumns[self.FieldPanel].OnDataHintShow := ..............................
end;

If I write like this:
self.FieldColumns[self.FieldPanel].OnDataHintShow := self.ShowPanel()

It gives an error: Incompatible types: 'TDBGridEhDataHintShowEvent' and 'procedure, untyped pointer or untyped parameter'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question