Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/13/21 in Posts

  1. The full list of code examples from the book Delphi Event-based and Asynchronous Programming is now available on GitHub: https://github.com/dalijap/code-delphi-async
  2. We are glad to announce that StyleControls VCL v. 4.79 is released! http://www.almdev.com StyleControls VCL is a powerful, stable package of components, which uses Classic drawing, system Themes, GDI+ and VCL Styles. This package contains the unique solutions to extend standard VCL controls and also has many unique, advanced controls to create applications with UWP / Fluent UI design.
  3. I never understood the benefit of writing the ExplicitLeft / Top / Width / Height properties for TControl and descendants, which were added in Delphi 2007, to the dfm files. They store the control’s position and size before its Align property was set to something like alClient or alRight, so they can be restored later. That’s useful if you change these by accident or double click on the Align property to go through the possible values, but as soon as you save the form, you don’t really need them any more. Even worse, they seem to change often with no apparent reason and therefore clutter a dfm file’s diff with changes that nobody is interested in. read on in the blog post
  4. Rollo62

    Delphi iOS Metal Api Comparison (Video)

    Well, than I have to look into OrangeUI soon
  5. @dummzeuch Your problem is not in sorting algorithm at all. Trying to optimize sorting algorithm you just solving the wrong task. Even faster way will be to copy the data into some array, sort the array and then copy data back: type TDataItem = record S: string; O: TObject; Checked: Boolean; end; TData = array of TDataItem; var FData: TData; procedure TForm1.Button1Click(Sender: TObject); var c: Cardinal; i: Integer; c2: Cardinal; begin c := GetTickCount; CheckListBox1.Items.BeginUpdate; try SetLength(FData, CheckListBox1.Items.Count); // Copy data from UI for i := 0 to High(FData) do // control. begin // FData[i].S := CheckListBox1.Items[i]; // FData[i].O := CheckListBox1.Items.Objects[i]; // FData[i].Checked := CheckListBox1.Checked[i]; // end; // c2 := GetTickCount; SortList(0, High(FData), SortCompare); // Sort data in array. c2 := GetTickCount - c2; for i := 0 to High(FData) do begin CheckListBox1.Items[i] := FData[i].S; // Copy sorted data CheckListBox1.Items.Objects[i] := FData[i].O; // back. CheckListBox1.Checked[i] := FData[i].Checked; // end; finally CheckListBox1.Items.EndUpdate; c := GetTickCount - c; end; Edit1.Text := IntToStr(c); // Whole time, including UI updates. Edit2.Text := IntToStr(c2); // Sort only time. end; With 10000 items (!) this code run in: Whole time, including UI updates - 1.5 secs (the control is slow, nothing to do with that). Sort only time - 15 msecs. 15 msecs for sorting of 10000 items!
  6. Edwin Yip

    ANN: StyleControls VCL v. 4.79 is released!

    See by evidence, StyleControls and the developers behind it are just great. I requested a new feature and they implemented it. See the email attached. And such things have been happened many times ;) I'm not associated with almdev but just a satisfied customer :)
  7. Anders Melander

    adding graphics32 component

    Yes they did. And some made significant contributions with bugs that can not be fixed because no one understand the code, it's poorly documented (if at all) and it's using undocumented algorithms. Maybe that's acceptable in some projects but if I'm to maintain the code then it's not. It doesn't matter how brilliant the code is if it can't be maintained. Code like that is poison to a library. There are many things that Graphics32 would benefit from but a rewrite isn't one of them. Of course if you dislike the architecture and the constraints of working within or incrementally evolving the existing framework then I can understand why you'd want to start from scratch, but by discarding over 20 years of experience and optimizations you're bound to repeat some of the mistakes - and make some new ones 🙂 As I see it Graphics32 and Image32 doesn't really target the same problem space.
  8. balabuev

    Customizing source editor

    Customized colors in black theme + Inconsolata font. Quality image link: https://i.ibb.co/3dDkPNQ/image.png
  9. I did quick & dumb test that has shown that 100 ScanLines on 5000*5000 bitmap takes 5 seconds (!) because bitmap is recreated in every call. So this is the real handbrake. Looking at TBitmap.GetScanLine you can extract necessary parts provided you have the pointer to the 1st row from initial ScanLine call. BytesPerScanline helper method is public so this even won't be a hack.
  10. Okay. Presume there is Windows-10 PC and you can run any code with guest rights. Tell me how to read the memory of any system service 😉
  11. Fr0sT.Brutal

    Default code style

    When inserting a piece of code, its default style is for some reason "HTML". Here, at Delphi forum, it seems like a annoyance generator invented by the devil 🙂
×