Kbase 21358: ADM2. How To Change the Labels Buttons in a SmartFilter
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Verified
GOAL:
ADM2. How to change button labels for a SmartFilter object.
FACT(s) (Environment):
Progress 9.X
FIX:
For various reasons, your application requirements might dictate that you change the original labels that come with SmartFilter. One particular case is when the application language differs from English.
There are a few approaches to changing the SmartFilter labels. The example given here works with the dynamic properties of the object; changing the button labels by using the handle of the SmartFilter object without modifying the original object.
The dynamic-function 'getEnabledObjHdls' retrieves a character delimited list of the objects in the SmartFilter. Converting these values to WIDGET-HANDLE and using this handle to reference the object, it is possible to change the label of the buttons.
The following is an example of how to change the button labels in a SmartFilter:
DEFINE VARIABLE iNumObjects AS INTEGER NO-UNDO.
DEFINE VARIABLE cObjects AS CHARACTER NO-UNDO.
DEFINE VARIABLE hObject AS HANDLE NO-UNDO.
ASSIGN cObjects = DYNAMIC-FUNCTION('getEnabledObjHdls':U IN h_dynfilter).
DO iNumObjects = 1 TO NUM-ENTRIES(cObjects):
hObject = widget-handle(ENTRY(iNumObjects, cObjects)).
IF hObject:TYPE = "BUTTON":U THEN
IF hObject:LABEL = "&Apply Filter" THEN ASSIGN hObject:LABEL = "my new label".
END.