Daily stuff not frequently posted a software developer finds out or rants about.

Friday, June 29, 2007

TListView using modern styles known from Windows XP Explorer

Tile DemoGrouping demo

Looking for a way to display data grouped, but without leaving the standard VCL components, I remembered the way Windows Explorer is able to group TListView items since Windows XP (to be exact, since the Common Controls have reached version 6).

Searching for a way to implement that, if possible through a standard TListView, I came across the article Tilemodus und Gruppierung von List-View-Items (WinXP) (Tile mode and grouping of list view items on Windows XP) at the German Delphi-PRAXiS forum, which gives a few examples. Now, ever since I read about class helpers, I wanted to play around with them, and this seemed to a good chance, so I created snlListView.pas (also needed: CommCtrl_Fragment from the DP forum link above), which extends TListView and TListItem to allow grouping and tile mode. A look at the source will show you the new properties, e.g. GroupViewEnabled (which, by the way, needs to be enabled AFTER FormCreate), AddGroup to add a new group, ViewStyle = vsTile for the new fifth display mode, and each items new GroupId.

Saturday, June 02, 2007

Use your SpaceNavigator everywhere

I spent some time updating the pk3DConnexion.pas presented two days ago (using a SpaceNavigator... SpacePilot was a typo), to make more emulated actions available. The result is
Universal Cosmonaut, a small tray icon application that automatically switches configurations depending on the application currently in the foreground; you can then set up emulated actions on a simple configuration dialog, without the need to manipulate config files with a text editor.

Credits go to 3DConnexion for providing a high-quality reliable 3D navigation device, and to RBC9 for his project of writing a driver that is doing similar things (published it at the 3DConnexion forums), which gave me the inspiration. His driver has some huge advantages, since on driver level, he's able to send input even to DirectX games, able to emulate a joystick, &c. The reasons I still wrote my own application running on user level are:
  • RCB9s driver does not run on 64 bit Windows, so I could not use it
  • It doesn't have a one-click-setup - you need to change the driver for the USB device
  • The UI seems to be .NET, and I just hate that
  • Just for the fun of it
If you don't care about above reasons (e.g. you don't have a 64 bit Windows, and you don't mind location the device and installing a new driver for it) , you might be better of with RBC9s driver.