AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Best Practices für IOS +Android APP

Ein Thema von QuickAndDirty · begonnen am 5. Mai 2015 · letzter Beitrag vom 13. Mai 2015
 
Benutzerbild von Mavarik
Mavarik

Registriert seit: 9. Feb 2006
Ort: Stolberg (Rhld)
4.154 Beiträge
 
Delphi 10.3 Rio
 
#8

AW: Best Practices für IOS +Android APP

  Alt 7. Mai 2015, 16:41
Also

Mein letzter Stand für die Keyboard Geschichte ist:
Delphi-Quellcode:
Procedure TMainForm.CalcContentBoundsProc(Sender: TObject;var ContentBounds: TRectF);
begin
   if KeyBoardVerdecktFeld and (KeyBoardPositionY > 0) then
     ContentBounds.Bottom := Max(ContentBounds.Bottom,2 * ClientHeight - KeyBoardPositionY);
end;

...
  MainVertScrollBox.OnCalcContentBounds := CalcContentBoundsProc;
...

procedure TMainForm.FormVirtualKeyboardHidden(Sender: TObject; KeyboardVisible: Boolean; const Bounds: TRect);
begin
  KeyBoardPositionY:=0;
  KeyBoardVerdecktFeld := False;
  KeyBoardRestorePosition;
end;


procedure TMainForm.FormVirtualKeyboardShown(Sender: TObject; KeyboardVisible: Boolean; const Bounds: TRect);
 var
   LFocused : TControl;
   LFocusRect: TRectF;
begin
  KeyBoardOnScreen := true;
  KeyBoardPositionY := Self.ClientHeight - Bounds.Height;
   KeyBoardVerdecktFeld := False;
   if Assigned(Focused) then
   begin
     LFocused := TControl(Focused.GetObject);
     LFocusRect := LFocused.AbsoluteRect;
     LFocusRect.Offset(MainVertScrollBox.ViewportPosition);
     if (KeyBoardPositionY<>0) and (LFocusRect.Bottom>KeyBoardPositionY) then begin;
       KeyBoardVerdecktFeld := True;
       MainVertScrollBox.RealignContent;
       Application.ProcessMessages;
       MainVertScrollBox.ViewportPosition :=
         PointF(MainVertScrollBox.ViewportPosition.X,
                LFocusRect.Bottom - KeyBoardPositionY);
     end;
   end;
   if not KeyBoardVerdecktFeld then
     KeyBoardRestorePosition;
end;
Meine Version der FMX.Platform.Win (bin mir nicht sicher, ob das schon alles funktioniert)

Delphi-Quellcode:
constructor TVirtualKeyboardWin.Create;
var
  L: integer;
  S: string;
  HID: HKey;
  DVersion: DWORD;
  Major, Minor: byte;
begin
  S := '';
  inherited Create;
  SetLength(S, MAX_PATH);
  L := GetSystemDirectory(PChar(S), MAX_PATH);
  SetLength(S, L);
  FPath := S;
  FExeName := 'osk.exe';
  FWndClassName := 'OSKMainClass';

  FKBPresent := True;
  DVersion := Winapi.Windows.GetVersion;
  Major := Lo(LoWord(DVersion));
  Minor := Hi(LoWord(DVersion));
  FVersion := Major;
  FVersion := FVersion * 100 + Minor * 10;
  if DVersion < 620 then
  begin
    if Winapi.Windows.RegOpenKeyEx(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Enum', 0, KEY_READ,
      HID) = ERROR_SUCCESS then
      try
        S := FindKeyValue(HID, 'ClassGUID', '{4D36E96B-E325-11CE-BFC1-08002BE10318}', 'Control',
          'ActiveService');
        FKBPresent := S <> '';
      finally
        RegCloseKey(HID);
      end;
  end
  else
  begin
    if Winapi.Windows.RegOpenKeyEx(HKEY_LOCAL_MACHINE, 'SOFTWARE\Classes\', 0, KEY_READ,HID) = ERROR_SUCCESS then
      try
        S := FindKeyValue(HID, 'CLSID', '{054AAE20-4BEA-4347-8A35-64A533254A9D}', 'LocalServer32','');
        FPath := S;
        FExeName := 'TipTap.exe'; // Das ist die "Richtige"
        FWndClassName := 'IPTip_Main_Window';
        FKBPresent := S <> '';
      finally
        RegCloseKey(HID);
      end;

    //Windows.Devices.Input.KeyboardCapabilities.KeyboardPresent
  end;
  FNewvkbState := vkbState;
  StartTimerLang;
end;
Mavarik
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:20 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz