Leaderboard
Popular Content
Showing content with the highest reputation on 02/03/25 in Posts
-
How do I close a modal form without ModalResult being set to mrCancel ?
Lajos Juhász replied to dormky's topic in VCL
Delphi in order to survive must ASAP include the method to close a modalForm or we will die. As a Quick Fix they should include the class helper for all the existing versions: type TFormHelper = class helper for TCustomForm public procedure EndDialog(PModulResult: TModalResult); end; { TFormHelper } procedure TFormHelper.EndDialog(PModulResult: TModalResult); begin modalResult:=PModulResult; end; I can only hope that somebody from Embarcadero will read this thread and will push these changes directly to the TForm not to require a class helper for such an important issue to be fixed. (For years I was using the modalResult to close modal forms without a single issue. This thread made me realize that Delphi is dying because it does not have such a method.) -
https://docwiki.embarcadero.com/RADStudio/Athens/en/Using_SQLite_with_FireDAC#Adjusting_FireDAC_Mapping
-
Blogged : Code Signing with Inno Setup and Signotaur
Vincent Parrett posted a topic in Delphi Third-Party
https://www.finalbuilder.com/resources/blogs/code-signing-with-inno-setup-and-signotaur -
Loading a JPEG into FMX.TBitmap honoring EXIF orientation
Anders Melander replied to Alexander Halser's topic in FMX
Definitely. I'm not denying that it's a problem. I'm just saying that the problem isn't that it doesn't rotate automatically (because that would also be a problem). The problem is that it doesn't give us any way of knowing that the image needs to be rotated be display. You should probably report it as a bug against FMX. -
Loading a JPEG into FMX.TBitmap honoring EXIF orientation
Alexander Halser replied to Alexander Halser's topic in FMX
I wonder if anyone is interested in a solution... 😉 Just in case you are, here is what I did. Neither FMX nor VCL will honor the orientation information in the EXIF header inside the JPEG. For FMX: neither on Windows nor on macOS. And probably not on iOS, either. For Android and Linus, you need to test for yourself, maybe they do. The only solution is to read the EXIF header, extract the Orientation tag and apply the necessary transformations to the image after loading. There are several components for Delphi to read EXIF headers, some do work, some don't. The best known unit is CCR-Exif (https://github.com/Wolfcast/ccr-exif), which does everything and works quite well. It can read and write EXIF tags. I've created my own, because CCR-Exif seems like overkill (after all, I just want to know 1 single byte in the JPEG) If you want to display JPEG images correctly in your FMX application, I have published my little unit on SourceForge, It's as small and fast as possible with really minimal overhead. The first function JPEGRotationFromStream() will work for VCL as well! So you can adapt it and use it for your VCL app, too. But FMX has this nice little class called TBitmapSurface, which easily does the Rotate, Mirror and Flip transformations that are required to display the JPEG correctly. So, for FMX this unit goes the full length and delivers a TBitmap that's just right. The unit might be useful for VCL as well, but you have to go an extra mile to apply the transformations. SourceForge Download: https://sourceforge.net/projects/delphi-fmx-jpeg-loader-exif/ -
How can to set up an umbrella unit?
Anders Melander replied to araujoarthur's topic in RTL and Delphi Object Pascal
Not directly; Delphi unfortunately doesn't support "wildcard" includes like that. The way I do it, for something like dialogs, is to associate each dialog with an interface and then separate the implementation of the dialog from the interface: unit Foo.Dialogs.Bar.API; type IFooDialogBar = interface ['{4279694B-C3D6-4B2A-A134-CEACDF6185AF}'] function Execute: boolean; end; unit Foo.Dialogs.Bar; interface uses Forms, Foo.Dialogs.Bar.API; type TFormFooBar = class(TForm, IFooDialogBar) // ...other stuff here... private // IFooDialogBar function Execute: boolean; end; implementation function TFormFooBar.Execute: boolean; begin Result := (ShowModal = mrOK); end; In order to create the dialog you could use a factory function like Peter suggested: function FooDialogBar: IFooDialogBar; begin Result := TFormFooBar.Create(nil); end; You will then have to manage the lifetime of the dialog somehow. Since you are accessing the dialog object via an interface you can't just free it once you are done with it. It will have to be done via reference counting. Unfortunately the default TComponent reference counting will not do it so it will have to be modified (overridden). I have a dialog manager that takes care of all this without the need to modify anything. It handles both modal and non-modal dialogs. I'm in the process of adding it to the translation manager project, so the code it will probably be public later tonight or tomorrow. The dialog manager is used like this: // Register the dialog API in the initialization section of the disloag unit initialization DialogManager.RegisterDialogClass(IFooDialogBar, TFormFooBar); end; ... // Create dialog var DialogBar := DialogManager.CreateDialog(IFooDialogBar) as IFooDialogBar; // Display dialog if (DialogBar.Execute) then begin ... end; // Lifetime is controlled via reference counting. // When interface goes out of scope, the dialog object is destroyed. ... -
How can to set up an umbrella unit?
PeterBelow replied to araujoarthur's topic in RTL and Delphi Object Pascal
I assume Forms.Dialogs.pas is a unit not defining a form build in the form designer? In this case I would export functions from that unit that internally create and show(modal) one of the specific form classes, setting any needed setup values from parameters passed to said functions and returning any data entered/selected by the user as function result or in var or out parameters. This way other units need not require the specific form class units in their uses clause, only Forms.Dialogs. Note that the dialog forms would not be autocreated in this setup, the exported functions would all create, show, and then free a new instance of their dialog form. -
how to set delphi android app's idsig file, why my app can not be installed?
tomye replied to tomye's topic in Cross-platform
thank you , help me a lot 🙂 -
How do I close a modal form without ModalResult being set to mrCancel ?
Die Holländer replied to dormky's topic in VCL
I think a language where you can close a modal form without-modalresult being set to mrcancel.. -
Maybe. The problem I have is that LSP chokes on code that a build doesn't struggle with. Even with no compiler errors or warnings, LSP crashes, and simple functionality like Ctrl+Click for symbol definition just doesn't work. I can do a clean build with no warnings, then I try to find the symbol declaration for a class, and the IDE goes brain dead. Then sometimes, if I type Ctrl+G instead, it might work, but usually still nothing. Maybe it's the same, but if so, I can only imagine they are ignoring the project settings for what's actually loaded into the IDE. My expectation, unreasonable as it may be, is that if my code compiles when I hit F9, the IDE should not act like a dear in headlights when I try to use it.
-
I am designing a new media player UI and have been documenting my work, posting about programming and UI design in laymen terms on reddit. Recently, I posted about basic UI code optimization logic and thought it may be interesting for novice programmers. Since the post is simplified for non-programmers, I'll share here that I'm using WinAPI's layered windows and GDI+ to render the anti-aliased text and bar-shapes, preserving the alpha channel.
-
🚀 Explore My GitHub Projects! 🌟 Check out my current GitHub tools and libraries I’ve been working on! 🎮 JetInfero Local LLM Inference Library 🎨 Aurora Game Toolkit Advanced Game Development Toolkit 📦 JetZip Zip It Fast, Zip It Easy! 🤖 Lumina Local Generative AI Toolkit 🔥 Pyro Pyro Game Library for Delphi 🛠 CPas Static C Libraries for Delphi 📀 PSFML SFML for Pascal Developers 🧠 MemoryDLL In-Memory DLL Loading & Execution for Pascal 🕹 DSDL SDL for Delphi Developers 🌕 Callisto Lua Scripting for Delphi 📜 CScript C99 Scripting Engine