Themed Grids in Delphi 2010

I was reminded of a new feature in Delphi 2010 when someone recently posted a new comment on a very old blog post. It was the post about my CodeCentral entry that provided a themed TDBGrid component.

In Delphi 2010 the TStringGrid, TDrawGrid and TDBGrid components now have a DrawingStyle property. The default value for this property is gdsThemed which means all grids in your Delphi 2010 applications will be themed by default. If you application isn’t themed, then your grids will use the gdsClassic style, which is how they appeared before Delphi 2010.

You actually get three different drawing style options. Themed, Classic and Gradient.

  • The Classic style is just the previous drawing style.
  • The Themed style uses the current theme information (if enabled) .
  • The Gradient style uses two new properties called GradientStartColor and GradientEndColor to paint the fixed row cells.

The following screen captures show each of the new styles.

Grids Classic Drawing Style

Grids Classic Drawing Style

Grids Themed Drawing Style

Grids Themed Drawing Style

Grids Gradient Drawing Style

Grids Gradient Drawing Style

Indicator Painting Issue

If you strain your eyes for long enough, you might see a painting issue with the Themed and Gradient drawing style images above. To be fair, I didn’t notice it until I wrote the sample application to demonstrate the feature. I had a look to see if the issue has been raised in QualityCentral yet and it hasn’t.

The issue is a lot more obvious when you change the gradient colors a little. As shown in the screen shot below.

Grids Gradient Drawing Style Issue

The indicator transparency issue

The indicator isn’t drawn as transparent. This is a simple fix and only occurs for the TDBGrid component since the indicator isn’t valid for the other grids. Internally the indicator image is stored in a TImageList. When the image from the image list is drawn it isn’t drawn with transparency.

The Fix

  1. Copy the DBGrids.pas file to your applications folder. It is located in the <InstallDir>\Source\Win32\DB folder.
  2. Search for FIndicators.Draw (There is only one occurrence in the entire unit located in the DrawCell method of TCustomDBGrid.)
  3. Change the line under the FIndicators.Draw line to the following:
(ARect.Top + ARect.Bottom - FIndicators.Height) shr 1, Indicator, dsTransparent, itImage, True);

The red bolded parameters are the additional parameters added to the Draw method call (which starts on the preceeding line).

The following screen shot was created with the above fix applied to the DBGrids unit.

Grids Gradient Drawing Style Issue Fixed

The indicator transparency issue fixed

It’s a shame the indicator is not actually exposed for easy customisation. Even more of a shame is the inability to customise the move column painting.

Source Code

The source code and a compiled executable is available for download.

Source Code Download

Ann: Visual Forms for Delphi 2010

Visual Forms for Delphi 2010 is now available. There is also an update to the recent Delphi 2009 version.

An email was sent to all registered users yesterday, so if you didn’t get an email – check your spam filter and if it isn’t there, send an email to support.

New JSDialog release tomorrow.

Delphi 2010 Support

Delphi 2010 versions of Visual Forms and JSDialog Pack will be released within the week.
Some final testing and additional documentation is still required.

JSDialog Pack

The release for JSDialog Pack is a large update that adds many new features and abilities. It also sees the debut of a vastly improved help file and demos.

There were no code changes required for Delphi 2010 support so the current version will compile and run without error.

Visual Forms

The release for Visual Forms will just be a point release and only to add Delphi 2010 support. This is because Version 2 of Visual Forms is continuing in the background and isn’t quite ready for deployment. If you have feature requests – you have a little while before the new features phase is complete.

Delphi Configuration Manager

An updated version will be available mid to late September.

WIP: Screen Resolution indicator when designing forms

Way back in January 2004 (not a misprint), I had an idea (some might say not too many since but I digress).

I put this idea into a system called QualityCentral. The system is full of bugs but more importantly, ideas. Some are good, some are not. You can vote on what you like, and also vote against what you don’t.

Here is a link and summary of the report.

Report No: 6932 (RAID: 193544)          Status: Open
Add functionality to indicate screen resolutions when designing forms.
http://qc.codegear.com/wc/qcmain.aspx?d=6932

I set aside a couple of hours this evening to do something different (been working really hard on a JSDialog Pack update).

Here is a smallish thumb (click for the full size version) and a link to a reduced image.

Screen Resolution Indication

Screen Resolution Indication

http://www.jed-software.com/images/blog/Resolution_Half.png

Haven’t really decided what I’ll do with it (it may just sit on my hard disk for years and remain private like many others before it), although I’m planning something exciting for the Visual Forms product. It may get a call up for that.

Twitter – up and going…

You can now follow us on twitter. Either it will be really interesting or really boring. Time will tell!

http://twitter.com/jedsoftware

Visual Forms: Delphi 2009 Available

Visual Forms for Delphi 2009 has been available for several months now. If you are a registered user and perhaps missed the email announcement, send me an email and collect your order!

This new version for Delphi 2009 (only) includes a few enhancements that will also be added to the next release that will support all IDE’s.

JSDialog Pack: New Release (Delphi 2009 support)

All registered users should now have been notified and sent the latest version of JSDialog Pack (TJSDialog and/or TJSEditDialog) which includes full Delphi 2009 Support.

If you have not received your notification, please contact us via the support email address.

The latest version numbers are:

    TJSDialog – 1.0.053
    TJSEditDialog – 1.0.011

Office closure information

JED Software will be closed on the following days over Christmas and New Years. This means sales won’t be processed and emails will not be responded to on these dates.

We thank our returning and new customers in 2008 and we’re looking forward to 2009 – when some new products will be announced.

December 25, 2008
December 26, 2008
December 27, 2008
December 30, 2008
December 31, 2008
January 1, 2009
January 2, 2009

The dates are for Melbourne, Australia, adjust accordingly for your location in the world!

Visual Forms for Delphi 2009 Beta

A beta version of the Visual Forms IDE Expert is now available for testing with Delphi 2009. Please request your copy via email.

This new version also includes a new feature where a replacement screen capture can be used to represent the form in the list. This will be useful if your application creates a lot of screen content at runtime.

Next JSDialog Pack Version

This was sent yesterday to all registered users of JSDialog Pack (or just TJSDialog). Reposting here because occasionally emails get lost or rejected.

I am putting the finishing touches on the next official release of JSDialog Pack. By now, Delphi 2009 users should have had enough time to make sure there were no issues with the Delphi 2009 beta version that was sent out at the start of October.

If you have always wanted to request a feature (for either JSDialog or JSEditDialog) but never got around to it, now is your chance. This will be the last update (unless a hotfix is needed) until March, 2009.

Update: One response so far has been to allow supporting the GNUGetText localization method. This is currently being considered.