Consultor Eletrônico



Kbase P120466: ADM2: How to use action names instead of image icons on the SmartToolBar?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/01/2009
Status: Verified

GOAL:

ADM2: How to use action names instead of image icons on the SmartToolBar?

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

FIX:

The following is one way to make the SmartToolBar use the action names instead of icon image. The images used by the SmartToolBar are loaded from the dlc\gui\adm2\images directory. This solution simply sets the images directory to a non existing directory:
1. Create a subdirectory of your working directory named adm2: WRK\adm2.
2. Copy the file src\adm2\dyntoolbar.w to the newly created directory: WRK\adm2.
3. Edit the local WRK\adm2\dyntoolbar.w to create a setImagePath function override with the following code:

FUNCTION setImagePath RETURNS LOGICAL
( /* parameter-definitions */ ) :
/*------------------------------------------------------------------------------
Purpose: Super Override
Notes:
------------------------------------------------------------------------------*/

/* Code placed here will execute PRIOR to standard behavior. */

DEFINE VARIABLE vcImagePath AS CHARACTER NO-UNDO.

vcImagePath = DYNAMIC-FUNCTION('getUserProperty':U IN TARGET-PROCEDURE, INPUT "imagePath":U).
{set imagePath vcImagePath}.
RETURN TRUE. /* Function return value. */
END FUNCTION.
4. Edit the local WRK\adm2\dyntoolbar.w to create an initializeObject procedure override with the following code:

PROCEDURE initializeObject :
/*------------------------------------------------------------------------------
Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/
/* Code placed here will execute PRIOR to standard behavior. */
DYNAMIC-FUNCTION('setUserProperty':U ,INPUT "imagePath":U,INPUT "app/images":U).
DYNAMIC-FUNCTION('setImagePath':U).

RUN SUPER.
/* Code placed here will execute AFTER standard behavior. */
END PROCEDURE.
5. Compile and save and compile the modified WRK\adm2\dyntoolbar.w procedure.
The SmartToolBar will now display the names of the actions instead of the image icons.