Jump to content

Dave Nottage

Members
  • Content Count

    1331
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by Dave Nottage


  1. I see what the problem is now: it's because selecting Segoe UI at design-time results in the Family value not being stored in the .fmx, because it's the default for Windows.

     

    I'd consider that a design fault, since it does not account for using a font with the same name on platforms other than Windows.

     

    Easiest solution: use something that looks like Segoe UI, but isn't 🙂 Any other solution would seem a bit difficult..

    • Like 2

  2. 6 hours ago, pro_imaj said:

    The deficiency I made was the codes that you added to the button,

    It also works for me just by having the Font.Family property in TextSettings set to the correct value (i.e. Anton) at design time. Using the button and code was just to demonstrate that there's a very obvious change in the font.

     

    I suspect there's something else wrong with your project, which is why I asked to post a test case.

    • Like 1

  3. 14 minutes ago, pro_imaj said:

    There is a mismatch problem between the latest version of Delphi (10.3.3) and the latest version of xcode.

    I'm using Delphi 10.3.3, the latest released version of Xcode (11.4), building against the latest iOS SDK (13.4) and it works on my iPhone X which has iOS 13.4.

     

    I've attached my test project (which uses the Anton font, from here: https://fonts.google.com/specimen/Anton). Perhaps if you have a test project, you could attach it so it might be discovered what is going wrong.

     

     

    CustomFontDemo.zip

    • Thanks 1

  4. 4 minutes ago, pyscripter said:

    The -version -skd happens while the dialog is showing.

    Yes, that's what PAServer runs to discover what SDKs are on the Mac.

    5 minutes ago, pyscripter said:

    Nothing seems to happen when I press OK.

    Actually, I'm not sure now whether PAServer will show anything when it copies the files to the local machine. I was hoping it would display an error (if any).

    6 minutes ago, pyscripter said:

    Do I need to download the SDK in the Mac?  The XCode version is 11.4.

    You should not need to, no. In case there is something really wrong though, on the Mac can you:

     

    1. Go to the Applications folder in Finder
    2. Right click on Xcode and click Show Package Contents
    3. Navigate to: Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs and make sure there's a MacOSX.sdk folder there (with subfolders)

    The only other thing I can think of is a rights issue (i.e. PAServer somehow does not have rights to the SDK subfolders), but that's a stretch


  5. On 4/16/2020 at 7:00 PM, pro_imaj said:

    Have you tried and seen the correct result?

    Yes, as per the article.

     

    Make sure you're actually deploying the font files (Project|Deployment in the Delphi IDE), and to the correct Remote Path. i.e:  .\

     

    Also make sure that the entries in info.plist.TemplateiOS.xml match exactly with the actual filename - filenames are case sensitive on iOS.

    • Like 1

  6. The whole point is to shift controls up when they would be otherwise covered by the virtual keyboard. There is no point in shifting them down. In order to do that, you would need to have a control (e.g. a TLayout) at the top of the scrollbox and change the height so that the other controls move down. It is way more trouble than it is worth, and I doubt that users would even expect it to happen.


  7. 38 minutes ago, pro_imaj said:

    But before I was developing with the same font without any problems, I published the applications to the app store and there was no problem.

    Please indicate what you mean by "before", e.g. was it a different version of Delphi? Deploying to a device with a different version of iOS, if so, which version(s)? Were your applications deploying the custom fonts?

    • Like 1

  8. I have some .NET interop code where I've managed to load objects and read properties, however I am having trouble with setting a property on an object. Here's the relevant parts of the Delphi code:

    uses
      mscorlib_TLB, Winapi.ActiveX;
    
    type
      // Irrelevant parts of the code omitted
      TDotNetObject = class(TObject)
      private
        FTarget: OleVariant;
        FType: _Type;
      public
        procedure SetProperty(const APropertyName: string; const AValue: OleVariant; const AIndex: Integer = -1);
      end;
    
    function VariantToPSafeArray(const AValue: Variant): PSafeArray;
    begin
      Result := PSafeArray(VarArrayAsPSafeArray(AValue));
    end;
    
    procedure TDotNetObject.SetProperty(const APropertyName: string; const AValue: OleVariant; const AIndex: Integer = -1);
    var
      LPropertyInfo: _PropertyInfo;
      LIndex: PSafeArray;
    begin
      if AIndex >= 0 then
        LIndex := VariantToPSafeArray(VarArrayOf([AIndex]))
      else
        LIndex := nil;
      LPropertyInfo := FType.GetProperty(APropertyName, BindingFlags_Instance or BindingFlags_Public or BindingFlags_NonPublic);
      if LPropertyInfo <> nil then
        LPropertyInfo.SetValue(FTarget, AValue, LIndex);
    end;
    
    procedure UpdateDefectStatus(const ADefectID, AStatus: Integer);
    var
      LObject: TDotNetObject;
    begin
      // ** Code to obtain the object omitted ***
      LObject.SetProperty('Status', AStatus);
    end;

    An error is thrown when LPropertyInfo.SetValue is called in TDotNetObject.SetProperty:

     

    image.thumb.png.6ba1346f0aaa83cd86f4b7d9204efb2d.png

     

    The Status property type in C# is declared:

    public enum DefectStatus
    {
    	/// <summary>
    	/// Defect Reported.
    	/// </summary>
    	Reported,
    	/// <summary>
    	/// Defect assessed.
    	/// </summary>
    	Assessed,
    	/// <summary>
    	/// Defect on work order.
    	/// </summary>
    	OnWorkOrder,
    	/// <summary>
    	/// Defect closed.
    	/// </summary>
    	Closed
    }

    I found a solution for how to handle this situation using C# here:

    https://stackoverflow.com/a/13270302/3164070

    However I'm a bit lost as to how to do the same in Delphi. Any ideas?


  9. 57 minutes ago, Rollo62 said:

    at least you cannot edit any custom styles

    Yes, that is a drawback of using a datamodule. That said, different custom styles for the same controls inside the same application seems like inconsistent UI design to me.


  10. 7 hours ago, Tntman said:

    Problem was that I didnt know how to rewrite this android code into delphi FMX code

    You cannot rewrite that java code into Delphi code, since it is creating a descendant of a Java class, which is presently not possible with Delphi. You can however create descendant in Java code that can then be consumed by Delphi.

     

    I've been meaning to do a blog post about this for quite some time now because it requires a fair amount of explanation as to how to go about it.


  11. It's in on the Mac, in /Users/[username]/PAServer/scratch-dir/[computername]-[profilename], where

     

    [username] = the macOS username

    [computername] = the Windows computer name you're deploying from

    [profilename] = the connection profile name you're using

     

    eg:  /Users/dave/PAServer/scratch-dir/dell-Mac

     

    I have Delphi expert and companion macOS app that has functionality that opens Finder on the Mac to show you exactly where it is, here:

     

    https://github.com/DelphiWorlds/Mosco

    • Thanks 1

  12. You'll need to modify the patch in FMX.FontGlyphs.Android.pas to look like this:

        NameFont := TPath.Combine(TPath.GetDocumentsPath, CurrentSettings.Family);
        if not CurrentSettings.Style.Weight.IsRegular and TFile.Exists(NameFont + '-Bold.ttf') then
          NameFont := NameFont + '-Bold.ttf'
        else if CurrentSettings.Style.Weight.IsRegular and TFile.Exists(NameFont + '-Regular.ttf') then
          NameFont := NameFont + '-Regular.ttf'
        else
          NameFont := NameFont + '.ttf';

     


  13. 6 hours ago, CarloM said:

    but you deploy dylib ?

    Yes; I would not have mentioned them otherwise.

    6 hours ago, CarloM said:

    actually I use openssl from mac os

    Depending on the version of macOS (especially later versions), the OpenSSL libs will not work with Indy.

    6 hours ago, CarloM said:

    compiled app with 10.3.2 works ok but no last version of delphi

    Perhaps something in Indy changed.

×