unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Keyboard;
type
TBeepTouchKeyboard =
class(TTouchKeyboard)
published
Property OnClick;
property OnDblClick;
end;
TForm1 =
class(TForm)
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
BeepKeyboard: TBeepTouchKeyboard;
procedure OnTouchKeyDown(Sender: TObject);
procedure OnTouchKeyDblKlick(Sender: TObject);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FreeAndNil(BeepKeyboard);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
BeepKeyboard := TBeepTouchKeyboard.Create(self);
BeepKeyboard.Parent := self;
BeepKeyboard.OnClick := OnTouchKeyDown;
BeepKeyboard.OnDblClick := OnTouchKeyDblKlick;
BeepKeyboard.Top := 10;
BeepKeyboard.Left := 10;
BeepKeyboard.Width := 300;
BeepKeyboard.Height := 200;
end;
procedure TForm1.OnTouchKeyDown(Sender: TObject);
begin
Beep();
self.Caption := '
Einfacher Klick';
end;
procedure TForm1.OnTouchKeyDblKlick(Sender: TObject);
begin
Self.Caption := '
Doppelklick';
end;
end.