Remove PreferecesWidgets from cwin.
Replace with PreferencesDialog that has cwin as private member.