4 years ago I wrote a helper class TdzSpeedBitBtn which turns a TBitBtn into a TSpeedButton that can have the focus. That helper class has also been used in GExperts (in the Uses Clause Manager and Rename Components). It worked fine until Delphi 11 introduced per monitor DPI awareness. Then it still worked but the … Continue reading TdzSpeedBitBtn updated to support scaling
Category: dzLib
When computers try to be clever
Don't you just hate it when computers try to be clever but get it wrong? OK, it's not really the computer itself but the programmer who tried to be clever. The problem usually is that he overlooked a corner case that you then hit where his sophisticated strategy fails and leaves you with something - … Continue reading When computers try to be clever
TCsvWriter added to dzlib
Yes, I know, there are many already existing solutions for writing a CSV file in Delphi. And some are probably better than mine (for general purpose usage), but those I looked at had too many shortcomings for my particular use case, so I wrote my own. (There might also have been some not invented here … Continue reading TCsvWriter added to dzlib
Setting the drop down width of a Combobox in Delphi
By default, the width of the drop down list of a TComboBox is the same as the width of the control itself, and even in the latest Delphi version there apparently is no property to set it. Why is that so? Good question. There are probably many third party controls that offer this because it … Continue reading Setting the drop down width of a Combobox in Delphi
Autocompletion for TEdits revisited
I wrote about autocompletion for TEdits before here and here. Back then I was using the SHAutoComplete API function in the Shlwapi.dll because I am a lazy basterd™. That hasn't changed really but I also love fiddling with stuff, so some years ago, I actually added directory and general string completion to dzlib (and apparently … Continue reading Autocompletion for TEdits revisited
Fake TSpeedButton based on a TBitBtn – updated
I have made a few changes to the code in Fake TSpeedButton based on a TBitBtn: I replaced all that line drawing with a call to the WinAPI function DrawEdge. I set both bitmaps to Transparent. I moved the bitmap generation to a sub procedure. Thus I got rid of about 20 LOC. That's negative … Continue reading Fake TSpeedButton based on a TBitBtn – updated
TdzStreamCache class for caching access to any TStream
You might have noticed that I haven't blogged as much as usual and that there have been no recent updates to GExperts either. The reason of course was that I was busy doing other things. Some of them were programming related and one of these was writing a caching class wrapper for TStream descendants (e.g. … Continue reading TdzStreamCache class for caching access to any TStream
Bugfix for the Build Connection String dialog appearing on the wrong monitor
According to MSDN the window handle passed to IDBPromptInitialize::PromptDataSource will be used this way: hWndParent [in] The parent window handle for dialog boxes to be displayed. The dialog box will always be centred within this window. Unfortunately it doesn't work like this: If the parent form is on a secondary monitor the dialog is shown … Continue reading Bugfix for the Build Connection String dialog appearing on the wrong monitor
“Hooking” KeyDown in a Firemonkey form
As said in my last post: " The hard part is hooking the form in a way so all I need to do is call TForm_ActivatePositioning as in the VCL." As it turns out, that's even easier to do than in the VCL. No subclassing of the window, just adding a new control is sufficient. … Continue reading “Hooking” KeyDown in a Firemonkey form
Snapping a Firemonkey window to monitor halves / quadrants
I always wanted to start playing with Firemonkey but so far just didn't find the right project. This is my first try to port a VCL utility function to Firemonkey. Note that this will probably not work on all platforms. It's tested on Windows only. So, how do we get the code from my last … Continue reading Snapping a Firemonkey window to monitor halves / quadrants