quarta-feira, 25 de novembro de 2009

Acessando uma propriedade, evento, função ou procedimento privado de um objeto ancestr

Type
TControlHack = class(TControl)
Public
Property OnMouseDown;
end;


procedure TDBXGrid.MouseDown(Button: TMouseButton;ShiftState:TShiftState; X,Y:Integer);
begin
if Assigned(TControlHack(Self).OnMouseDown) then
TControlHack(Self).OnMouseDown(Self, Button, FShiftState, X,Y);
end;

Type
TCustomGridHack = class(TCustomGrid)
Public
Property Options;
end;
procedure TDBXGrid.SetRowSizingAllowed(Value:Boolean);
begin
if Value<>FRowSizingAllowed Then
begin
FRowSizingAllowed:=Value;
if FRowSizingAllowed Then
TCustomGridHack(Self).Options:=TCustomGridHack(Self).Options+[goRowSizing]
else
TCustomGridHack(Self).Options:=TCustomGridHack(Self).Options-[goRowSizing];
end
end; // SetRowSizingAllowed

Nenhum comentário:

Postar um comentário