Made protected methods virtual to allow subclassing to customize more aspects of the window setup.