Blogs

dxRAM - Richard Morris' DevExpress blog

Technology of the QuantumGrid - Object Inspector tricks

     

I'm presenting a couple of sessions at CodeRage this week.  The first is, called "The technology of the Quantum Grid" which will go live at 1pm PDT, Tuesday Sept 8th.

This session is about how the QuantumGrid (since v4) does some Object Inspector magic to enable developers to specialize components by allowing you to dynamically add sub-components - it's a very nice way of extending a class in many diverse directions while keeping the property noise to a minimum.

You can see this happening when you add a column to a grid and select its Properties property.  To see this drop an empty grid on a form, click on ‘Customization’ and add a column to the GridDBTableView and click on it and you will see the Column object in the Object Inspector.


Notice that the Properties Property is a regular drop down editor, this is the site that an editor class for all cells in this column will be defined.  If you click the drop down button you will see the list of available editor classes that can be used, these can be editors from the Express Editors package, or even your own descendants that you have registered with the Grid architecture.

Now if you actually select a class, let’s say the CalcEdit class, something special happens to the Properties property.  It changes into a subcomponent property of the class that was selected in the Dropdown.



In this example we now have the class name CalcEdit in the Properties property and since this is now a subcomponent property we also have all the properties (and events if you look at the events page) specific to just that class.  In effect we have a container class called TcxGridDBColumn that we can specialize with any of a number of utility classes simply my selecting the type from a drop down.

If you were to drop down and select a different element, say a CurrencyEdit you would then see all the properties and events specific to that class.

This is a very powerful way to build component specialization by delegation to contained classes, and represents a new way of using the Delphi Object Inspector to improve in place customization of classes, and reduce the clutter of components in the Delphi Palette.  Now you don’t have to have different column classes for each type of Editor, you have just one generic column class that can embed and delegate to custom editors.

Want to add the same kind of functionality to your own components?

Come to my CodeRage session at 1pm PDT, on Tuesday the 8th of September (sign up here ) ... and I'll show you how. Cool

Published Sep 07 2009, 03:28 PM by Richard Morris (DevExpress)
Filed under:
Technorati tags: CodeRage VCL
Bookmark and Share

Comments

 

Byron Baynham_1 said:

Richard, I think you may have used the wrong image on the last screen shot - it's identical to the previous image.

September 7, 2009 8:28 PM
 

Richard Morris (DevExpress) said:

Thanks Byron ... fixed :)

September 7, 2009 8:46 PM
 

Lars said:

Is that Delphi 7? :)

September 10, 2009 6:36 AM
 

Joachim Meyer said:

Unfortunately I missed your session (I have to work from time to time :-). Did you record it? Can I download it somewhere?

September 10, 2009 8:50 AM
 

Murilo said:

QuantumGrid is simply the greatest grid component ever made!

September 12, 2009 7:11 PM
 

Richard Morris (DevExpress) said:

@Murilo: I agree, but the XtraGrid and ASPxGrid plan to catch up ;)

@Joachim: CodeGear are putting recorded sessions online next week ... I'll point out where when I know.

@Lars: Yup D7 in those screenshots, but In the presentation I used Delphi 2009 and the technique works from Delphi 4 through to Delphi 2010.

September 14, 2009 11:59 AM
 

dxRAM - Richard Morris' DevExpress blog said:

In my last blog post, I spoke of how the QuantumGrid was able to implement selectable subcomponents to

September 19, 2009 4:29 AM
 

TPersistent.com » Blog Archive » hcOPF UIObjectBinder gets DesignTime Support said:

Pingback from  TPersistent.com  » Blog Archive   » hcOPF UIObjectBinder gets DesignTime Support

January 4, 2010 12:55 PM

About Richard Morris (DevExpress)

Richard is a developer living in Batemans Bay, Australia, about 4 hours south of Sydney. He blogs and tweets for Developer Express, and develops applications for Campbell Page an Australian charity that helps Australians find jobs.
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.