How to use Mnemonic Constants
The use of Mnemonic Constants inside your code adds more readability to your code. Starting from version 7, the control implements a new internal design to the control COM's interface to expose these public enumerated types. You will see them in the drop downs on property sheets and in Microsoft's Intellisense feature. The one environment where this is not the case is Microsoft Visual C++ environment (due to the manner in which the environment communicates with the control).
The following is the full list of enumerated types with their associated properties:
The following examples, under different development environments, show how to implement Mnemonic Constants in your code. These examples assume that one instance of the control, named MyButton, exists on a form or dialog box. The purpose of the code is to transform, at run-time, the shape of MyButton from Rectangular to Ellipse.
Because of the different behavior of these environments, you need to include the module 3dabm8.h in order to use predefined Mnemonic Constants: This module can be found inside the Include directory (default C:\Program files\MultiMedia Soft\3D Active Button Magic\include).
Now change the button shape using the following line of code:
The SetShape function is defined by the control wrapper class CBtnEnh contained inside the BtnEnh.cpp and BtnEnh.h files: these wrapper files are automatically generated when you insert the control inside your project. So, in order to access this function, you will have to insert the following line of code somewhere in your code.
The mnemonic constant SHAPE_ELLIPSE can be found inside the 3dabm8f.h module file. So, in order to access this value, you will have to insert the following line of code somewhere in your code.
In this environment it is easy to use that Intellisense features that make it easy to assign the intended value to the Shape property.
After typing the code...
press the '=' character on your keyboard. Intellisense displays the listbox of the possible values that can be assigned to the Shape property
Select the SHAPE_ELLIPSE value to complete the line of code as follows:
MyButton.Shape = SHAPE_ELLIPSE
In this environment it is also easy to use that Intellisense features that make it easy to assign the intended value to the Shape property.
After typing the code...
press the '=' character on your keyboard. Intellisense displays the listbox of the possible values that can be assigned to the Shape property.
Select the BTNENHLib4.enumShapes.SHAPE_ELLIPSE value so the complete line of code will be:
MyButton.Shape = BTNENHLib4.enumShapes.SHAPE_ELLIPSE
This environment requires a couple of additional lines of code to make use of Intellisense. First, the following code must be inserted at the beginning of the form management file:
After having inserted the code
To use Intellisense, you must add enumShapes after the equal sign in order to trigger the enumShapes enumerated type. After typing a period, Intellisense is activated.
MyButton.Shape = enumShapes
Select the enumShapes.SHAPE_ELLIPSE value so the complete line of code will be:
MyButton.Shape = enumShapes.SHAPE_ELLIPSE;
Intellisense can be used with J# as well, but with a few differences. After typing...
Intellisense displays the available wrapper functions.
The tooltip on the right of the listbox shows which enumerated type can be assigned to the property. Using the tooltip as a guide, you can make the appropriate selection.
press the dot '.' character and you will see the Intellisense display the listbox of the values declared inside the enumShapes enumerated type
select the SHAPE_ELLIPSE value so the complete line of code will be: