We first call the super class' paint (CustomControl: :paint (ctx) ) to ensure that the basic paint operations take place (like painting the background).
We determine the current locale we are going to use.