unit AdvMainMenu;
interface
uses
Windows, Menus, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TAdvMainMenu =
class(TMainMenu)
private
{ Private-Deklarationen }
FOnLMBClicked: TNotifyEvent;
FOnRMBClicked: TNotifyEvent;
procedure LeftMouseButtonDown(
var Msg : TMouseInput);
message WM_LBUTTONDOWN;
procedure RightMouseButtonDown(
var Msg : TMouseInput);
message WM_RBUTTONDOWN;
protected
{ Protected-Deklarationen }
procedure DoLeftMouseButtonDown(
var Msg : TMouseInput);
dynamic;
procedure DoRightMouseButtonDown(
var Msg : TMouseInput);
dynamic;
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
published
{ Published-Deklarationen }
property OnLMBClick: TNotifyEvent
read FOnLMBClicked
write FOnLMBClick;
property OnRMBClick: TNotifyEvent
read FOnRMBClicked
write FOnRMBClick;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Standard', [TAdvMainMenu]);
end;
constructor TAdvMainMenu.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
destructor TAdvMainMenu.Destroy;
begin
inherited Destroy;
end;
procedure TAdvMainMenu.DoLeftMouseButtonDown(
var Msg: TMouseInput);
begin
If Assigned(FOnLMBClicked)
then
FOnLMBClicked(Self);
end;
procedure TAdvMainMenu.DoRightMouseButtonDown(
var Msg: TMouseInput);
begin
If Assigned(FOnRMBClicked)
then
FOnRMBClicked(Self);
end;
procedure TAdvMainMenu.LeftMouseButtonDown(
var Msg: TMouseInput);
begin
DoLeftMouseButtonDown(Msg);
end;
procedure TAdvMainMenu.RightMouseButtonDown(
var Msg: TMouseInput);
begin
DoRightMouseButtonDown(Msg);
end;
end.