Files
EMPolar-plgEMPDeleniTrubek/frmKeyb.pas

67 lines
1.2 KiB
ObjectPascal

unit frmKeyb;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Touch.Keyboard, Vcl.StdCtrls;
type
TformKeyb = class(TForm)
keyb1: TTouchKeyboard;
edtPopis: TEdit;
procedure FormShow (Sender: TObject);
procedure edtPopisKeyDown (Sender: TObject; var Key: Word; Shift: TShiftState);
private
public
text: string;
end;
var
formKeyb: TformKeyb;
kbdLayout: TTouchKeyboardLayout;
implementation
{$R *.dfm}
procedure TformKeyb.edtPopisKeyDown (Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (Key=VK_RETURN) then
begin
text:= Trim(edtPopis.Text);
Close;
end;
if (Key=VK_ESCAPE) then
begin
text:= '';
Close;
end;
end;
procedure TformKeyb.FormShow (Sender: TObject);
begin
kbdLayout:= TTouchKeyboardLayout.Create;
with TTouchKeyboardButton.Create do
begin
Text := 'A';
Caption := 'A';
SetBounds(10, 10, 50, 50);
ButtonType := TTouchKeyboardButtonType.kbChar;
kbdLayout.Buttons.Add(Self);
end;
keyb1.Keyboard:= kbdLayout;
edtPopis.Text:= '';
edtPopis.SetFocus;
end;
end.