Einzelnen Beitrag anzeigen

Benutzerbild von erich.wanker
erich.wanker

Registriert seit: 31. Jan 2008
Ort: im schönen Salzburger Land
454 Beiträge
 
Delphi XE4 Professional
 
#4

AW: Android BackButton..

  Alt 27. Jul 2017, 13:06
Hallo Leute
vielen Dank .. funktioniert jetzt einwandfrei ...


Delphi-Quellcode:
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
  Shift: TShiftState);
var
  FService : IFMXVirtualKeyboardService;
begin
  if (Key = vkHardwareBack) or (Key = vkHome) then begin
    TPlatformServices.Current.SupportsPlatformService(IFMXVirtualKeyboardService, IInterface(FService));
    if (FService <> nil) and (TVirtualKeyboardState.Visible in FService.VirtualKeyBoardState) then
    begin
         // Tastatur ist eingeblendet .. also nix tun
    end
    else
    begin
      Key := 0;
      if (maincontrol.ActiveTab <> menu) AND (maincontrol.ActiveTab <> menu2) AND (maincontrol.ActiveTab <> login) AND (maincontrol.ActiveTab <> login2) then
      begin
            if ausrichtung='hochthen maincontrol.ActiveTab:=menu;
            if ausrichtung='querthen maincontrol.ActiveTab:=menu2;
      end
      else
      begin

            if (maincontrol.ActiveTab = menu) OR (maincontrol.ActiveTab = menu2) then
            begin
                  if ausrichtung='hochthen maincontrol.ActiveTab:=login;
                  if ausrichtung='querthen maincontrol.ActiveTab:=login2;
            end
            else
            begin
                   MessageDlg('Programm beenden?', TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbOK, TMsgDlgBtn.mbCancel], -1, OnCloseDialog);
            end;
      end;


    end;
    Exit;
  end;

  if Key = sgiUpRightLong then begin // Menu button pressed ?
    if ausrichtung='hochthen maincontrol.ActiveTab:=menu;
    if ausrichtung='querthen maincontrol.ActiveTab:=menu2;
  end;

end;



procedure TForm1.OnCloseDialog(Sender: TObject; const AResult: TModalResult);
begin
  if AResult = mrOK then begin
    Close;
  end;
end;
Erich Wanker - for life:=1971 to lebensende do begin ..
O
/H\
/ \
  Mit Zitat antworten Zitat