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; }
void GuiGameListMenuCtrl::setRowEnabled(S32 index, bool enabled) { if (! isValidRowIndex(index)) { return; } mRows[index]->mEnabled = enabled; if (getSelected() == index) { selectFirstEnabledRow(); } }
void GuiGameListMenuCtrl::addRow(Row * row, const char* label, const char* callback, S32 icon, S32 yPad, bool useHighlightIcon, bool enabled) { row->mLabel = StringTable->insert(label, true); row->mScriptCallback = (dStrlen(callback) > 0) ? StringTable->insert(callback, true) : NULL; row->mIconIndex = (icon < 0) ? NO_ICON : icon; row->mHeightPad = yPad; row->mUseHighlightIcon = useHighlightIcon; row->mEnabled = enabled; mRows.push_back(row); updateHeight(); if (mSelected == NO_ROW) { selectFirstEnabledRow(); } }