
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9553 8e941d3f-bd1b-0410-a28a-d453659cc2b4
68 lines
1.6 KiB
ObjectPascal
68 lines
1.6 KiB
ObjectPascal
unit Unit1;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
|
|
mvMapViewer, mvPluginCore, mvPlugins;
|
|
|
|
type
|
|
|
|
{ TMainForm }
|
|
|
|
TMainForm = class(TForm)
|
|
Label1: TLabel;
|
|
lblMessageLabel: TLabel;
|
|
lblUserdefinedPluginMessage: TLabel;
|
|
MapView: TMapView;
|
|
PluginManager: TMvPluginManager;
|
|
InfoPanel: TPanel;
|
|
procedure FormCreate(Sender: TObject);
|
|
private
|
|
procedure UserdefinedPluginMouseUp(Sender: TObject; AMapView: TMapView; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer; var Handled: Boolean);
|
|
procedure UserdefinedPluginMouseDown(Sender: TObject; AMapView: TMapView; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer; var Handled: Boolean);
|
|
public
|
|
|
|
end;
|
|
|
|
var
|
|
MainForm: TMainForm;
|
|
|
|
implementation
|
|
|
|
{$R *.lfm}
|
|
|
|
{ TMainForm }
|
|
|
|
procedure TMainForm.FormCreate(Sender: TObject);
|
|
var
|
|
udp : TUserDefinedPlugin;
|
|
begin
|
|
MapView.Active := true;
|
|
|
|
udp := TUserdefinedPlugin.Create(PluginManager);
|
|
udp.OnMouseUp := @UserdefinedPluginMouseUp;
|
|
udp.OnMouseDown := @UserdefinedPluginMouseDown;
|
|
end;
|
|
|
|
procedure TMainForm.UserdefinedPluginMouseUp(Sender: TObject; AMapView: TMapView;
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer; var Handled: Boolean
|
|
);
|
|
begin
|
|
lblUserdefinedPluginMessage.Caption := Format('MouseUp X:%d Y:%d',[X,Y]);
|
|
end;
|
|
|
|
procedure TMainForm.UserdefinedPluginMouseDown(Sender: TObject; AMapView: TMapView;
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer; var Handled: Boolean
|
|
);
|
|
begin
|
|
lblUserdefinedPluginMessage.Caption := Format('MouseDown X:%d Y:%d',[X,Y]);
|
|
end;
|
|
|
|
end.
|
|
|