Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/12/21 in all areas

  1. vfbb

    Skia4Delphi

    Website: github.com/viniciusfbb/skia4delphi Skia4Delphi is a cross-platform 2D graphics API for Delphi based on Google's Skia Graphics Library (skia.org). Google's Skia Graphics Library serves as the graphics engine for Google Chrome and Chrome OS, Android, Flutter, Xamarin, Mozilla Firefox and Firefox OS, and many other products. Skia provides a more robust Canvas, being very fast and very stable, with hundreds of features for drawing 2D graphics, in addition to a text shaping engine designed to render texts in the most diverse languages with right-to-left support (such as the Persian language), full support for loading SVG files, support for creating PDF files, support for rendering Lottie files (verotized animations created in Adobe After Effects), integration with the GPU, among countless other cool features. Skia's idea is similar to Firemonkey's, the same codebase used in an OS will work the same on other platforms. It is also possible to design using the CPU in independent background threads. Skia also has native codecs, of course if you don't use the SKCodec class, when loading an encoded image it will give priority to using the platform's native codec, but it is possible to use its codec, for example for jpeg files it uses libjpeg-turbo and for png files libpng which maybe in certain environments may perform better than native. See some examples: Advanced shapes Advanced text rendering / shaping Svg Lottie files And much more...
  2. If you have a bad compiler that puts cold code into the middle of your hot loop where performance really matters instead of restructuring the code you need goto.
  3. Ehm! That Exit call will only exit procedure gotoTrue, but not function BlankControl. Funny, that such a suggested improvement perfectly qualifies for the reason of this thread
  4. Uwe Raabe

    TPopupMenu with group headers

    Add an OnDrawItem or OnAdvancedDrawItem event handler to these menu items with something like the following code: ACanvas.Font.Style := [TFontStyle.fsBold]; ACanvas.TextRect(ARect, 1, 1, StripHotkey((Sender as TMenuItem).Caption)); As obviously styles are involved, you might have to take that into account, too.
  5. As with any tools, they are pros and cons to every solutions. Regarding to the CHM and HTML documentation formats, one of the most unique HelpNDoc feature is its template system, which lets you customize almost any part of the generated documentation using a Pascal-based template engine. See for example: https://www.helpndoc.com/news-and-articles/2019-09-25-create-a-new-html-template-to-customize-your-online-documentation-projects/ If you do not want to go that deep, the default HTML5 template has many features and can be easily customized: https://www.helpndoc.com/feature-tour/produce-html-websites/ The same is true for the CHM documentation format: https://www.helpndoc.com/feature-tour/create-chm-help-files/ Feel free to try the Personal Edition which is fully functional and free for personal use and evaluation purposes: https://www.helpndoc.com/download/
  6. Fellow Delphi developers, This is with great pleasure that we announce a 50% discount on all editions of HelpNDoc (including new licenses, updates and upgrades) starting now and for a few days only: https://www.helpndoc.com/news-and-articles/2021-08-12-summer-sale-2021-50-discount-on-all-editions-of-helpndoc-till-monday-only/ HelpNDoc an easy to use yet powerful help authoring tool producing CHM help files, responsive HTML 5 and mobile Web Sites, DocX and PDF manuals, ePub and Kindle eBooks as well as Qt Help files from a single source. HelpNDoc is Free for personal use and evaluation purposes and is available at: https://www.helpndoc.com Download HelpNDoc now and use it for free for personal and evaluation purposes: https://www.helpndoc.com/download Follow our step-by-step video guides to learn how to use HelpNDoc: Best regards, John, HelpNDoc team. https://www.helpndoc.com
  7. Upgraded to D14.4.2 For EU End User input errors should provide helpful feedback. 'not enough data entry', 'too much data' masked tedits help Exceptions need to be surfaced!
  8. Code that originated in a Version before 2009
  9. I did find this in some of the open source projects, I guess nobody complained, yet.
  10. I just released a converter to go from Delphi VCL/FireMonkey style files (.vsf) to a structured JSON dump. Embedded bitmaps are ignored, and it's one-way only, but it's handy for comparing changes. There's a Beyond Compare 4 file format available as well, though if you have questions/issues, post here or on the Github page rather than going through Scooter Software's official support. https://github.com/boramis/vsf2json
  11. And you indeed refactored it into the only sane form I can think of! Might have moved the Result := False into that final else though because it's only needed then. And could have replaced the softcast with a hardcast because you already did the is check.
  12. vfbb

    Skia4Delphi

    Just download the .zip file attached to the release tag, it contains the .dlls, .so and .a. Externals has an edited version of Skia, with a flat api exclusive to the library. There are instructions for compiling in BUILD.md 1. I confess that I only tested the first versions on the XE6, but in fact the code has changed a lot since then. I will fix it. 2. SkShaper uses Harfbuzz, but your comment was great, because although the example works without icu data, investigating, I realize that to use Harfbuzz there is still a dependency on ICU. For macOS and iOS SkShaper uses CoreText, dispensing with ICU and Harfbuzz, which is great because in the case of iOS the library is static. Anyway, I'm going to investigate and test it on all platforms, even though it worked without icu data. It seems to me that PDF Subset also uses ICU, I'll investigate anyway. I'll clean up the demo code and create a little more robust example and add it to the repository.
  13. Stefan Glienke

    10.4.1+ Custom Managed Records usable?

    Here are some more: Wrong codegen: https://quality.embarcadero.com/browse/RSP-34539 Bogus error: https://quality.embarcadero.com/browse/RSP-34540 Bogus operator calls: https://quality.embarcadero.com/browse/RSP-34541
  14. PeterPanettone

    No StringHelper for saving to file?

    Maybe: MyString.ToBitCoin? That would make Delphi developers RICH!
  15. Der schöne Günther

    No StringHelper for saving to file?

    Saving to file has nothing to do with the string itself. What's next, myString.SendOverNetworkByUDP(..)? You have TFile.WriteAllText(filePath, fileContent) from System.IoUtils, that should be enough for everybody 😉
  16. No, it's just shorter than writing: var LKeepProcessing: Boolean; begin repeat LKeepProcessing := ProcessMessage(Msg); until not LKeepProcessing; end;
  17. for I := low to high do; begin ... end; falls into the same category.
  18. try ... except on E: Exception do ... raise E; end Gives scary and mystic AV somewhat later after the problematic line in OS callstack. Real PITA to find and fix.
  19. StrToDate('2021/12/31'); Using StrToDate() etc with Date/Time literal in code, that most likely will fail in other locals than yours, Also the EncodeDate etc routines giving numbers is better IMHO.
  20. Juande

    Delphi 10.4.2 first impressions

    Hello, In Rad Studio 10.4.2 where is the Delphi Compiler option Generate Android App Bundle in project Options? Thanks, Juande.
  21. The marvel: if ThereIsAnError then begin ShowMessage('This is the error'); Abort; end; All exceptions in a big project with this simple, magic trick... I had to work 2 weeks to change all the exception handling system.
  22. I was surprised to check this thread this morning and see all the comments. I guess I should've mentioned I had already refactored this. Since I despise both GOTOs and EXITs, I rewrote it without any of them: function BlankControl(EditControl: TObject; const EditMess: string; ShowErrorMsg: Boolean; MaxLen: Integer): Boolean; begin // assume False, prove otherwise Result := false; if EditControl is TCustomEdit then Result := length(trim((EditControl as TCustomEdit).Text)) < MaxLen else if EditControl is TComboBox then Result := length(trim((EditControl as TComboBox).Text)) < MaxLen else if EditControl is TDBComboBox then Result := length(trim((EditControl as TDBComboBox).Text)) < MaxLen else if EditControl is TDBRadioGroup then Result := length((EditControl as TDBRadioGroup).Value) = 0 else if EditControl is TDBLookupComboBox then Result := length((EditControl as TDBLookupComboBox).Text) = 0 else if EditControl is TDBCheckBox then Result := (EditControl as TDBCheckBox).State = cbGrayed else KSMessage('control is not edit checked kslib', mtError, 0); if Result then Showerror(EditControl, EditMess, false, ShowErrorMsg); end; I guess I had also left out the final "else" clause in my original post--sorry about that, it's included here.
×