unit Unit2;
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,
Common.Classes.KeyboardLayoutChanger;
type
TGünnisKeyboardButton =
class(
Vcl.Touch.Keyboard.TCustomKeyboardButton)
public
procedure Paint(Canvas: TCustomCanvas =
nil);
override;
end;
TForm2 =
class(TForm)
TouchKeyboard1: TTouchKeyboard;
TouchKeyboard2: TTouchKeyboard;
ComboBox1: TComboBox;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
private
FChanger: TKeyboardLayoutChanger;
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
FChanger := TKeyboardLayoutChanger.Create();
TouchKeyboard2.DefaultButtonClass := TGünnisKeyboardButton;
end;
procedure TForm2.FormDestroy(Sender: TObject);
begin
FChanger.Free;
end;
procedure TForm2.ComboBox1Change(Sender: TObject);
begin
FormatSettings := TFormatSettings.Create(ComboBox1.Text);
Label1.Caption :=
String.Format('
Der DecimalSepator ist "%s"', [FormatSettings.DecimalSeparator]);
FChanger.changeKeyboardLayout(ComboBox1.Text);
end;
procedure TGünnisKeyboardButton.Paint(Canvas: TCustomCanvas);
begin
if Self.Key.Vk = VK_DECIMAL
then
begin
Self.Caption := FormatSettings.DecimalSeparator;
end;
inherited Paint(Canvas);
end;
end.