Hallo da bin ich wieder,
geht leider immer noch nicht, ist da noch was faul? Es tut sich immer noch nix...
Delphi-Quellcode:
type
TMausAnzeige = procedure(Sender: TObject; Shift: TShiftState; X, Y: Integer) of Object;
TZeichenBlatt = class(TImage)
private
... protected
fOnMouseWheel: TMouseWheelEvent;
procedure MausDrehen(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
...
public
constructor Create(aOwner: TComponent); override;
...
published
property OnMouseWheel: TMouseWheelEvent Read fOnMouseWheel Write fOnMouseWheel;
...
end;
...
procedure TZeichenblatt.MausDrehen(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
if assigned(OnMouseWheel) then
fOnMouseWheel(Sender, Shift, WheelDelta, MousePos, Handled);
if WheelDelta > 0 then ShowMessage('ää');
Canvas.TextOut(10,10,'hjhjhhjhgjkghk');
end;
...
constructor TZeichenBlatt.Create(aOwner: TComponent);
begin
inherited create(aOwner);
...
inherited OnMouseWheel := Mausdrehen;
end;