Jump to content

Cristian Peța

Members
  • Content Count

    451
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Cristian Peța


  1. @angusj,

    Is Image32 intended to be thread-safe?

    I ask because there is a global var aFontManager in Img32.Text.

    I told myself: this is not a problem, I will instantiate a TFontManager for every thread. But then I found that TFontCache.AddGlyph() uses this global var aFontManager.... You pushed this code in 7 dec. 2024

     

    EDIT: I see that I can use fFontReader.fFontManager instead of aFontManager.

    EDIT2: I created a Pull request. My first one and hope it is ok.

    Thank you for your work on this library!


  2. 23 minutes ago, dormky said:

    Main bottleneck is the repeated calls to the gdi canvas to draw lines.

    How many lines? GDI+ is slow but I suppose you are using GDI here.

    I have 174 ms for 46000 lines.

    EDIT: That means 13300 lines per 50 ms


  3. 15 minutes ago, tobenschain said:

    The FDConnection is a variable

    Yes, no problem. And what has this to do with FireDAC Monitor tool properties?

    BTW, you can start yourself the Monitor from the Bin folder, not necessary to use the link from the IDE.


  4. 20 hours ago, Lars Fosdal said:

    Proper stack traces with EurekaLog, MadExcept or similar, are invaluable in such cases.

    I second this.

    On 7/29/2025 at 10:25 AM, Der schöne Günther said:

    As for (3), my app was able to log the following callstack:

    
    24/07/2025 14:31:32
    [63.4]
    Thread-ID 9052 ("TIdThreadWithTask")EAccessViolation: "Access violation at address 0098638C in module 'MyStuff.exe'. Write of address 00000004"
    [0098638C] IdTask.TIdTask.DoBeforeRun
    [00CA9106] JclHookExcept.DoExceptFilter
    [00CA92D9] JclHookExcept.HookedExceptObjProc
    [0040BAA3] System.@HandleAnyException
    [004E2399] System.Classes.ThreadProc
    [0040C6F8] System.ThreadWrapper

    Here I don't see line number in IdTask.TIdTask.DoBeforeRun. I suppose it is the first line. Also the call stack is not what it should.

    I would like also assembler code and register values.

    Address 00000004 is FBeforeRunDone in TIdTask.DoBeforeRun.

      TIdTask = class(TObject)
      protected
        FBeforeRunDone: Boolean;
      ....
      end;
    
    procedure TIdTask.DoBeforeRun;
    begin
      FBeforeRunDone := True; <-- "Access violation at address 0098638C in module 'MyStuff.exe'. Write of address 00000004"
      BeforeRun;
    end;

    So a reference to TIdTask object is nil but we don't see the call stack to know who is calling this nil reference.

    A proper call stack is missing.


  5. 35 minutes ago, A.M. Hoornweg said:

    When large numbers of fields are accessed by name, the legibility of a CASE is much better than if/then. 

    I prefer something like this:

    type
      TMyStrings = (zero, one, two, three, four);
    
      function StrToMyString(AString: String): TMyStrings;
      begin
        if AString = 'zero' then        Result := TMyStrings.zero
        else if AString = 'one' then    Result := TMyStrings.one
        else if AString = 'two' then    Result := TMyStrings.two
        else if AString = 'three' then  Result := TMyStrings.three
        else if AString = 'four' then   Result := TMyStrings.four
      end;
    var
      s: String;
    begin
      s := 'three';
      case StrToMyString(s) of
        zero:  writeln('zero');
        one:   writeln('one');
        two:   writeln('two');
        three: writeln('three');
        four:  writeln('four');
      end;
    
      //or, if you want interger
      case Integer(StrToMyString(s)) of
        0: writeln('zero');
        1: writeln('one');
        2: writeln('two');
        3: writeln('three');
        4: writeln('four');
      end;

     


  6. Just wanted to try a fix in FMX.Forms and I found it already there but commented 🤔.

    First two lines will exit and AlignObjects() will not be called if used Form.BeginUpdate. The Realign will be done anyway after Form.EndUpdate.

    procedure TCustomForm.Realign;
    begin
    //  if FDisableAlign or (FUpdating > 0) then
    //    Exit;
    ... more code
      if FCanvas <> nil then
      begin
        AlignObjects(Self, Padding, FCanvas.Width, FCanvas.Height, FLastWidth, FLastHeight, FDisableAlign);
        RecalcControlsUpdateRect;
        InvalidateRect(ClientRect);
      end;
    end;

     


  7. FMX.Types.AlignObjects is taking the most time: 97.4% (from VTune)

     

    AlignObjects is not called from TControl.Realign and is going fast when rectangles are on TLayout.

     

    But when rectangles are on a form, AlignObjects is called from TCustomForm.Realign and is taking the most time

    FMX.Types.AlignObjects($4BD50A0,$4C4C860,640,480,640,480,False)
    FMX.Forms.TCustomForm.Realign
    FMX.Controls.TControlHelper.PositionChanged(???)
    FMX.Types.TPosition.DoChange
    FMX.Types.TPosition.SetX(1)
    Unit1.TForm1.Button1Click($4BEFDE0)

     

     

    • Thanks 1

  8. On 6/22/2025 at 12:06 PM, limelect said:

    All Java should be in c:\bin, why?

    I have 12.2 and it was installed by default in C:\Program Files\Eclipse Adoptium\jdk-17.0.9.9-hotspot

    All is working for me.

    image.thumb.png.f9035ee2fa9a97a98f039156b6f88bc3.png


  9. I suppose you want something like this:

     

      * ReportTitle (logo + ...)

      * Header
        - RichText

        - Column names (if you need them)
      * MasterData connected to the table
        - table fields that will be printed for every table record

      * Footer
        - RichText
      * PageFooter (for Page Numbers)


  10. Reading again I'm asking myself if you know what MasterData is. You connect MasterData to a table and MastedData will be printed for every line in that table.

    To put a TableObiect into a MasterData is somehow strange for me. You will print a table for every record of a table.


  11. On 6/13/2025 at 2:43 PM, Squall_FF8 said:

    And it didnt work:
     - The TableObject is not shown!

    What didn't work?

    The MasterData is not shown or only TableObiect?

    Have you set MasterData.DataSet? Do you have something in that table?

    And you want to print that RishText for every line in that MasterData table?

×