bool GuiGameListMenuCtrl::onWake() { if( !Parent::onWake() ) return false; if( !hasValidProfile() ) return false; if( mRows.empty() ) { Con::errorf( "GuiGameListMenuCtrl: %s can't be woken up without any rows. Please use \"addRow\" to add at least one row to the control before pushing it to the canvas.", getName() ); return false; } enforceConstraints(); selectFirstEnabledRow(); setFirstResponder(); mHighlighted = NO_ROW; return true; }
bool GuiGameListMenuCtrl::onAdd() { if( !Parent::onAdd() ) return false; // If we have a non-GuiGameListMenuProfile profile, try to // substitute it for DefaultListMenuProfile. if( !hasValidProfile() ) { GuiGameListMenuProfile* profile; if( !Sim::findObject( "DefaultListMenuProfile", profile ) ) { Con::errorf( "GuiGameListMenuCtrl: %s can't be created with a profile of type %s. Please create it with a profile of type GuiGameListMenuProfile.", getName(), mProfile->getClassName() ); return false; } else Con::warnf( "GuiGameListMenuCtrl: substituted non-GuiGameListMenuProfile in %s for DefaultListMenuProfile", getName() ); setControlProfile( profile ); } return true; }
void GuiGameListMenuCtrl::enforceConstraints() { if (hasValidProfile()) { ((GuiGameListMenuProfile *)mProfile)->enforceConstraints(); } updateHeight(); }
bool GuiGameListMenuCtrl::onAdd() { if ((! Parent::onAdd()) || (! hasValidProfile())) { return false; } return true; }