The State of the GExperts Mailing list and G+ Community

 Delphi, GExperts  Comments Off on The State of the GExperts Mailing list and G+ Community
Oct 262018

You might have heard that Google is “sunsetting” Google+ so the GExperts community there will no longer exist after August 2019.

There is still the GExperts Mailing List on Yahoo, but unfortunately either Google Mail or Yahoo changed something so I am no longer able to post to it (I get a rather unhelpful error message.)

So I have asked Daniel, the administrator of Delphi Praxis whether I can get a GExperts sub forum in the new English Delphi Praxis.

I haven’t received an answer yet, but I hope it will be positive. If yes, I will announce it here and as soon as that sub forum goes live.

As for my general Google+ activity, I have not yet decided what to do. Currently it looks likely that I won’t migrate to any other “social media” site at all. I definitely won’t go to Facebook.

 Posted by on 2018-10-26 at 16:50

GExperts Enhancements for docking in the Delphi IDE

 Delphi, GExperts  Comments Off on GExperts Enhancements for docking in the Delphi IDE
Sep 022018

The Delphi IDE has supported docking of various forms for a long time (I don’t remember if it ever did not). Unfortunately if not docked, the floating forms always seem to be in the way, and if you dock them, they take up screen space that you might rather use for the editor window. Given that most of us have got more than one monitor, wouldn’t it be nice to move some of these docking forms to the second monitor?

You can already do that by just undocking one form and docking other forms to it. The resulting floating window can be moved freely, even to another monitor. What you can’t do with it is minimize it or use WIN+Arrow Keys to snap them to the left or right monitor edge.

There are now two enhancements in GExperts that address this:

The first one is the new IDE enhancement “Enhance Dock Forms to allow minimize and Win+arrow positioning” which can be enabled on the IDE tab of the configuration dialog.

Once set, those floating forms get a minimize button (which of course works) and can be moved to the left or right half of the monitor with Win-Left or Win-Right arrow keys. The usual mouse gestures you can do with any window are also available.

Unfortunately this only works if more than one form have been docked together, so a single floating form will not show these enhancements.

The second enhancement is the new “Add dock window” expert. It creates a new top level window to which any docking form can be docked. It too allows all the usual Windows shortcuts for placing and moving forms. In addition it has got a button on the taskbar so you can minimize it and restore it easily. It can also be put behind the IDE main window or on a different monitor. The taskbar button makes it easy to bring it back.

You can even have multiple of these GExperts dock windows.

Unfortunately they have some drawbacks too:

  • You cannot close them as long as anything is docked to them. I tried to allow that but it crashed the IDE. To really get rid of the window, undock all docked forms from it and then close it.
  • Also, if you dock only a single form to it, you won’t get a caption for it to move it elsewhere. Tip: Disable docking using its context menu (which will make it float) and enable it again. Alternatively select one of your saved desktop layouts or restart the IDE.
  • There is no option to save the currently docked forms and their layout yet.

I’ll try to address these problems in a later version.

Both enhancements work for all supported Delphi IDEs, btw.

There is no release with these features yet. To get them, for now you have to compile your own GExperts dll which isn’t exactly rocket science anyway.

This idea is based on a question by Codehunter on the German Delphi board Delphi Praxis.

 Posted by on 2018-09-02 at 12:21

Using escape characters in GExperts Grep replace

 Delphi, GExperts  Comments Off on Using escape characters in GExperts Grep replace
Aug 262018

If you enable regular expressions in the GExperts Grep search form, you can search for escape sequences like \t which is expanded to a tab character or \x20 which is expanded to char($20), the space character.

Up to now it was not possible to use \t (and similar escape sequences) in the Grep replace dialog. They were not expanded properly but the \ was treated as escaping the character following it, meaning \t was replaced by a simple t character.

I changed that, so now the same escape characters that are allowed in the search expression are also allowed in the replace expression. Note though, that \x{nnnn} for Unicode characters is not supported, maybe I’ll add that later.)

This solves Bug #82.

I also removed the restriction, that you could not search for space character(s). (Bug #81)

A word of warning:
Please keep in mind, that the Grep Replace functionality is still pretty much experimental. It replaces literal characters, so it is probably not a good idea to replace ‘\r\n’ with “\n” only, it will break the editor. Also, be very careful with replacing matches in all files. It might completely destroy your source code as it also replaces matches in the dpr file and dfm files (I had to revert the full project using SubVersion the first time I tried it. I lost all my not committed changes because of that. You learn from your mistakes, especially when they hurt you like this.)

There is no release with this functionality yet, but you can always compile your own dll.

 Posted by on 2018-08-26 at 12:40

GNUGetText support for the GExperts Message Dialog expert

 Delphi, GExperts  Comments Off on GNUGetText support for the GExperts Message Dialog expert
Aug 182018

Based on an idea and partial implementation submitted by Sven Harazim from Landrix Software I have just added support for GNUGetText to the GExperts Message Dialog expert. It now looks like this:

And generates Code like this:

MessageDlg(_('first line'+#13#10+'second line'), mtWarning, [mbOK], 0);

Or, if you’d rather use the Windows API:

which generates code like this:

MessageBox(0, PChar(_('first line'+#13#10+'second line')), PChar(_('The Caption')), MB_ICONWARNING or MB_OK);

There are even two new configuration options:

Depending on the settings the code could look like any of this:

MessageDlg(_('first line'+#13#10+'second line'), mtWarning, [mbOK], 0);
MessageDlg(GetText('first line'+#13#10+'second line'), mtWarning, [mbOK], 0);
MessageDlg(_('first line')+#13#10+_('second line'), mtWarning, [mbOK], 0);
MessageDlg(GetText('first line')+#13#10+GetText('second line'), mtWarning, [mbOK], 0);

or this:

MessageBox(0, PChar(GetText('first line')+#13#10+GetText('second line')), PChar(GetText('The Caption')), MB_ICONWARNING or MB_OK);
MessageBox(0, PChar(_('first line')+#13#10+_('second line')), PChar(_('The Caption')), MB_ICONWARNING or MB_OK);
MessageBox(0, PChar(_('first line'+#13#10+'second line')), PChar(_('The Caption')), MB_ICONWARNING or MB_OK);
MessageBox(0, PChar(GetText('first line'+#13#10+'second line')), PChar(GetText('The Caption')), MB_ICONWARNING or MB_OK);

It also generates code for C++, but I have no idea whether it works:

MessageDlg(GetText("first line\nsecond line"), mtWarning, TMsgDlgButtons() << mbOK, 0);
MessageBox(0, GetText("first line\nsecond line"), GetText("The Caption"), MB_ICONWARNING|MB_OK);

I hope it will be useful for some. I myself don't use that expert at all.

There is no release with this feature yet. If you want to use it, you will have to compile your own DLL.

 Posted by on 2018-08-18 at 16:52

GExperts 1.3.11 experimental twm 2018-08-05 released

 Delphi, GExperts  Comments Off on GExperts 1.3.11 experimental twm 2018-08-05 released
Aug 052018

After the massive improvement to the Uses Clause Manager it’s time for another GExperts release.

New features include:

New features include:

There were also several bug fixes.

Please be aware that I mostly work with Delphi 2007, so this version can be regarded as tested quite well, followed by Delphi XE2. The others are only known to compile and new features are usually tested superficially with all versions. This is particularly true for Delphi 6/7 and 2005/2006.

Head over to the Experimental GExperts page to download the latest release.

 Posted by on 2018-08-05 at 12:15

Broken download links for GExperts 1.3.10

 Delphi, GExperts  Comments Off on Broken download links for GExperts 1.3.10
Aug 052018

No idea why nobody told me about this, but today I discovered that the download links for the GExperts 1.3.10 installers were broken due to a superfluous dash in the date part. It’s fixed now. I could have sworn that I tested those links when I released that version.

But before you now go to that download page: I have just released GExperts 1.3.11. Maybe you would prefer that one instead?

 Posted by on 2018-08-05 at 12:01

Improved Uses Clause Manager in GExperts

 Delphi, GExperts  Comments Off on Improved Uses Clause Manager in GExperts
Aug 042018

The Uses Clause Manager Expert in GExperts used to look like this:

While it was a very useful tool as it was, I have added to it quite a lot in the recent weeks:

Let’s start with the simple changes:

Interface and Implementation uses clauses are now visible at the same time. This allowed me to add buttons to delete from each and to move from one to the other. These Buttons also have corresponding popup menu entries and keyboard shortcuts that depend on the context:

  • Del always deletes from the currently focused list. This is also the default action executed with a double click (Actually it has always been the default action.).
  • Ctrl+M moves from the current list to the other
  • Ins adds the currently selected unit(s) to the favorite units list (also works in the Sarch Path, Project and VCL/RTL lists).
  • Ctrl+O opens the currently selected unit in the editor and closes the dialog
  • In addition to drag and drop from the available units lists to the uses lists it’s now also possible to drag and drop entries between the two uses lists.

There are also buttons to add or remove the dotted unit prefixes, e.g. they convert “Registry” to “System.Win.Registry” and vice versa.

Then there is an Open Unit button which can be used to open the currently selected unit in all lists.

Also, there is a new button to add all units from a list to the Favorite list. This list has become more important than it used to be, see below.

And last but not least there is a context menu entry to unalias all units. This means that it will replace units like WinTypes and WinProcs which have been declared as aliases to Windows for ages with their actual unit. The same goes for dbiTypes, dbiProcs and dbiErrs which will be replaced with BDE.

I have also replaced the ListViews with StringLists which makes the display much faster for large lists (see below) and allows me to distinguish between the currently selected item(s) in each list (dark gray) and the currently focused control (blue).

And now to the huge change:

It’s a new tab with a list of all identifiers that are declared in the interface sections of all units in your favorite list. Similar to the already existing filter for unit names it allows to filter for identifiers. In the screen shot, I typed “TWinControl” and the list was filtered down to just 7 of the several thousand entries. This is a replacement for the IDE feature Refactor -> Find Unit, but in contrast to that feature, it works (Find Unit fails for me in about 30% of all calls.). And of course it also works for the old IDEs which did not have that feature.

Btw.: Did you known that you can scroll within the lists while the focus in on the filter edit?

I plan to make a new release including these features later this weekend. So stay tuned!

 Posted by on 2018-08-04 at 15:25

Improved keyboard navigation in the GExperts configuration dialog

 Delphi, GExperts  Comments Off on Improved keyboard navigation in the GExperts configuration dialog
Jul 222018

The GExperts configuration dialog, while I like the general look, has always been a keyboard navigation nightmare for me.

Assume you want to change the configuration of the Formatter Expert:

You first open the configuration dialog pressing Ctrl+H + X. Then you press Ctrl+Tab to switch to the Editor Experts tab. You type “form” which filters the list of experts to only display the “Code Formatter” and “Add To Formatter Capitalization” entries. So far, so good. Now, how to press the “Configure” button? You could of course now press Tab nine times until the focus has moved to the “Configure” button and press enter, but who wants to do that? I certainly don’t, so I usually resorted to using the mouse.

This has irked me for quite a while because I am more a keyboard person. So, today I added two functions that solve the issue for me:

First, you can now scroll the expert list using the up/down arrow and page up/down keys while the focus is on the filter control.

Second, when scrolling (or filtering) the list, the configuration button of first visible expert now automatically gets the Alt+C hotkey.

So, in order to open the Formatter Expert’s configuration dialog, you simple press Alt+C after you filtered the list. Much more to my liking!

 Posted by on 2018-07-22 at 19:26

Selecting alignment and anchors in the Rename Components expert

 Delphi, GExperts  Comments Off on Selecting alignment and anchors in the Rename Components expert
Jul 212018

A few weeks ago I added the option to set the alignment and anchors properties for controls that support them to the GExperts Rename Component expert. After having used it for a while I found that the navigation using arrow keys left something to desire. It just wasn’t intuitive, e.g.: Pressing the down arrow key while the “Top” button had the focus moved the focus to the “Left” button. Pressing down again moved it to the “Client” button and again to the “Right” button.

The intuitive way would be that the up arrow key moves the focus to the control above the current one, the down arrow key move the focus to the control below the current one etc., like this:

So, how do you get the dialog to behave like this?

My first try was to write OnKeyDown handlers for the buttons, but that didn’t work, the handlers were never called. The second try was an OnKeyDown handler for the form and setting its KeyPreview property to true. Again, this didn’t work, the handler was never called. WTF?

Some googling turned up this question on StackOverflow and an answer that worked for me: Adding a DialogKey message handler to the form. (Thanks Sertak Kyuz”! I always appreciate it when somebody supports my lazyiness.). So I added the following code to GX_CompRename:

procedure TfmCompRename.DialogKey(var Msg: TWMKey);
  // make the selection of alignment and anchors via arrow keys more intuitive
  case Msg.CharCode of
    VK_DOWN: begin
        if ActiveControl = b_AlignTop then
        else if (ActiveControl = b_AlignClient) or (ActiveControl = b_AlignLeft) or (ActiveControl = b_AlignRight) then
        else if (ActiveControl = b_AnchorTop) or (ActiveControl = b_AnchorLeft) or (ActiveControl = b_AnchorRight) then
    VK_UP: begin
        if ActiveControl = b_AlignBottom then
        else if (ActiveControl = b_AlignClient) or (ActiveControl = b_AlignLeft) or (ActiveControl = b_AlignRight) then
        else if (ActiveControl = b_AlignNone) or (ActiveControl = b_AlignCustom)then
        else if (ActiveControl = b_AnchorBottom) or (ActiveControl = b_AnchorLeft) or (ActiveControl = b_AnchorRight) then
    VK_RIGHT: begin
        if ActiveControl = b_AlignLeft then
        else if ActiveControl = b_AlignClient then
        else if (ActiveControl = b_AnchorTop) or (ActiveControl = b_AnchorBottom) or (ActiveControl = b_AnchorLeft) then
    VK_LEFT: begin
        if ActiveControl = b_AlignRight then
        else if ActiveControl = b_AlignClient then
        else if (ActiveControl = b_AnchorTop) or (ActiveControl = b_AnchorBottom) or (ActiveControl = b_AnchorRight) then

Now it works as shown in the picture.

It’s a small improvement, but one that makes me a bit more efficient. It took me about 2 hours to implement and test properly. So, according to XKCD it’s time well spent: I definitely use it more that 5 times a day, so spending 2 hours to save one second is fine. It saves those two hours across five years. And since I am not the only one using GExperts I hope I have saved a lot more than those two hours.

Speaking about saving time: Did you know that you can configure the Rename Components expert to automatically pop up for new controls when you drop them on a form?

 Posted by on 2018-07-21 at 12:00

Experimental GExperts feature: Automatically close Messages window

 Delphi, GExperts  Comments Off on Experimental GExperts feature: Automatically close Messages window
Jul 012018

You might have become used to it, but probably every Delphi developer has at one time wondered why the Messages window is still visible (and takes up valuable screen real estate) even if it is empty. And even worse, if you close it manually, it automatically comes back when you compile your project.

I too, had become used to it, but got reminded of this nuisance by a recent post from Graeme Geldenhuys on Google+:

How to auto close Message View window on successful compilation.
This was asked for in Delphi 7, but it seems with Delphi XE3 (what I’m using) it’s still not possible. Anybody know of a 3rd party add-in or hidden Delphi setting that will close the Message View after a successful compilation?

If I save my “desktop environment” while the Message View window is closed, then compile it doesn’t display the Message View – if no errors occurred. If a error occurs, then the Message View automatically appears. After I fixed the compilation error and recompile, the Message View stays there and doesn’t close. At this point I want it to close automatically. It is so damn annoying. I need all the screen (editor) space I can get, and the always visible Message View is taking up vital space.

Any known solution for this? Once again, Lazarus IDE does this perfectly.

As far as I know, there is no solution, neither in the Delphi IDE itself nor in any plugin I am aware of. (Update: There actually is one) Until today that is: I have just committed a change to the GExperts repository with the following description:

new IDE enhancement: Automatically close message window (if no errors, warnings or hints)

It is, like most IDE enhancements in GExperts, a hack. It works by hooking the Progress window and when it closes, checks whether there were any hints, warnings or errors. If there are none, it starts a timer that will wait for 1000 ms and then search and close the Messages window.

It works for me, your mileage may vary, of course. If you want to test it, for now you have to compile your own GExperts DLL. Don’t forget to actually enable that option on the IDE page of the configuration dialog!

 Posted by on 2018-07-01 at 14:05