Calling wxDialog::EndModal() directly from inside the dialog is a
potential bug if the dialog is shown in the modeless or window modal
(quasi-modal). Use the internal button events where possible and
check for the appropriate mode before calling the correct end dialog
function.
We probably don't need it, but some code attempts to dereference
it so safer to have one then to start checking everywhere for
dereferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/5353
- fix an issue when trying to enter a scale < 1.0: such a scale starts by 0, that was rejected by the filter)
- automatic clamp to user scale limits, to avoid many warnings to users.
- if the user scale is out of bounds, warn the user before trying to print, not when opening the dialog.