void LocationDlg::RefreshButtons() { int num = m_pLocList->GetSelection(); GetStore()->Enable(num != -1); GetRecall()->Enable(num != -1); GetRemove()->Enable(num != -1); }
int CInterpreter::GetID( char *id_name ) { int id; id = FindSymbol( id_name, m_IDKeywords ); if ( id == -1 ) return Error("'%s' : unknown identifier", id_name); //FIXME: Function pointers would be awfully nice.. but not inside a class! Weee!! switch (id) { //Affect takes control of an entity case ID_AFFECT: return GetAffect(); break; //Wait for a specified amount of time case ID_WAIT: return GetWait(); break; //Generic set call case ID_SET: return GetSet(); break; case ID_LOOP: return GetLoop(); break; case ID_PRINT: return GetPrint(); break; case ID_USE: return GetUse(); break; case ID_FLUSH: return GetFlush(); break; case ID_RUN: return GetRun(); break; case ID_KILL: return GetKill(); break; case ID_REMOVE: return GetRemove(); break; case ID_CAMERA: return GetCamera(); break; case ID_SOUND: return GetSound(); break; case ID_MOVE: return GetMove(); break; case ID_ROTATE: return GetRotate(); break; case ID_IF: return GetIf(); break; case ID_ELSE: //return Error("syntax error : else without matching if"); return GetElse(); //FIXME: Protect this call so that floating else's aren't allowed break; case ID_GET: return Error("syntax error : illegal use of \"get\""); break; case ID_TAG: return Error("syntax error : illegal use of \"tag\""); break; case ID_TASK: return GetTask(); break; case ID_DO: return GetDo(); break; case ID_DECLARE: return GetDeclare(); break; case ID_FREE: return GetFree(); break; case ID_REM: GetRem(); break; case ID_DOWAIT: GetDoWait(); break; case ID_SIGNAL: GetSignal(); break; case ID_WAITSIGNAL: GetWaitSignal(); break; case ID_PLAY: GetPlay(); //Bad eighties slang joke... yeah, it's not really funny, I know... break; //Local variable types case TK_FLOAT: case TK_INT: case TK_STRING: case TK_VECTOR: GetVariable( id ); break; //Unknown ID default: case -1: return Error("'%s' : unknown identifier", id_name); break; } return true; }