This method is called when the widget is selected.
This is a protected virtual method. It can only be used by declaring it in a custom widget.