In my last post I talked about snapping windows to monitor halves and quadrants. I have been using that code for a few days and found it has a few shortcomings: If a window has size constraints, these will still be respected (which is good) but this will result in the window not being moved … Continue reading Snapping windows to monitor halves / quadrants revisited
Category: dzLib
New buildtools script PrepareForTranslation.cmd
In Using my buildtools I wrote that you must prepare your project for translation with dxgettext manually. No longer, there is now a script PrepareForTranslation.cmd that does it for you.
Using my buildtools
My buildtools for Delphi have been available on SourceForge for quite a while. I use them in all my projects, including - slightly modified - in GExperts. Just in case somebody else is interested, I'll outline how to use them in a project. Requirements First, your project has to follow the following structure: Project src … Continue reading Using my buildtools
Using the %TEMP% directory
Sometimes you need to temporarily create a file or even a directory to put some files into. Windows (and most other operating systems, even MS DOS) reserves a special directory for this purpose and helpfully provides API methods for getting this directory (or you could just use the %TEMP% environment variable but while that is … Continue reading Using the %TEMP% directory
Input validation in dzLib
In a recent Google+ post Andrea Raimondi was mentioning the JVCL's JvValidators components and asked whether we use/know them or not. Daniela Osterhagen mentioned that she preferred the input validation from my dzlib which led to a short discussion about how I implemented it. I added input validation functionality to dzlib because I didn't like … Continue reading Input validation in dzLib
Setting a default language with dxgettext
By default, if no translation for a language is available, dxgettext will not do any translation but use the strings as they are in the source code. Sometimes this is not desirable. e.g. Your customer does not understand the source language (e.g. your source language is not English but say German) You are using dxgettext … Continue reading Setting a default language with dxgettext
dzlib compiles with all Delphi versions from 2007 to XE6
Today I spent some time to make dzlib compile with all Delphi versions from 2007 to XE6 (XE7 to come later). It didn't take too long since it already supported 2007, XE2 and XE6. It's interesting to see, how the RTL evolved between these versions. Some examples: The IsWhitespace function started out as a class … Continue reading dzlib compiles with all Delphi versions from 2007 to XE6
Showing a dropdown menu when clicking a button
A rather common question on StackOverflow, the Delphi newsgroups and elsewhere is how to display a drop down menu when the user presses a button. There are many proposed solutions and even something built into newer versions of Delphi (Which doesn't work for me for some reason.) Here is mine (which is based on this … Continue reading Showing a dropdown menu when clicking a button
Translating Windows messages to strings
I could not find anything like this so I wrote it myself: This class translates most Windows message ids into their symbolic name. type TWmMessageToString = class function MsgToString(const _WmMsg: Cardinal): string; overload; function MsgToString(const _Msg: TMessage): string; overload; end; The names are taken from Delphi 2010's messages.pas Delphi 2010's controls.pas Wine It seems pretty … Continue reading Translating Windows messages to strings
Preventing a dialog from closing while autocomplete is active
In an older blog post I wrote about AutoComplete for TEdits using SHAutoComplete. I just actually tried to use that function in one of my applications and found that there is a quite annoying problem with it: If you have set the OK button's Default property to true (so it gets "clicked" when you press … Continue reading Preventing a dialog from closing while autocomplete is active