Preview enhancements

This is an updated version of the patch in http://issuetracker.delphi-jedi.org/view.php?id=5996.  The first commit has run for close to a year in production; the second commit (moving the ShowScrollBar calls to after the SetScrollInfo calls) has received very little testing.