[settings] use dynamic_cast<> to upcast to known control types and check NULL