Called by the framework before the popup dialog is displayed.
Use this function to customize the popup dialog appearance or add/remove some dialog controls.
Default implementation does nothing.