-
Content Count
56 -
Joined
-
Last visited
-
Days Won
1
#ifdef last won the day on July 30
#ifdef had the most liked content!
Community Reputation
12 GoodTechnical Information
-
Delphi-Version
Delphi Community Edition
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I can't believe they did it π₯²
-
That's why I chose the TControlList β it allows to instantly move to any place, all that remains is to fix the fixed row height π
-
THtmlViewer: https://i.ibb.co.com/XXX8pt9/image.gif TControlList: https://i.ibb.co.com/84bg3g1/1.gif
-
Yes, I'm sure THtmlViewer + 10000 (start is ~5 seconds, resize is slow): unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, System.Math, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, HTMLUn2, HtmlView; type TForm1 = class(TForm) HtmlViewer1: THtmlViewer; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function setCaption: string; var Lt: string; Li, Ll: integer; begin Ll := RandomRange(10, 1000); Lt := ''; for Li := 1 to Ll do begin if (Random(10) = 0) and (Li < Ll) then begin Lt := Lt + ' '; end else begin if Random(2) = 0 then Lt := Lt + Chr(RandomRange(65, 90)) else Lt := Lt + Chr(RandomRange(97, 122)); end; end; Result := Lt; end; procedure TForm1.FormCreate(Sender: TObject); var Li: integer; Ls: string; begin for Li := 1 to 10000 do Ls := Ls + '<div>' + Li.ToString + ': ' + setCaption + '</div><br>'; HtmlViewer1.Text := Ls; end; end. TControlList + 10000 (start is ~1 second, resize is ok): unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, System.Math, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ControlList; type TForm1 = class(TForm) ControlList1: TControlList; Label1: TLabel; procedure FormCreate(Sender: TObject); procedure ControlList1BeforeDrawItem(AIndex: Integer; ACanvas: TCanvas; ARect: TRect; AState: TOwnerDrawState); private { Private declarations } public { Public declarations } end; var Form1: TForm1; FList: TStringList; implementation {$R *.dfm} function setCaption: string; var Lt: string; Li, Ll: integer; begin Ll := RandomRange(10, 1000); Lt := ''; for Li := 1 to Ll do begin if (Random(10) = 0) and (Li < Ll) then begin Lt := Lt + ' '; end else begin if Random(2) = 0 then Lt := Lt + Chr(RandomRange(65, 90)) else Lt := Lt + Chr(RandomRange(97, 122)); end; end; Result := Lt; end; procedure TForm1.ControlList1BeforeDrawItem(AIndex: Integer; ACanvas: TCanvas; ARect: TRect; AState: TOwnerDrawState); begin Label1.Caption := FList[AIndex]; end; procedure TForm1.FormCreate(Sender: TObject); begin FList := TStringList.Create; ControlList1.ItemCount := 10000; for var Li := 0 to ControlList1.ItemCount - 1 do FList.Add(Li.ToString + ': ' + setCaption); end; end.
-
It looks really good, but on older computers 1000+ lines are too slow to render when resizing the canvas β and I canβt use pagination because the entire list must be available. But thanks anyway!
-
https://github.com/NickeManarin/ScreenToGif/
-
No, I don't (anyway, TControlList is for TGraphicControl only). Yes.
-
Sorry, I don't need a text editor, I just need to somehow speed up the rendering of text with word splitting and that's it
-
Nope. TControlList if for TGraphicControl only:
-
I know but... in Notepad++ everything is ok π₯²
-
You can try changing "100" to "1000" and change the size of the form after compilation
-
Thank you for your kind words, but no, I donβt think I succeeded, that's why I decided to contact you personally π I have 11.3 CE (28.0.48361.3236), you are right, but it probably should look and work the same on 12.1: the problem occurs when the form changes size. What about the "FHeights" - it's just a temporary storage of row sizes (like a cache or something).
-
It's impossible to speed things up? π
-
I added dynamic (variable) row heights to TControlList and it works: But when resizing the form, the TControlList is terribly slow. @Serge_G I know you are a guru in this list. Please tell me how this can be fixed? Project1.zip