The Hierarchy Selector control is an enhanced COMCTL32.OCX TreeView control which allows
you to easily create option dialogs like the Win98 Folder Options dialog and the Internet
Explorer Advanced option dialog. In addition to this, it also provides methods which
allow you display a hierarchy of options to the user and allow them to easily select the
items of interest.
The control also demonstrates how to do a number of other things with the TreeView control
which aren't available in the standard version:
- Make a Node Bold
- Apply selection tracking (where a node highlights as the user moves the mouse over)
- Get Full-Row selection in the treeview control
- Make a Node look like it has been cut (dithered icon)
- Change the background and foreground colours of the TreeView
- Expand TreeView Nodes with a single click
- Tile a bitmap into the background of the TreeView.
Often there is a hierachy or drill-down in the data your user must choose from. For example,
an application which allows users to choose from geographical regions could show a hierarchy
Continents > Countries > Counties/States > Cities
The idea of the hierarchical selector is to allow the user to select information at any
level of drill-down from the top. So for the hierarchy above, if the user wanted to
concentrate only on Liverpool in the UK, the User can eliminate a large number of
unwanted cities at the continent level.
To see this in pictures, the following sequence shows a selector for an imaginary banking
application where data is categorised against a hierarchy of sectors.
All Items Included
By clicking on the All Sectors item at the head of the list, the control automatically
toggles all the children in the hierarchy. Likewise, if you were to click on the Banking sector,
it would toggle all the state of all the children of the Banking sector.
Clearly it is possible for certain children to be included and others to be excluded. When
this occurs, the control correctly responds by indicating a partial selection in all the
parents (in this case the Autos and Auto Parts and All Sectors items).