Understand the CFWL Widget Library architecture
mainThe xfa/fwl library is a Widget Library for XFA Forms. It uses a class hierarchy where CFWL_Widget serves as the base class. Derived widget classes act as both controllers and renderers for their respective widgets.
Key components of the architecture include:
- Widgets: Derived from
CFWL_Widget. Common widgets includeCFWL_Form,CFWL_Edit,CFWL_PushButton, andCFWL_ListBox. - Messages: User input handled by widgets. Messages are identified by
Message::Typeand derived fromCFWL_Message(e.g.,CFWL_MessageMouse,CFWL_MessageSetFocus). - Events: Actions originated in widgets and handled by other
CFWL_WidgetorCXFAclasses (e.g.,CFWL_EventMouse,CFWL_EventSelectChanged). - Rendering: Widgets use
IFWL_ThemeProviderfor drawing, utilizingDrawBackground()andDrawText()withCFWL_ThemeBackgroundandCFWL_ThemeTextoptions.
Note that CFWL widgets are instantiated by and closely related to the CXFA classes found in the xfa/fxfa directory.