Added Unit Tests for PanZoomWidget.

Minor change to PanZoomWidget - heights gets updated when the width is updated (originally it was assumed the height was set to auto).
Refactored a function in PanZoomWidget.