So, just switched to RAD XE3 to use Metropolis UI feature, and therefore started to completely rearrange and redesign my app to make it a little nicer, only this time I've chosen FireMonkey Metropolis App, since it has some good components, such as TSwitch (slide switch).
Everything seems to work fine (with modifications and spending lot of time...), but can't find a way to call Switch procedure via VK buttons.
The VK procedure is able to show toolbar, and to show message with ShowMessage('Hello'); as well, but I can't call switch procedure.
The TSwitch has the OnSwitch event (It's a replacement for an OnChange event), so the call is:
procedure THome.Switch1Switch(Sender: TObject); begin if Switch1.IsChecked=True then LabelStatus:=On else LabelStatus:=Off; end;
The VK procedure is placed on form's OnKeyDown event:
procedure THome.FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin // if Key = VKNumpad1 then if KeyChar = '1' then Self.Switch1Switch(Sender);
I have tried several options to call it, but seems like the VK works fine (ShowMessage is shown, if present).
Any ideas why this doesn't work and how would it work? Since I successfuly call the FormCreate procedure with
And Merry Christmas! :)
Edited 4 Years Ago by cucolino: Wishes for christmas :)