|
Collapsible Menus Sample 5
The documentation for this sample has been updated for DHTML Menu Builder 4.20
This sample demonstrates one of the most
powerful features in the latest version of the AddIn: support for a third
state.
This third state is used to change the style of the currently selected
items.
As you can see here, both the image and the color of the items that display
submenus is changed as you click on them.
Here's how
to setup a third style:
- First of all, to activate this feature we
must create a template command from which the AddIn will inherit the
style:
- Select the "(No Toolbar)" node on your
project
- Click Menu->Add Group
- Name the group as [SelTemplate]
- Click Menu->Add Command
- Set the command's caption to "SelTemplateTBI"
- Uncheck the "Enabled" option
- Set the command's caption to "SelTemplateCMD"
- Uncheck the "Enabled" option
- Now its just a matter of setting the
styles.
The SelTemplateTBI command will control the style that will be applied to selected toolbar items while the SelTemplateCMD will control the style that will be applied to selected commands.
At this moment, you can change colors, fonts, selection effects and images.
A couple of important things that you must keep in mind when setting the
template command's styles:
- The desired color, font, image and
selection effects should be set for the "Normal" state only. The Over
state of both SelTemplateTBI and SelTemplateCMD will be ignored.
- If you set a left, right or background
image on the SelTemplate* commands, your standard menu items must also use a left,
right and/or background image.
For example, if you set a right image for the SelTemplateTBI command but the
toolbar items on your collapsible toolbar doesn't have right images the AddIn
will fail to apply the image.
- Make sure the styles on the SelTemplate*
commands don't cause the command to grow in size.
For example, if the commands in your project have a border size of "1" and the
SelTemplateCMD command has a border size of "2" you will end with unpredictable
(and most likely undesirable) results.
|