The application should pass the set of flags to be enabled as a logically ORed set in the dwFlagsToAdd parameter. These will be switched on internally in addition to whatever else was enabled before the call.
This helper function calls IWidget_GetFlags() to retrieve the current set of enabled flags, ORs in the set of flags to be turned on, then uses IWidget_SetFlags() to enable the new set along with the old. If the widget doesn't support the PROP_FLAGS parameter, an error code will be returned. To determine if a specific type of widget supports PROP_FLAGS and what flags can be set, refer to that widget's documentation.
For example, the Text Widget defines and understands the TWF_MULTILINE, TWF_VERTICALNAV and TWF_PASSWORD flags. Each of these causes a text widget to behave differently. To tell a multiline text widget to allow vertical navigation, an application may call
This is equivalent to the following, which enables vertical navigation and retains the multiline behavior:
IWidget_GetFlags(pTextWidget, &dwCurFlags); dwCurFlags |= TWF_VERTICALNAV; IWidget_SetFlags(pTextWidget, dwCurFlags);
int IWidget_AddFlags(IWidget *pif, uint32 dwFlagsToAdd);
- AEE_SUCCESS : The widget was able to handle the event, and the specified
flags were enabled.
AEE_EFAILED : The widget was unable to handle the event, and the widget's
flags remain unchanged.
- Depending on the widget implementation and what flags were set, the widget's behavior will change. Refer to the widget's documentation to see what specific flags it supports and what effect they have.