The Component Selection Collector is a Surface Designer plug-in that allows you to maintain a SmartClipboard-style history of component selections on a form.

Have you ever wished for a way to have CodeRush remember a list of mouse selections (components)?  Something to ease the pain of selecting a group of controls and then performing a batch operation on them, only to de-select them to do something else, but then find you need your original selections back?

For example, suppose we have 4 components (buttons, combo boxes, etc) on our form.  We select Button1, ComboBox1, and RadioButton2 and modify the Tag property.  Next, we de-select them and select RadioButton1 and RadioButton2 and modify their Checked property from the Object Inspector.

If we realize now that we forgot to set the Left property when we had Button1, ComboBox1, and RadioButton2 selected what options do we have?  None.  We have to reselect all of the individual controls again before performing our actions.  Wouldn't it be easier to be able to re-select our prior selection with a simple mouse click?

This plug-in is designed to meet just such a need.


Upon installation, this plug-in will insert a new icon into the Surface Designer toolbar above the Delphi Form Editor.  This button will appear as follows:

When the new Surface Designer icon is depressed, the plug-in is activated and the Selection Collector window appears docked to the Delphi IDE form designer's active form.  The default docking placement is the top-left side of the active form.  This positioning is customizable via the CodeRush Options Docking page located under the node: Form | Surface Designers | Docking.

The Smart Selections window, as this plug-in is sometimes known, can be seen below:

Selecting from the Selections History window on this panel will automatically re-select previously selected components.  The window displayed above is only half of the feature set of this plug-in, however.  While you can make selections (re-select components) from here, you cannot ADD your selections to the list from here.  In order to add selected components to the Selections History for later retrieval, you must execute the new CodeRush function AddSelection.

Simply bind the function to a keystroke (such as Ctrl+Alt+Shift+A), making sure to select a binding that is accessible when the form is in focus, and you are ready to go.

Whenever you have one or more components selected, all you have to do is use your shortcut keystroke and all selected components will be added to the Selections History list.  Note that the AddSelection function works whether or not the Smart Selections window is visible.  You simply need to activate the window in order to retrieve prior selections.

The Component Selection Collector works on both Forms and DataModules.  As the screenshot below demonstrates its usage on a typical data module:

Notice the three TQuery components that are selected (the ones with the dots surrounding them) on the data module.  They also automatically appear in the top window of the Smart Selections window.  These are the Active Selections.

The Selections History window displays previously selected controls from this data module.  Each selection is grouped in a tree-like structure, with text describing the number of selected components selected being the "root-node" caption.

Now, let's see this utility in action!

Suppose we have a form with a selection history consisting of several collection items, as follows:

If we click on one of the components in a collection in the Selections History window, such as the TPanel "pnlTop" in the example above, all components in that group are automatically selected on the active form.  Note that any previously selected items will automatically be de-selected without being added to the Selection History.

Now, if we click on another item in our history list, say a collections header (such as the node titled "3 components") this time, all previously selected items are de-selected and all components belonging to the chosen history item are selected, as follows:



Version 1.0.0
Source Code Available!


CodeRush 6 / Source

CodeRush 7 / Source

Copyright 2004 Ackerson Software, All Rights Reserved.
Ackerson Software
Component Selection Collector

Author: Rob Schoenaker

Created: October 22, 2002

Plug-In Type: Surface Designer

Options Page: No
Uses Docking Options
This plug-in is NOT currently supported.
This plug-in is not the property of Developer Express; it is the sole property of its author.  As such, Developer Express cannot be held liable for any incidental damages that may be related to the usage of this plug-in.
Current Selections

Selections History