Owned: Create
This is the constructor you will use 99% of the time when creating widgets, where the following code:
MyButton := TQTXButton.Create(Self, nil);
Results in this sequence taking place behind the scenes:
- Sets widget state to wsCreating
- Calls CreateElementInstance() which creates the HTML element
- Sets its ownership to wmOwner
- Adds the new element's Handle to its parent in the DOM
- Calls StyleElement() is defined in CreateOptions[]
- Calls callback parameter if not nil
- Sets widget state to wsReady
- Calls ObjectReady
- Executes all WhenReady() methods if any
- ..
- When the widget is released, it will destroy the DOM element it created
Note: There are overloaded constructors that takes an existing handle as a parameter, this is for taking over an already existing DOM element. In such a case the element is not deleted when the widget instance is released.