Kylix3
■ このスレッドは過去ログ倉庫に格納されています
0176174
NGNGprivate Fform:TForm;
FHook:QPaintEvent_hookH;
function NewEventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
public constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
constructor TLine.Create(AOwner: TComponent);
var Method: TMethod;
begin inherited;
Fform := AOwner as TForm;
FHook := QPaintEvent_hook_create(FForm.Handle);
TEventFilterMethod(Method) := NewEventFilter;
Qt_hook_hook_events(FHook, Method);
end;
function TLine.NewEventFilter(Sender: QObjectH; Event: QEventH): Boolean;
begin Result:=False; //もとのEventFilterを呼び出すならFalse
if Self=nil then exit;
case QEvent_type(Event) of
QEventType_Paint: with FForm do begin
Canvas.MoveTo(10,100); Canvas.LineTo(100,10); Result:=False;
end;
end;
end;
destructor TLine.Destroy; begin QPaintEvent_hook_destroy(FHook); inherited; end;
■ このスレッドは過去ログ倉庫に格納されています