OK, here it comes, the ultimate bugfix for the FileCtrl.SelectDirectory function. 😉 I blogged about it before: The SelectDirectory function in Delphi's FileCtrl unit has several bugs. My first approach on fixing these, while working, was ugly because the user could see that the dialog position changed after it was shown initially at a different … Continue reading The ultimate bugfix for SelectDirectory
Author: dummzeuch
Fixing the SelectDirectory fix
In my last blog post I wrote My bugfix isn’t pretty, I must admit. It just defers these changes until the dialog is fully visible. This has the disadvantage the the user will see it popping up at the wrong place first before its position is corrected and the selected directory becomes visible. David Millington … Continue reading Fixing the SelectDirectory fix
Fixing the SelectDirectory function
The Delphi VCL comes with several overloaded SelectDirectory functions declared in FileCtrl, one of which uses the ShBrowseForFolder Windows API function. It passes a callback function which tries to do the following: Position the dialog on the monitor on which the application's main form is shown. Center the dialog on that monitor Select the given … Continue reading Fixing the SelectDirectory function
Why blank lines matter
This had me puzzled for a minute: [delphi] program CodeLibrarian; {$R *.res} uses GX_VerDepConst in '..\..\Framework\GX_VerDepConst.pas'; procedure ShowCodeLib; external GExpertsDll; begin ShowCodeLib; end. [/delphi] This is all the code there is to the stand alone Code Librarian tool that comes with GExperts. Then it dawned me. It's much easier to understand if you add a … Continue reading Why blank lines matter
Enhancement for the Sort editor expert
One of the editor experts in GExperts that come in handy once in a while is the Sort Expert. All it does is take the selected lines and sort them alphabetically. Now, it can sort ascending, as before, descending (not sure when you might want to do that, but since I was at it, why … Continue reading Enhancement for the Sort editor expert
FixInsight vs. GExperts
Roman Yankovsky has been so kind to donate a FixInsight license to my open source projects, in particular to GExperts. And since he just blogged about running FixInsight against the latest FMX I did the same with GExperts. The result is not too bad actually. All included there are 235 warnings, optimization and convention messages. … Continue reading FixInsight vs. GExperts
Enabling a form while another form is being shown modally
There was one shortcoming in my Delphi IDE explorer that has irked me since the beginning: It was disabled while a modal dialog was shown in the IDE, so there was no way to inspect the controls on the current dialog. The option to follow the focus ameliorated this a bit because it was now … Continue reading Enabling a form while another form is being shown modally
Do not enumerate on TTreeNode.Item
Note to self: Do not enumerate on TTreeNode.Item, it's highly inefficient. Consider this code: [delphi] procedure SelectFocusedControl(_ActCtrl: TWinControl; _Parent: TTreeNode); var j: Integer; CtrlItem: TTreeNode; begin for j := 0 to _Parent.Count - 1 do begin CtrlItem := _Parent.Item[j]; if CtrlItem.Data = _ActCtrl then begin CtrlItem.Selected := true; break; end else SelectFocusedControl(_ActCtrl, CtrlItem); end; end; … Continue reading Do not enumerate on TTreeNode.Item
More enhancements for the search path dialog
After I found and fixed the problem with the Grep results dialog I returned to enhancing the search path dialog. Last time I added an option to replace the ListBox on that dialog with a Memo. Many people liked that change but of course, people being people, they started to complain about missing features. In … Continue reading More enhancements for the search path dialog
Safe event hooking for Delphi IDE plugins revisited
A while ago I blogged about Safe event hooking for Delphi IDE plugins. I have used this method in GExperts as well as my Delphi IDE Explorer and it worked fine for both plugins. Today I looked at the code again and didn't like it very much. Yes, it works fine and there aren't any … Continue reading Safe event hooking for Delphi IDE plugins revisited