* Replace dynamic_cast with virtual functions and disable RTTI. * Cleanup TopBar class hierarchy. * Fix compiler warning.