Added Flattr for donations

 blog  Comments Off on Added Flattr for donations
Jan 222017
 

Just in case you want to show your appreciation for my blog posts, my open source tools and libraries and my contributions to other tools and libraries, now you can: I have created a profile at Flattr and embedded a button in my blog.

For now, this is mostly a test to see whether it actually works as described, but feel free to “flattr” me anyway.

Note: I deleted that account today, 2017-10-21 due to flattr changing their terms and condtions.

 Posted by on 2017-01-22 at 14:36

Reading and writing Esri shapefiles in Delphi

 Delphi, GIS  Comments Off on Reading and writing Esri shapefiles in Delphi
Jan 212017
 

Esri Shapefile is a popular file format in geographic information systems (GIS). Probably because the format has been extensively documented (whitepaper in PDF format).

In my day job at a company that does road condition surveys I work with quite a lot of data in shapefile format, so in order to read and write them I wrote two Delphi units. These units have been in existence for quite a while but until recently they could only process rather basic file types with points and polylines. After having the need to process additional types, I have updated (and bugfixed) them, so they now can read the following shape types:

  • Point, PointZ, PointM
  • Polygon, PolygonZ, PolygonM
  • Polyline, PolylineZ, PolylineM
  • MultiPoint, MultiPointZ, MultiPointM

Please note that they only accesses the .shp file, not the accompanying .dbf, .proj, .shx and other files. The .dbf files are simply dbase files, so you could use e.g. tdbf for them (But check the tdbf license!). The .proj files are text.

The writer is more basic yet, it can only write Point shapes.

Both are part of dzlib, my general purpose library, and available under the Mozilla Public License from the svn repository on SourceForge:

 Posted by on 2017-01-21 at 14:12

dzEditorLineEndsFix 1.0.3 released

 Delphi, Windows, Windows 8.1  Comments Off on dzEditorLineEndsFix 1.0.3 released
Jan 212017
 

I have released a new version of my dzEditorLineEndsFix tool for Delphi 2006 to 2010. There is only one change: I removed the balloon hint it used to show at startup. It started to annoy the hell out of me (and I’m probably not the only one).

The tool also now has its own page on this blog.

 Posted by on 2017-01-21 at 13:11

Enable Hibernate on Windows 8.x

 Windows, Windows 8.1  Comments Off on Enable Hibernate on Windows 8.x
Jan 202017
 

Note to self:

If Hibernate is not available on the shutdown menu and doesn’t show up in the configuration either, it can be enabled via the command line:

powercfg -h on
 Posted by on 2017-01-20 at 19:14

GExperts 1.38 experimental twm 2017-01-15 released

 Delphi, GExperts  Comments Off on GExperts 1.38 experimental twm 2017-01-15 released
Jan 152017
 

I has been a while since my last experimental GExperts release. Erik still hasn’t managed to do the final official release and I don’t want to wait any longer. I have created installers for all supported Delphi versions.

New features include:

There was also a fix for a nasty bug in the code formatter.

Did I ever blog about using the .MAP file for the Uses Clause Manager and Open File Expert? This was also added in this version (with using it in grep on the todo list). Also, did I ever mention the new Editor Experts: WARN directive and IF Directive? I don’t remember but they were added months ago.

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 2017-01-15 at 15:37

GExperts now adds favorites to the Build Events

 Delphi, GExperts  Comments Off on GExperts now adds favorites to the Build Events
Jan 152017
 

I use build events in Delphi programming to do various things, but usually it’s this:

  • pre-build: Increment the build number (in an external ini file) and create a version resource from that info.
  • post-build: Add translations and jcldebug information to the executable.

For each new program and quite a few older programs which don’t do this yet, this means I have to add these build events. But since I don’t do it frequently enough to know them by heart, I have to look these commands up every time. And it’s still often enough for it to be a nuisance, so I have now spent an outrageous amount of time (in comparison to the time it takes to add these two calls to any Delphi project) hacking the Delphi IDE and adding a Favorites button to all the dialogs in question (in all Delphi versions supported by GExperts).

Here is the result:

This button is now available in the Build Event dialog for all types of build events:

In addition, its available directly on the page where you set up the build events in the Project Options dialog of Delphi 2007 to XE (later versions use that annoying string grid for the build events so it wasn’t possible to simply add a button):

Of course there is a corresponding configuration option to en-/disable this IDE enhancement (even though I can’t think of a reason why anybody wouldn’t want it):


I’m thinking about doing another experimental GExperts release in the near future. Until then you have to get the sources and build your own dll as described in my article on How to compile GExperts. Be sure to get the source from the Formatter branch, as described there.

Ok, there it is, a new GExperts release that includes this feature.

 Posted by on 2017-01-15 at 13:00

Hiding the Quick Action and Description panel in Delphi with GExperts

 Delphi, GExperts  Comments Off on Hiding the Quick Action and Description panel in Delphi with GExperts
Jan 082017
 

Delphi 2010 introduced two new panels at the bottom of the Object Inspector in the Delphi IDE, the Quick Action panel and the Description panel.

I didn’t really notice them until I read this question on StackOverflow. It caught my attention because the screenshot showed mostly captions of the menu items added by GExperts to the context menu of the form designer.

MartynA showed a way to hide them in his answer and gave me permission to use his code in GExperts. Unfortunately it had a small flaw:

… set the Height of the THotCommands and TDescriptionPane controls to 0, because the IDE seems to reset their Visible property to True after the component selection in the OI is changed. Fortunately, whatever code does that does not also reset their Heights to a non-zero value.

I didn’t like his workaround, but I had a brilliant™ idea: Instead of simply hiding these controls I introduced a new, hidden panel and changed their Parent to this panel. Problem solved, not. There were also two TSplitter controls which were left visible. Moving them too hid them just fine.

The next problem was making them visible again. Simply moving them back, left the controls in the wrong order. The splitters were below both panels rather than one above each. It took me a while to get this right. The solution was to always first move all controls to my hidden panel and then move them back in bottom up order.

Then it was “just” a matter of adding some configuration options and setting the right IFDEFS (Delphi 10 introduced the option to hide these panels from the Object Inspector’s context menu.). And voila, a new IDE enhancement was born.

 Posted by on 2017-01-08 at 22:52

Filter for GExperts Class Browser

 Delphi, GExperts  Comments Off on Filter for GExperts Class Browser
Jan 072017
 

I have finished the filter functionality for the GExperts Class Browser expert. There are now filter fields for the class name as well as for the members.

As of now (2017-01-07), there is no release of GExperts with this feature. But you can always get the sources and compile your own.

 Posted by on 2017-01-07 at 18:45