Create a custom widget

How to create a custom widget?

 

Thanks in advance...