Leaderboard
Popular Content
Showing content with the highest reputation since 08/26/25 in Posts
-
Whilst there are many Delphi components for detecting changes to file system folders they suffer from serious limitations: typically they only allow you to monitor a single folder they do not support the monitoring of specific files they rely on the FindFirstChangeNotification API which gives no information about what has changed, requiring an inefficient search. I have created a new file system monitoring library that addresses the above limitations. Features: Easy to use, but also suitable for heavy duty monitoring Single unit with no external dependencies Allows monitoring folders and/or specific files Uses the ReadDirectoryChangesW API which provides information about what exactly was changed A single instance of the component can handle the monitoring of many folders and/or files Uses an I/O completion port for efficient handling of large numbers of requests A single thread handles all requests A different notification handler can be specified for each request You can have multiple handlers for each folder or file When you monitor folders you can specify whether you want to also monitor subfolders Installation: You do not need to install the library. Just download or clone the repo and add the source subdirectory to the Library path. Usage: procedure TForm1.FormCreate(Sender: TObject); begin // Create the IFileSystemMonitor interface FFileSystemMonitor := CreateFileSystemMonitor; // Monitor a directory FFileSystemMonitor.AddDirectory(TPath.GetTempPath, False, HandleChange); // Also monitor a specific file FFileSystemMonitor.AddFile('pathtoyourfile', HandleChange); end; procedure TForm1.HandleChange(Sender: TObject; const Path: string; ChangeType: TFileChangeType); begin with lvEventList.Items.Add do begin Caption := GetEnumName(TypeInfo(TFileChangeType), Integer(ChangeType)); SubItems.Add(Path); end; end; To stop monitoring a specific file or folder you use the following methods: function RemoveDirectory(const Directory: string; OnChange: TMonitorChangeHandler): Boolean; function RemoveFile(const FilePath: string; OnChange: TMonitorChangeHandler): Boolean;
-
Maybe this would be a good occasion to learn Git then... Here's a quick intro I made for someone else that wanted to contribute a change to Graphics32: On Github Create a Github account: https://github.com/signup Fork the Graphics32 repository to your own Github account. This gives you a copy, on your own Github account, of the main repository where you can push your changes. On your local system Clone your own Graphics32 repository to your local system using a Git client. I recommend the Fork git client: https://git-fork.com/ Create a branch in your local repository. Commit your changes to that branch. Push the branch to your own Graphics32 repository. On Github Create a pull request on your Graphics32 repository. Specify the master branch at the main Graphics32 repository as the target, and your branch at your repository as the source. When Github notifies me that you have submitted a pull request I'll review the changes. Once I accept the pull request, the changes are merged into the branch you specified as the target branch.
-
We have had these Delphi FMX guides available for a while, and I thought it could be useful to share them here: How to use Google Maps to determine the user's location in the Embarcadero Delphi FMX app: https://www.softacom.com/blog/how-to-use-google-maps-to-determine-the-users-location-via-embarcadero-delphi-fmx-app/ - shows how to access the user's coordinates and display them on a map. How to save and read data from Google Sheets in an Embarcadero Delphi FMX app: https://www.softacom.com/blog/development/how-to-save-and-read-data-from-google-sheets-in-an-embarcadero-delphi-fmx-app/ How to implement multi-touch in an Embarcadero Delphi FMX app: https://www.softacom.com/blog/development/how-to-add-multi-touch-to-an-embarcadero-delphi-fmx-app/ - shows how to add multi-touch drawing support How to use gestures in an Embarcadero Delphi FMX app: https://www.softacom.com/blog/development/how-to-use-gestures-in-embarcadero-delphi-fmx-app/ - shows how to handle swipe, zoom, and rotate gestures How to master FastReport in Delphi: https://www.softacom.com/blog/development/mastering-fastreport-in-delphi-dynamic-file-reporting-and-visualization/ – shows how to create dynamic reports and charts How to send email via an Embarcadero Delphi FMX app using the Gmail API: https://www.softacom.com/blog/development/sending-email-via-embarcadero-delphi-fmx-app-by-using-api/ How to generate images in an Embarcadero Delphi FMX app: https://www.softacom.com/blog/development/image-generation-capabilities-with-delphi-fmx-application-via-openai-api-dall·e-models/ - shows how to use OpenAI DALL·E for image generation
-
alternative to call parameter?
A.M. Hoornweg replied to pcoder's topic in Algorithms, Data Structures and Class Design
May I suggest "fluent interfaces" as an alternative to nested calls. Instead of using a record like a dumb data store that is only manipulated from the outside, you can put the methods that fiddle with the record's contents directly into the record itself and thus keep the code and the data closely together. Also, this enables one to use a so-called "fluent interface". Example: This is an example of a record that contains just one integer member, "data". In real life, you can make the record as complex as you want. type pMyrecord=^tMyRecord; tMyRecord=Record data:integer; Function Reset:pMyrecord; Function Add (x:integer):pMyrecord; Function Multiply (x:integer):pMyrecord; Function Divide (x:integer):pMyrecord; End; As you can see, all the methods in this record return a pointer, which simply points to the record itself. That is the "secret sauce" one needs to implement fluent interfaces. function tMyRecord.Add(x: integer): pMyrecord; begin data:=data+x; result:=@self; end; function tMyRecord.Divide(x: integer): pMyrecord; begin data:=data div x; result:=@self; end; function tMyRecord.Multiply(x: integer): pMyrecord; begin data:=data*x; result:=@self; end; function tMyRecord.Reset: pMyrecord; begin data:=0; result:=@self; end; Now the cool thing: All these methods can be concatenated and will be processed left-to-right. This produces very legible and compact code: procedure Test; var x:tmyrecord; begin x.reset.add(12).multiply(4).divide(2); end; (edit) Note that I didn't do a single heap allocation here, never manually passed the record as a parameter and never did a nested call. The data lives on the stack. If the record contains managed objects such as strings, these are disposed of automatically. -
C:\ProgramData\ICS-OpenSSL folder
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
I'll fix it next week, Angus -
FMX Frame always marked as modified when opened (RAD Studio 12.3)
Dave Nottage replied to dmitrybv's topic in Delphi IDE and APIs
It's not intended. -
Start Menu items missing for RAD Studio 12.3
Anders Melander replied to Remy Lebeau's topic in Delphi IDE and APIs
I think Microsoft has a whole division dedicated to coming up with ways to make the Start menu shittier for each new version of Windows. Windows 8 is still the champion though - Like that other version 8 which is best forgotten. -
MS SQL, How to make a TfdQuerry returns Date in a specific format?
weirdo12 replied to Squall_FF8's topic in Databases
Add a BeforePrint handler to the memo control. Make sure that you clear the DataField and DataSet properties of the memo control or BeforePrint won't have any effect.. procedure Memo13OnBeforePrint(Sender: TfrxComponent); begin TfrxMemoView(Sender).Text := FormatDateTime('yyyy-mm-dd', <Ticket."ticket_date">); end; No formatting: With the BeforePrint: -
You can't. The "global" solution to doing something that causes problems is to stop doing something that causes problems.
-
Fork the repository from the GitHUB, make changes and make pull request. Details really depends will you use commndline tool(s) or some GUI tool. I mainly use Theirs GitHUB Desktop https://desktop.github.com/download/ It is very simple on most operations, and this is why I kind of like it. -tee-
-
Polywick Studio - Delphi and C++ Builder developer.
PolywickStudio replied to PolywickStudio's topic in Job Opportunities / Coder for Hire
I'm based in Manila, Philippines. -
...unless you also monitor the parent directory. Maybe make the polling optional?
-
For the benefit of anyone reading this thread, the most powerful way to allow your python script to create instances of a Delphi class (e.g. TEntry) is to create a wrapper: type TEntryClassWrapper = class(TPyClassWrapper<TEntry>) constructor CreateWith(APythonType: TPythonType; args, kwds: PPyObject); overload; override; end; { TEntryClassWrapper } constructor TEntryClassWrapper.CreateWith(APythonType: TPythonType; args, kwds: PPyObject); var _obj : PPyObject; begin if GetPythonEngine.PyArg_ParseTuple( args, 'O:CreteWith',@_obj ) <> 0 then begin Create(APythonType); DelphiObject := TEntry.Create(GetPythonEngine.PyObjectAsString(_obj)); end; end; You need to register and initialize the wrapper in your Form.Create: procedure TForm1.FormCreate(Sender: TObject); begin PyDelphiWrapper1.RegisterDelphiWrapper(TEntryClassWrapper).Initialize; end; and then in python: from spam import * entry = Entry('Test') print(entry.Name()) entry = None The Delphi TEntry class is exposed as the python type Entry in your python code.
-
TEntry = class(TObject) strict private FstrName: string; FclsStringList: TStringList; public constructor Create(strName: string); destructor Destory; function Name: string; end; Destroy misspelled and not declared with override. If you fix this TEntry gets destroyed. But the better way is: function TManager.GetNewEntry: TEntry; begin Result := TEntry.Create('Test'); end; and in python from spam import * entry = manager.GetNewEntry() print(entry.Name()) entry.__owned__ = True entry = None Explanation: When P4D wraps the result of GetNewEntry it does not know who owns the return value. The default is that Delphi does. But the ownership can be changed in python using the __owned__ property.
-
Not without carefully checking what might breakdown before and why exactly you wanna do this. The way back is made a bit hard, by Apple, better be shure if you upgrade. Avoid also the Beta-Versions, which can cause much trouble too.
-
@Dave Nottage, thanks for the clarification. It's been the rule of thumb I've used for the little bits of Apple dev I've done but I didn't consider older versions of Delphi or CE.
-
This is not necessarily true given past experience, however it has been true for a while now. Having said that, even if you discover that your install of Delphi does not work with the latest version of Xcode, it is possible to revert to an earlier one. It should be borne in mind however that (at time of writing) App Store requires at least Xcode 16. Side note: those using Delphi CE will find that (at time of writing) it will not work with Xcode 16 unless you take special measures.
-
Issue with basic TCP server and ICS 9.4
TristanC replied to TristanC's topic in ICS - Internet Component Suite
Hello Angus, I might have finally found what the issue is. I have tried to reinstall the ICS suite, except that instead of taking the ICS-V9.4 download, I took the ICS-V9 Snapshot one. And after the installation, when trying to compile my project, I had an error that I never add before : [bcc32c Error] OverbyteIcsTypes.hpp(398): expected unqualified-id [bcc32c Error] OverbyteIcsTypes.hpp(399): expected unqualified-id [bcc32c Error] OverbyteIcsTypes.hpp(400): expected unqualified-id relative to this part of the OverbyteIcsTypes.hpp file And apparently, it is due to CF_ACCEPT, CF_REJECT and CF_DEFER being already defined in <winsock2.h> for the WSAAccept function : https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsaaccept I have then added a check to undefine these variables before they are defined in the cpp like this : It now compiles and when I connect a client I finally have the information of the client displayed on my server side. However, while working, I am not sure yet if my solution can cause other issues down the line. Is it on purpose that these variables where named similarly to the windows defined ones ? -
Polywick Studio - Delphi and C++ Builder developer.
Die Holländer replied to PolywickStudio's topic in Job Opportunities / Coder for Hire
polywickstudio.com -
Compiler directives for line number?
DelphiUdIT replied to PeterPanettone's topic in RTL and Delphi Object Pascal
With the same function you can get also the procedure name ' TForm1.Button1Click', instead to write it like a constant: GetLocationInfo(ReturnAddress).ProcedureName Think to use a temporary record and call GetLocationInfo only one time. -
EdgeAudio: real-time audio pipeline for Delphi/VCL with WebView2
Maxidonkey posted a topic in I made this
Hi all, I have just uploaded the project EdgeAudio integrate mic capture, audio playback, a high‑pass filter, VAD, hysteresis, and a “Talkover” mode from Delphi, orchestrated through a bidirectional JS bridge inside TEdgeBrowser. The architecture centers on TEdgeAudioControl and TAudioSettings, applied in real time on the WebAudio side, with clean VCL integration (virtual host, typed events). Key points Clear architecture: capture (TEdgeAudioCapture), playback (TEdgeAudioPlayer with VAD/Talkover), filtering (THighPassFilter), and a WebView2 bridge; TEdgeAudioControl exposes settings and ready‑to‑use events. Extensible event engine: aggregates/routes JSON events (audio_play, audio_pause, audio_segment, etc.) via TEventEngineManager and IAudioEventHandler. Capabilities: tunable VAD (threshold/silenceMs/timeslice), Talkover with cooldown/ratios to avoid “ping‑pong,” playback/streaming (play/pause/seek/stop), setSinkId, volume boost, built‑in notifications/animations, and optional auto‑blocking of capture during playback. Quick start Install the EdgeAudioDesign.dproj package to register TEdgeAudioControl in the Palette. Two paths: (1) already have TEdgeBrowser → use the Edge.Audio unit; (2) drop TEdgeAudioControl. Copy the web/tools folders into your project and place WebView2Loader.dll (x86/x64) next to the executable. Sample projects (AudioEdgeTest1/2.zip) are provided; add “EDGEAUDIO\SOURCE” (and “OPENAI\SOURCE”) to your project search paths. Dependencies: Delphi 12+, WebView2 Runtime, and ffmpeg if you need audio conversion (configurable ffmpegPath). Learn more Diagrams, event flow, and extension points are detailed in the “Dev note – Architecture & Mechanics” sections and the deep‑dive in the repo. Preview -
Can't print from Python script thread to Delphi main thread
Martybartfast replied to Martybartfast's topic in Python4Delphi
BTW for anyone else doing ThreadExecMode := emNewInterpreterOwnGIL; and using a module, do make sure in your module you set this property: MultInterpretersSupport := mmiPerInterpreterGIL; That cause me a bit of head scratching for a while! -
@Kas Ob. It is like having a conversation with an old pal who you know is an "embellisher" or "exaggerator". You never trust what he says and always suspect a lie being told. That is counter-productive. I would rather do the work myself. I use AI as a glorified search engine and still I doubt the answers it gives. And I absolutely hate the assumptions being provided as facts. Many times I see the AIs do that.
-
My preference would be similar, but I'd start with private const and end with private fields.
-
I've solved some of the issues with the font selector. The cursor now changes correctly. I'm quite happy with it now. The locking issue still happens but I discovered that this was not due to the number of fonts in the list but a particular font that is slow to render that I have installed (Surfing Capital). If I remove that font from the list then all is fine. I found that this font is also causing issues with the font selectors in other apps such as MS Paint, so it may not be worth doing anything about. FontSelector_v2.zip