Jump to content

vfbb

Members
  • Content Count

    266
  • Joined

  • Last visited

  • Days Won

    30

Posts posted by vfbb


  1. 1 hour ago, vfbb said:

    The TWebBrowser.Create is crashing in the iOS. To test just add a TWebBrowser to the form and compile. 

    The exception is raising in the FMX.WebBrowser.Delegate.iOS.pas in TNativeWebViewHelper.CreateAndInitWebView. Did anyone get a workaround?

     

    I found the workaround! Add the WebKit framework to your iOS SDK and update the local file cache. After, in the unit source\rtl\ios\iOSapi.WebKit.pas in the line:

    var
      WebKitModule: THandle;
    {$ENDIF}

    Change to

    var
      WebKitModule: THandle;
    {$ELSE}
      {$IF NOT DECLARED(_PU)}
      const
        {$IFDEF UNDERSCOREIMPORTNAME}
        _PU = '_';
        {$ELSE}
        _PU = '';
        {$ENDIF}
        {$EXTERNALSYM _PU}
      {$ENDIF}
    
      procedure EmbedFramework; cdecl; external libWebKit name _PU + 'OBJC_CLASS$_WKWebView';
    {$ENDIF}

     

    • Like 1

  2. 4 minutes ago, MikeMon said:

    Hi @vfbb. Option 4 yes. Option 3 isn't working. The default Delphi launch screen images are added no matter what.

    No, it is correct. The name in that file is not the name your image in your computer, but the name of the image in the remote device.

    As I told you, just delete your app, restart your phone, open a blank project, change it by options and compile and you will see that is working.


  3. 14 minutes ago, MikeMon said:

    3.) I edited the LaunchScreen.storyboard and Assets files in LaunchScreen.TemplateiOS (actually only the Contents.json file in the Assets\LaunchScreenImage.imageset folder) as needed by replacing the default FM launch icons with mine.

    4.) Made sure that my launch screen images to be deployed are in the "Project | Deployment".

     

    The options of the delphi 10.4 is working perfectly for this, you don't have to add it manually to the deploy project and you don't need to change the storyboard files either. You can test with a new project.


  4. I found the problem and this is not a delphi bug. The problem is with the iOS cache, the app don't update new launchscreen / icon, even you uninstall and install your app. The solution is:

     

    1) Uninstall the app

    2) Power down the device

    3) Power up the device

    4) Install the app

    • Like 1

  5. Just a information: The ZXing is a crossplatform solution, and is simple to implement, but is not the best choose. In Android I prefer the GoogleVision and in iOS I prefer use the apis of the AVFoundation, you will even avoid using TCamera, because it is very slow, very.

    • Like 2

  6. I don't know if this is happening only to me, but it is already the second computer that I install Delphi 10.4 and the same problem occurs. I retry with the patch1 and again the problem occur:

     

    Compilations of a simple blank package do not work for Linux64 and OSX64.

     

    Workaround: You will need to add the following directories to Library Path:

     

    Linux64

    C:\Program Files (x86)\Embarcadero\Studio\21.0\binlinux64

     

    OSX64

    C:\Program Files (x86)\Embarcadero\Studio\21.0\binosx64


  7. 6 minutes ago, Stefan Glienke said:

    I don't understand the original problem - please describe exactly the data in a complete but small enough sample and the way you want it to be organized/shown.

    Yes, we need to know the original problem.

    @PolywickStudio
    Another consideration, I believe that your performance problem does not involve this search, because a loop of 60,000 items comparing integers is 0 milliseconds.


  8. @Kryvich If they implement record inheritance, now or in the future, I would prefer it to be more like an object:

    type
      TMyRecord = record(TParentRecord)
        Value: Integer;
        constructor Create; override;
        destructor Destroy; override;
        procedure Assign (const [ref] Src: TMyRecord); override;
      end;

    In this case the record would be like a "class" arc in all platforms, like strings and dynamic arrays, but with support for operators and having the exact size of their fields. It would be incredible.

     

    But if they don't implement inheritance, syntax better resemble the record operators that already exist, as the embaradero proposed:

    type
      TMyRecord = record
        Value: Integer;
        class operator Initialize (out Dest: TMyRecord);
        class operator Finalize(var Dest: TMyRecord);
        class operator Assign (var Dest: TMyRecord; const [ref] Src: TMyRecord);
      end;

     


  9. The first 64-bit iphones were released 7 years ago (iPhone 5s), and today they are the vast majority (more than 98%), it is no wonder that Apple ended support for 32-bit iphones a long time ago. Apple has not even updated iOS 32-bit for more than 4 years, and Apple has not accepted 32-bit apps in its store for some years. I personally have not compiled anything for ios 32 bits for some years.

     

    In the beginning, the 64-bit iOS kept backwards compatibility with 32-bit apps, but that ended when Apple released iOS 11. A good way to find out how many users are running only 64-bit apps is to look at the graphics of the most used versions of iOS (11, 12 and 13 have support only for 64-bit apps).

    • Like 3

  10. 5 minutes ago, Dany Marmur said:

    Neat!

     

    But why "FMX"? At a quick glance it looks like it would work in a VCL project too. No?

    The native System.Sensors.TGeocoder does not have support for VCL because works only in Android, iOS and MacOS. And even in Android have some small devices that does not support. And in the iOS and MacOS the result can be different than the Android because the Apple use the TomTom maps. Then, if you want a full cross platform solution, VCL or FMX, to use in all devices, include linux, having the same result, the Google Maps Geocoding is the solution.

     

    In my case, my client have a Windows version, the System.Sensors.Geocoder not work, I should use just Google Maps Geocoding.

    • Like 1
    • Thanks 1

  11. 36 minutes ago, RDP1974 said:

    No, the canvas is inside the external frame.

     

    The solution in plain API is here:

    https://stackoverflow.com/questions/22165258/how-to-create-window-without-border-and-with-shadow-like-github-app/44489430#44489430

     

    1. Create window with WS_CAPTION style
    2. Call DwmExtendFrameIntoClientArea WDM API passing 1 pixel top margin
    3. Handle WM_NCCALCSIZE message, do not forward call to DefWindowProc while processing this message, but just return 0

     

    (https://stackoverflow.com/questions/43818022/borderless-window-with-drop-shadow)

    Roberto, now I undestand your question, but this solution not work for me.

    I don't know why this line is there, but if it helps you, the same is not happening in FMX applications. The possible solution may be in the units FMX.Platform.Win or FMX.Forms.Border.Win.

     


  12. @RDP1974, @Turan Can

    To get a beatiful shadow, use the DWM API.

     

    Shadow in borderless form in VCL:

    unit Unit3;
    
    interface
    
    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
    
    type
      TForm3 = class(TForm)
      private
        { Private declarations }
        function SetBordelessShadow: Boolean;
      protected
        procedure CreateParams(var AParams: TCreateParams); override;
        procedure CreateWindowHandle(const AParams: TCreateParams); override;
        procedure WndProc(var AMessage: TMessage); override;
      public
        { Public declarations }
      end;
    
    var
      Form3: TForm3;
    
    implementation
    
    uses
      Winapi.DwmApi, Winapi.UxTheme;
    
    {$R *.dfm}
    
    { TForm3 }
    
    procedure TForm3.CreateParams(var AParams: TCreateParams);
    begin
      inherited CreateParams(AParams);
      if TOSVersion.Major < 6 then
      begin
        AParams.Style := WS_POPUP;
        AParams.WindowClass.Style := AParams.WindowClass.Style or CS_DROPSHADOW;
      end;
    end;
    
    procedure TForm3.CreateWindowHandle(const AParams: TCreateParams);
    begin
      inherited;
      if TOSVersion.Major >= 6 then
        SetBordelessShadow;
    end;
    
    function TForm3.SetBordelessShadow: Boolean;
    var
      LMargins: TMargins;
      LPolicy: Integer;
    begin
      if TOSVersion.Major < 6 then
        Exit(False);
      LPolicy := DWMNCRP_ENABLED;
      Result := Succeeded(DwmSetWindowAttribute(Handle, DWMWA_NCRENDERING_POLICY, @LPolicy, SizeOf(Integer))) and DwmCompositionEnabled;
      if Result then
      begin
        LMargins.cxLeftWidth := 1;
        LMargins.cxRightWidth := 1;
        LMargins.cyTopHeight := 1;
        LMargins.cyBottomHeight := 1;
        Result := Succeeded(DwmExtendFrameIntoClientArea(Handle, LMargins));
      end;
    end;
    
    procedure TForm3.WndProc(var AMessage: TMessage);
    begin
      case AMessage.Msg of
        WM_DWMCOMPOSITIONCHANGED,
        WM_DWMNCRENDERINGCHANGED:
          if SetBordelessShadow then
          begin
            AMessage.Result := 0;
            Exit;
          end;
      else
      end;
      inherited;
    end;
    
    end.

    Note: You can do the same in FMX!

    See the difference in the images attached:

    Using_DWM.png

    Using_DropShadow.png

    • Like 1

  13. Because your stylelookup is empty and the default stylelookup of the TPanel is the 'panelstyle', and your new component don't have a default style.
    Just do this:

    procedure TForm1.InitSpeedPanel(sp: TSpeedPanelClass);
    var
      sb: TSpeedButton;
    begin
      sp.StyleLookup := 'panelstyle'; // <<<<<<<<<
      // ...

     

    • Like 1
    • Thanks 1

  14. You may be manipulating images without checking the scale of the screen. Because in Windows the scale is usually 1 so there are no problems. Try on your windows to adjust the scale to 150% and test your program.

    I have a delphi crossplataform app that works perfectly on Windows, iOS and Android. It is not a game but have some cool animations that execute with 60fps without any choking and is more fast then the most of the apps that I have on my phone.

×