Two buttons to make a difference in the Set Tab Order expert

 Delphi, GExperts  Comments Off on Two buttons to make a difference in the Set Tab Order expert
Nov 012018
 

The Set Tab Order expert in GExperts allows you to change the tab order of controls by dragging them in a tree view. I have always wondered why the standard Tab Order dialog of the IDE has got buttons to move the current control up or down while the one in GExperts does not.

OK, now it has them too:

These buttons even have keyboard shortcuts: Ctrl+Up moves the current item up, Ctrl+Down moves it down.

I’m thinking about further improvements for that expert, but nothing concrete yet. I kind of like the approach that the CnPack IDE wizards take, but on the other hand too much automation can be bad too. What if I want to have a button on the lower left to be the last control in the tab order? Like an “About” button, which in my opinion should not be between the last input field and the OK button because I rarely click it?

New GExperts Feature: Favorites menu

 Delphi, GExperts  Comments Off on New GExperts Feature: Favorites menu
Oct 272018
 

I have stolen yet another idea for a new GExperts feature, this time from Dave Nottage‘s Codex Delphi Expert. (But the code is all mine, including any bugs you might experience.)

It’s the Favorites sub menu in the File menu:

The content of this sub menu is generated on the fly, so it will always contain the current entries of the Favorite Files Expert. Since that expert’s dialog is non modal, you can change the configuration and immediately see that the Favorites sub menu content changes. All entries are prefixed with numbers 0-9 and then letters A-T, so there is a maximum of 10+20=30 entries on each level. In addition there is X for Configure which opens the Expert’s configuration dialog:

Unfortunately this new feature will only be available for Delphi 7 and later. I was unable to get it to work in Delphi 6. Sorry about that! But maybe somebody else wants to try it? The source code is here.

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

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.

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.

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.

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.

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.

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?

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!