Jump to content

Uwe Raabe

Members
  • Content Count

    2909
  • Joined

  • Last visited

  • Days Won

    169

Posts posted by Uwe Raabe


  1. 6 minutes ago, Freeeee said:

    so I'd replace the *.DFM with specific, named dot DFM files?

    No, you should use separate units for each form and keep the {$R *.dfm} directive in each. The * makes it match with the unit name and the IDE will keep unit and form file names in synch.

     

    Please refrain from packing multiple forms into one unit. Otherwise you will most likely flood this forum with questions about the problems you get, while the correct answer will always be: Don't do that!

    • Like 1

  2. 10 hours ago, Freeeee said:

    having a IDE designed around a forms design screen without allowing multiple forms seems like a bad idea.

    You can have multiple forms open in the IDE, each in its own unit. If you want multiple designers for each form, you need to create separate edit windows with New Edit Window.

     

    10 hours ago, Freeeee said:

    Am I correct in that that the 2nd and other forms have to go into either the public or private sections?

    The usual way is to have a separate unit (pas and dfm) for each form. There are rare cases where declaring one or more form descendants in the same unit without the ability to design can make sense.


  3. 1 hour ago, DelphiUdIT said:

    I cannot find the Architect SKU

    The Architect SKU is in fact an Enterprise SKU with additional licenses for some external tools (RAD Server Multi-Site, Sencha Ext JS Professional Edition, Aqua Data Studio). This SKU can only be detected from the license, so an IDE plugin can query the SKU and will return Architect with an appropriate license.


  4. I cannot check this in my environment as I neither have a Personal Edition nor a Community Edition at hand. I can just share that my Architect Edition shows Enterprise in the details, which is expected because Enterprise and Architect differ only in the licenses for some external tools.

     

    Given the previous findings, the Product name seems to be a valid approach to detect the installed edition.


  5. 2 hours ago, Remy Lebeau said:

    The whole point of TImageCollection is to provide images of different sizes/resolutions, and then TVirtualImageList presents those images at a given size/resolution.

    It also scales the image if the requested size is not present.


  6. 5 hours ago, bazzer747 said:

    //Run the report
    fRepCompEnrolment.sctRepCustListt.Run;

    Let me guess: fRepCompEnrolment is a form containing a component named sctRepCustListt (not sure about the trailing doubled t, but I copied it) of type TSctReport?

    Then the file where fRepCompEnrolment is declared is the pas file you are looking for.

     

    It can still be that that .pas cannot be found and it works because the compiled .dcu is used instead, but that would be pretty uncommon for this case.


  7. Unless I misunderstand you completely, the .pas file have the same name as the .dfm file containing the form. 

     

    37 minutes ago, bazzer747 said:

    I might not be seeing the woods for the trees here

    Well, that might indeed be the case, but you might describe your situation in more detail to clarify.


  8. The code for checking the presence of a Delphi IDE is like this:

    function IsDelphiIDEInstalled(IDEVersion: TDelphiIDEVersion): Boolean;
    var
      R: TRegistry;
    begin
      R := TRegistry.Create;
      try
        R.RootKey := HKEY_LOCAL_MACHINE;
        Result := R.OpenKeyReadOnly(DelphiIDEKey(IDEVersion));
      finally
        R.Free;
      end;
    end;

    DelphiIDEKey evaluates to Software\Embarcadero\BDS\%d.0 for the newer versions. Note that ModelMaker is only aware of BDS versions up to 19.0 (Delphi 10.2 Tokyo). 

     

    You might get away with just creating the base key for a non-installed version to trick ModelMaker into looking for the expert. So adding HKLM\Software\Embarcadero\BDS\19.0 to the registry should get you going.


  9. Is this in HKEY_LOCAL_MACHINE?

     

    If yes, there might be other criteria being checked for existence of a Delphi version. I'm willing to investigate, but my possibilities in regard to ModelMaker are a bit limited compared to MMX.


  10. There are several bugs fixed in 12.2 and 12.3 affecting frames.

    https://quality.embarcadero.com/browse/RSP-37402

    https://quality.embarcadero.com/browse/RSP-39847

    https://quality.embarcadero.com/browse/RSP-40110

    https://quality.embarcadero.com/browse/RSP-43560

    https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1020

     

    Perhaps these will fix your problem, too.

     

    I will test your project later when I've found some time to configure my system for monitors with different dpi.

    • Like 2

  11. 2 hours ago, jesu said:

    Yes, Windows 11 Notepad screws files. This never happened in Windows 10 after many years using it. You open a file double-clicking it, edit it and just click save expecting that it respects your encoding. Sometimes it does, sometimes not. Sure, you can use Save as to be sure that it uses the encoding you want, but that was never neccessary before.

     

    23 hours ago, jesu said:

    Unfortunately, we still need to use ANSI in some files but sometimes (likely by notepad) that is replaced with UTF8.

    I just took what the OP wrote and show a way to revert any file somehow changed from ANSI to UTF-8. I never said it is a silver bullet for all circumstances.


  12. 5 minutes ago, jesu said:

    The fact is that we need to restore these files without loosing time doing it by hand.

    Load the file with UTF-8 encoding and save it with ANSI encoding.

    uses
      System.IOUtils;
      
    ...
      TFile.WriteAllText(FileName, TFile.ReadAllText(FileName, TEncoding.UTF8), TEncoding.ANSI);

    If the files are too large to fit into memory, you need to work with different file names for input and output:

      var writer := TStreamWriter.Create(NewFileName, False, TEncoding.ANSI);
      try
        var reader := TStreamReader.Create(FileName, TEncoding.UTF8);
        try
          while not reader.EndOfStream do
            writer.WriteLine(reader.ReadLine);
        finally
          reader.Free;
        end;
      finally
        writer.Free;
      end;

     

×