Beyond Compare IDE Expert – Delphi 2010 version

I’ve made my Beyond Compare IDE Expert for Delphi 2010 available for download.

Further details are available from www.jed-software.com/bc.htm.

It includes a new feature that allows you to compare a modified version of a source file that shipped to the original version.

Note: No other versions have been updated with this change.

The new command is available in the Compare sub menu and is only enabled when the active file in the editor is the same name as an original source file that shipped with the IDE and is not in the original location.

Compare to Original Source File command location

Compare to Original Source File command location

Beyond Compare showing the comparison

Beyond Compare showing the comparison

VCL Ribbon – Ribbon Group Component Editor

I’ve created a component editor specifically for the TRibbonGroup component. With this component editor it will hopefully make it a little easier to layout your ribbon groups.

It has a number of commands for adding controls to the group as well as changing the alignment and vertical row count for the group.

Download

Delphi 2010 version

Delphi 2009 version

Install

  1. Open up your Delphi version.
  2. Select the Components | Install Packages menu item.
  3. Click on the Add button and select the extracted BPL from the downloaded zip file.

The component editor should now be available when you click on a group on the ribbon.

Some screen captures

Available commands for the Component Editor

Available commands for the Component Editor

When you select a command, you can also choose what actions to create as that command.

When you select a command, you can also choose what actions to create as that command.

You can create the different types of Small and Large buttons. NOTE: Selecting the dropdown button is a little different to the others.

You can create the different types of Small and Large buttons. NOTE: Selecting the dropdown button is a little different to the others.

When you are creating a dropdown button you are selecting that actions that should be added to the button as dropdown items. Only one button is created. You can also enter in the button caption.

When you are creating a dropdown button you are selecting that actions that should be added to the button as dropdown items. Only one button is created. You can also enter in the button caption.

VCL Ribbon – Context Tabs

Context Tabs was bought up in a comment to my MDI post.

I’ve been putting considerable effort into getting this working for one of my personal projects. I think it looks pretty good.

Design Time

Design Time

 

Runtime

Runtime

 

Runtime (second tab)

Runtime (second tab)

Unfortunately it isn’t viable to release these changes to the public. This just proves that it is possible though!

If you posted a comment on the previous post, I’ve responded to all comments now.

VCL Ribbon MDI Fix

Disclaimer: I wrote the VCL Ribbon implementation in Delphi 2009. At the time there was no scope for MDI support in the Ribbon however the number of posts about this issue made me look into fixing it. Today I set aside some time to look at a solution and I now present this solution.

The MDI Ribbon bug is evident when your application is a MDI application and the MDI Children are maximized. The screen capture below shows this bug.

VCL Ribbon MDI Bug

VCL Ribbon MDI Bug

The fix is to drop a new component onto the Form with the Ribbon on it. Then you just need to set the Ribbon property to be the TRibbon component on the form, that is all that needs to be done.

The screen shot below shows the component at design time.

VCL Ribbon MDI Bug Fix

VCL Ribbon MDI Bug Fix

When you toggle the Enable MDI Fix check box, you need to restore and maximum a MDI Child form. For real use, you wouldn’t want to disable it anyway.

Various screen captures of the demo application with the fix active.

Fixed Ribbon MDI Bug

Fixed Ribbon MDI Bug

Fixed Ribbon MDI Bug

Fixed Ribbon MDI Bug

Fixed Ribbon MDI Bug

Fixed Ribbon MDI Bug

 

Downloading the Fix

You can download the component and demo application from my site. I may also put the fix on CodeCentral in future.

Ribbon VCL MDI Bug Fix Download

To install the component into the IDE, open the RibbonMDIFix2010.dpk file in Delphi 2010 (should also work, but is untested). In the project manager, select the Install command. Make sure the path to the RibbonMDIFix.pas unit is on your library path so that the compiler can find the file when compiling your application.

 

Further Ribbon Details

If you search for my QualityCentral entries on the Ribbon, most of the issues I raise I also provide the workaround for. Most are simple changes that can be done by copying the Ribbon units into your project folder. IIRC none are interface breaking (I’ve saved those).

 

Performance issue with MDI Applications using the TActionManager framework

There is also an issue with the MDI “detection” when a TActionMainMenuBar component (and descendants) are used in an application. This is actually a bug that was raised with Borland/CodeGear support several years ago. When you have an action that calls GetActiveMDIChild you may see processor usage increase significantly. On the Window group in the application feature throughout this post you’ll see the Close button. This is the TWindowClose standard MDI action. This actions update handler calls ActiveMDIChild. If you are running an MDI application that utilises TActionManager CPU usage will increase because of this. This occurs because of the Window Hook installed for menu processing. It handles the WM_MDIGETACTIVE message, so if an action is calling that method, the window hook is also processing it.

My solution (which also uses a window hook) avoids increasing CPU usage unnecessarily by listening to more specific MDI messages. There is no need to listen to the WM_MDIGETACTIVE (that I can see).

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.