Smooth sailing
Ultimately, TQTXWidget simplifies development by providing a stateful, object-oriented abstraction over stateless HTML.
- Polymorphic: You can override TQTXWidget methods. The most common is CreateElementInstance. TQTXWidget makes a <div> by default, but TQTXEdit overrides it to make an <input>, and TQTXDOMCanvas makes a <canvas> and so on.
- State management: It gives a home to properties like Visible, Enabled, and Caption, which don't truly exist as single properties on a standard <div>.
- Event abstraction: You don't need to manually call addEventListener or removeEventListener. You simply use AddDelegate or a type-safe helper like AddPointerDownDelegate, and the widget manages the binding for you.