Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

D:/Programming/GUI Editor (Source)/GUIButton.cpp

00001 #include "StdAfx.h" 00002 #include "GUI.h" 00003 00004 CGUIButton::CGUIButton() 00005 { 00006 SetEntityType(Entity_GUIButton); 00007 SetType(GUI_Button); 00008 Initialize(); 00009 } 00010 00011 CGUIButton::~CGUIButton() 00012 { 00013 SAFEDEL_ARRAY(m_pButtonStates) 00014 Destroy(); 00015 } 00016 00017 void CGUIButton::Initialize() 00018 { 00019 m_pButtonStates = NULL; 00020 m_iuStateCount = 0; 00021 m_iCurrentState = 0; 00022 m_bLoopState = false; 00023 00024 m_iNormalStateIndex = m_iMouseOverStateIndex = m_iMouseDownStateIndex = m_iDisabledStateIndex = 1000; 00025 m_iCurrentState = 0; 00026 00027 m_strElementType = "Button"; 00028 } 00029 00030 int CGUIButton::Create(CGUIElement *pParent, tRect WidgetRect, CCustomFont *pFont, CTexture *pTexture, CMaterial *pMaterial, bool bBorder) 00031 { 00032 return CGUIStatic::Create(pParent, WidgetRect, pFont, pTexture, pMaterial, bBorder); 00033 } 00034 00035 int CGUIButton::LoadXML(TiXmlNode *pDataNode, CString strFilename) 00036 { 00037 TiXmlElement* pXMLElement = NULL; 00038 const char *pcValue = NULL; 00039 00040 int iRetValue = CGUIStatic::LoadXML(pDataNode, strFilename); // LoadXML the data of derivative 00041 if(iRetValue !=1) 00042 return iRetValue; 00043 00044 pXMLElement = m_pXMLElement; 00045 00046 LoadButtonStates(pXMLElement); 00047 return 1; // All went OK, return 1 00048 } 00049 00050 int CGUIButton::SaveXML(TiXmlNode *pDataNode, CString strFilename) 00051 { 00052 // Nowhere to save! Nothing to save! 00053 if(pDataNode == NULL && strFilename == "") 00054 return -1; 00055 00056 char Buf[128] = ""; 00057 TiXmlElement *pSaveXMLElement = NULL; 00058 00059 if(pDataNode != NULL) 00060 pSaveXMLElement = pDataNode->ToElement(); 00061 else 00062 pSaveXMLElement = new TiXmlElement("Button"); 00063 00064 SaveButtonStates(pSaveXMLElement); 00065 00066 int iRetValue = CGUIStatic::SaveXML(pSaveXMLElement, strFilename); 00067 00068 if(pDataNode == NULL && strFilename !="") 00069 { 00070 TiXmlDocument SaveDoc; 00071 SaveDoc.InsertEndChild(*pSaveXMLElement); 00072 int iRetValue = SaveDoc.SaveFile(strFilename); 00073 SAFEDEL(pSaveXMLElement) 00074 00075 return iRetValue; 00076 } 00077 00078 return iRetValue; 00079 } 00080 00081 int CGUIButton::SaveButtonStates(TiXmlNode *pDataNode) 00082 { 00083 if(pDataNode == NULL) 00084 return -1; 00085 00086 for (int i=0; i<m_iuStateCount; i++) 00087 { 00088 TiXmlElement *pStateXMLElement = new TiXmlElement("State"); 00089 SaveStateEvents(pStateXMLElement, &m_pButtonStates[i]); 00090 00091 pDataNode->InsertEndChild(*pStateXMLElement); 00092 SAFEDEL(pStateXMLElement) 00093 } 00094 return 1; 00095 } 00096 00097 int CGUIButton::SaveStateEvents(TiXmlNode *pDataNode, tButtonState *uiState) 00098 { 00099 if(pDataNode == NULL || uiState == NULL) 00100 return -1; 00101 00102 for (int i=0; i<uiState->m_iEventCount; i++) 00103 { 00104 TiXmlElement *pEventXMLElement = new TiXmlElement("Event"); 00105 if(uiState->m_pEventAnimations[i] !=NULL) 00106 pEventXMLElement->SetAttribute("AnimByName", uiState->m_pEventAnimations[i]->GetName()); 00107 00108 pDataNode->InsertEndChild(*pEventXMLElement); 00109 SAFEDEL(pEventXMLElement) 00110 } 00111 return 1; 00112 } 00113 00114 00115 void CGUIButton::Draw() 00116 { 00117 CTextureFrameAnimation *pAnimation = GetCurrentAnimation(); 00118 if(pAnimation !=NULL) 00119 { 00120 CTexture *pTexture = pAnimation->GetTexture(); 00121 if(pTexture !=NULL) 00122 { 00123 SetTexture(pTexture); 00124 00125 m_TexCoord[0].x = (float)pAnimation->GetCurrentFrame()->left / (float)pTexture->GetWidth(); 00126 m_TexCoord[1].x = (float)pAnimation->GetCurrentFrame()->right / (float)pTexture->GetWidth(); 00127 m_TexCoord[2].x = (float)pAnimation->GetCurrentFrame()->right / (float)pTexture->GetWidth(); 00128 m_TexCoord[3].x = (float)pAnimation->GetCurrentFrame()->left / (float)pTexture->GetWidth(); 00129 00130 //if(pAnimation->GetCurrentFrame()->m_iBottom != pTexture->GetHeight()) 00131 //{ 00132 m_TexCoord[0].y = 1.0f - ((float)pAnimation->GetCurrentFrame()->bottom / (float)pTexture->GetHeight()); 00133 m_TexCoord[1].y = 1.0f - ((float)pAnimation->GetCurrentFrame()->bottom / (float)pTexture->GetHeight()); 00134 m_TexCoord[2].y = 1.0f - ((float)pAnimation->GetCurrentFrame()->top / (float)pTexture->GetHeight()); 00135 m_TexCoord[3].y = 1.0f - ((float)pAnimation->GetCurrentFrame()->top / (float)pTexture->GetHeight()); 00136 } 00137 00138 pAnimation->Animate(100); 00139 } 00140 00141 CGUIStatic::Draw(); 00142 } 00143 00144 CTextureFrameAnimation *CGUIButton::GetEventAnimation(UINT uiEventIndex) 00145 { 00146 // Basically, goes through all events and states and finds one appropriate 00147 // for current config of 'm_iButtonState' and 'event' variables 00148 // and if finds one, returns its animation 00149 if(m_pButtonStates !=NULL) 00150 { 00151 if(uiEventIndex >= 0 && uiEventIndex < m_pButtonStates[GetState()].m_iEventCount) 00152 return m_pButtonStates[GetState()].m_pEventAnimations[uiEventIndex]; 00153 } 00154 00155 return NULL; 00156 } 00157 00158 00159 UINT CGUIButton::GetState() 00160 { 00161 return m_iCurrentState; 00162 } 00163 00164 void CGUIButton::SetState(bool bLoopAnimation, UINT uiState) 00165 { 00166 if(uiState >=0 && uiState < m_iuStateCount) 00167 m_iCurrentState = uiState; 00168 00169 m_bLoopState = bLoopAnimation; 00170 } 00171 00172 CTextureFrameAnimation *CGUIButton::GetCurrentAnimation() 00173 { 00174 UINT EventType = 0; 00175 // If no mouse over this button and its not pressed 00176 00177 // uiState 0 - NORMAL state 00178 // A button MUST have a normal state! 00179 // There must be no change of flags when a button is disabled! 00180 // Normal (not mouseover) 00181 if(PointInRect( 00182 GetRect(), 00183 CInputEngine::GetSingleton().GetMouse()->GetCursorPos().x, 00184 CInputEngine::GetSingleton().GetMouse()->GetCursorPos().y) && 00185 CInputEngine::GetSingleton().GetMouse()->IsButtonDown(VK_LBUTTON) == false) // Only mouseover 00186 { 00187 if(GetEventAnimation(Button_MouseOver) !=NULL) 00188 return GetEventAnimation(Button_MouseOver); 00189 } 00190 else if(PointInRect( 00191 GetRect(), 00192 CInputEngine::GetSingleton().GetMouse()->GetCursorPos().x, 00193 CInputEngine::GetSingleton().GetMouse()->GetCursorPos().y) && 00194 CInputEngine::GetSingleton().GetMouse()->IsButtonDown(VK_LBUTTON)) // LMouseDown 00195 { 00196 if(GetEventAnimation(Button_MouseDown) !=NULL) 00197 return GetEventAnimation(Button_MouseDown); 00198 } 00199 00200 return GetEventAnimation(Button_Default); 00201 } 00202 00203 bool CGUIButton::LoadButtonStates(TiXmlNode *pButtonXMLNode) 00204 { 00205 UINT StateCount = 0; 00206 00207 if(pButtonXMLNode == NULL) 00208 return false; 00209 00210 TiXmlNode *pIterXMLNode = pButtonXMLNode->FirstChild(); 00211 while(pIterXMLNode !=NULL) 00212 { 00213 if(stricmp(pIterXMLNode->pcValue(), "state") == 0) 00214 StateCount++; 00215 00216 pIterXMLNode = pButtonXMLNode->IterateChildren(pIterXMLNode); 00217 } 00218 00219 if(StateCount !=0) 00220 { 00221 SAFEDEL_ARRAY(m_pButtonStates) 00222 m_iuStateCount = StateCount; 00223 } 00224 else 00225 { 00226 CGlobalLogger::GetSingleton().Write("\t**********General Warning\t**********\n"); 00227 CGlobalLogger::GetSingleton().Write("Button (Name: %s, ID: %d) has 0 States (uiState XML Node(s)).", GetName(), GetID()); 00228 00229 return true; 00230 } 00231 00232 if(m_iuStateCount > 0) 00233 { 00234 UINT Count = 0; 00235 m_pButtonStates = new tButtonState[m_iuStateCount]; 00236 00237 pIterXMLNode = pButtonXMLNode->FirstChild(); 00238 while(pIterXMLNode !=NULL) 00239 { 00240 if(stricmp(pIterXMLNode->pcValue(), "state") == 0) 00241 { 00242 if(!LoadStateEvents(&m_pButtonStates[Count], pIterXMLNode)) 00243 { 00244 CGlobalLogger::GetSingleton().Write("\n\t\t!!!!!!!!!!General Error!!!!!!!!!!!!\n"); 00245 CGlobalLogger::GetSingleton().Write("Button (Name: %s, ID: %d) cannot parse uiState(%d) events. Check syntax.", GetName(), GetID(), Count); 00246 00247 return false; 00248 } 00249 } 00250 00251 pIterXMLNode = pButtonXMLNode->IterateChildren(pIterXMLNode); 00252 Count++; 00253 } 00254 } 00255 00256 return true; 00257 } 00258 00259 bool CGUIButton::LoadStateEvents(tButtonState *uiState, TiXmlNode *pStateXMLNode) 00260 { 00261 if(uiState == NULL || pStateXMLNode == NULL) 00262 return false; 00263 00264 UINT EventCount = 0; 00265 00266 TiXmlNode *pIterXMLNode = pStateXMLNode->FirstChild(); 00267 while(pIterXMLNode !=NULL) 00268 { 00269 if(stricmp(pIterXMLNode->pcValue(), "event") == 0) 00270 EventCount++; 00271 00272 pIterXMLNode = pStateXMLNode->IterateChildren(pIterXMLNode); 00273 } 00274 00275 UINT uiIndex = 0; 00276 uiState->m_iEventCount = EventCount; 00277 if(EventCount > 0) 00278 { 00279 uiState->m_pEventAnimations = new CTextureFrameAnimation*[EventCount]; 00280 for (int i=0; i<EventCount; i++) 00281 uiState->m_pEventAnimations[i] = NULL; 00282 00283 pIterXMLNode = pStateXMLNode->FirstChild(); 00284 while(pIterXMLNode !=NULL) 00285 { 00286 CAnimation *pAnimation = CAnimationManager::GetSingleton().LoadResource(pIterXMLNode, ""); 00287 if(pAnimation !=NULL) 00288 { 00289 if(pAnimation->GetEntityType() == Entity_TextureFrameAnimation) 00290 { 00291 uiState->m_pEventAnimations[uiIndex] = (CTextureFrameAnimation *)pAnimation; 00292 uiIndex++; 00293 } 00294 } 00295 else 00296 uiState->m_pEventAnimations[uiIndex] = NULL; 00297 00298 pIterXMLNode = pStateXMLNode->IterateChildren(pIterXMLNode); 00299 } 00300 } 00301 00302 return true; 00303 } 00304 00305 int CGUIButton::OnLMouseUp(UINT x, UINT y) 00306 { 00307 CGUIElement *IterElement = end(); 00308 set_ptr(IterElement); 00309 00310 while(IterElement !=NULL) 00311 { 00312 if(IterElement->OnLMouseUp(x, y)) // If one element finds use to the mouse_down event, do not let others to use it 00313 return 1; 00314 IterElement = prev(); 00315 } 00316 00317 if(GetType() !=GUI) 00318 { 00319 if(Visible()) 00320 { 00321 if(PointInRect(GetRect(), x, y)) 00322 { 00323 if(GetGUI()->GetActiveElement() == this) // if mouse was down initially on this element 00324 { 00325 if(m_iuStateCount > 0) 00326 { 00327 // Progress in button states 00328 if(m_iCurrentState == (m_iuStateCount - 1)) 00329 { 00330 if(m_bLoopState) 00331 m_iCurrentState = 0; 00332 } 00333 else 00334 m_iCurrentState++; 00335 } 00336 00337 // Broadcast the 'pressed' message 00338 GetGUI()->PostMessage(this, NULL, GUI_Message_ButtonPressed); 00339 } 00340 return CGUIStatic::OnLMouseUp(x, y); 00341 } 00342 } 00343 } 00344 00345 return CGUIStatic::OnLMouseUp(x, y); 00346 } 00347 00348 bool CGUIButton::PropertyChanging( const void* pvProperty , void* pvNewValue ) 00349 { 00350 bool bChangeOK = CGUIStatic::PropertyChanging(pvProperty, pvNewValue); 00351 if(pvProperty == &m_iNormalStateIndex) 00352 { 00353 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 0) 00354 { 00355 m_iNormalStateIndex = *(int *)pvNewValue; 00356 if(m_iNormalStateIndex == 1000) 00357 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_Default] = NULL; 00358 else 00359 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_Default] = (CTextureFrameAnimation *)CAnimationManager::GetSingleton().GetResource(m_iNormalStateIndex); 00360 } 00361 } 00362 00363 if(pvProperty == &m_iMouseOverStateIndex) 00364 { 00365 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 1) 00366 { 00367 m_iMouseOverStateIndex = *(int *)pvNewValue; 00368 if(m_iMouseOverStateIndex == 1000) 00369 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_MouseOver] = NULL; 00370 else 00371 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_MouseOver] = (CTextureFrameAnimation *)CAnimationManager::GetSingleton().GetResource(m_iMouseOverStateIndex); 00372 } 00373 } 00374 00375 if(pvProperty == &m_iMouseDownStateIndex) 00376 { 00377 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 2) 00378 { 00379 m_iMouseDownStateIndex = *(int *)pvNewValue; 00380 if(m_iMouseDownStateIndex == 1000) 00381 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_MouseDown] = NULL; 00382 else 00383 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_MouseDown] = (CTextureFrameAnimation *)CAnimationManager::GetSingleton().GetResource(m_iMouseDownStateIndex); 00384 } 00385 } 00386 00387 if(pvProperty == &m_iDisabledStateIndex) 00388 { 00389 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 3) 00390 { 00391 m_iDisabledStateIndex = *(int *)pvNewValue; 00392 if(m_iDisabledStateIndex == 1000) 00393 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_Disabled] = NULL; 00394 else 00395 m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_Disabled] = (CTextureFrameAnimation *)CAnimationManager::GetSingleton().GetResource(m_iDisabledStateIndex); 00396 } 00397 } 00398 00399 if(pvProperty == &m_iCurrentState) 00400 { 00401 int TempVal = *(int *)pvNewValue; 00402 00403 if(TempVal >= 1000) 00404 { 00405 int TempStateCount = m_iuStateCount; 00406 if(TempVal == 1000) 00407 TempStateCount++; 00408 else if(TempVal == 2000) 00409 TempStateCount--; 00410 00411 Destroy(); 00412 Initialize(); 00413 00414 m_iuStateCount = TempStateCount; 00415 m_iCurrentState = 0; 00416 if(m_iuStateCount == 0) 00417 m_pButtonStates = NULL; 00418 else 00419 { 00420 m_pButtonStates = new tButtonState[m_iuStateCount]; 00421 00422 for (int j=0; j<m_iuStateCount; j++) 00423 { 00424 m_pButtonStates[j].m_pEventAnimations = new CTextureFrameAnimation*[3]; 00425 m_pButtonStates[j].m_iEventCount = 3; 00426 00427 for (int i=0; i<3; i++) 00428 m_pButtonStates[j].m_pEventAnimations[i] = NULL; 00429 } 00430 } 00431 00432 m_iCurrentState = 0; 00433 m_pTexture = NULL; 00434 00435 bChangeOK = false; 00436 } 00437 else 00438 { 00439 m_iCurrentState = *(int *)pvNewValue; 00440 bChangeOK = true; 00441 } 00442 } 00443 00444 if(pvProperty == &m_pButtonStates[m_iCurrentState].m_iEventCount) 00445 { 00446 int TempVal = *(int *)pvNewValue; 00447 if(TempVal >= 1000) 00448 { 00449 delete[] m_pButtonStates[m_iCurrentState].m_pEventAnimations; 00450 m_pButtonStates[m_iCurrentState].m_pEventAnimations = new CTextureFrameAnimation*[TempVal - 1000]; 00451 00452 for (int i=0; i<(TempVal - 1000); i++) 00453 m_pButtonStates[m_iCurrentState].m_pEventAnimations[i] = NULL; 00454 00455 m_pButtonStates[m_iCurrentState].m_iEventCount = TempVal - 1000; 00456 00457 m_iNormalStateIndex = m_iMouseOverStateIndex = m_iMouseDownStateIndex = m_iDisabledStateIndex = 1000; 00458 m_iCurrentState = 0; 00459 00460 bChangeOK = false; 00461 } 00462 } 00463 00464 return bChangeOK; 00465 } 00466 00467 void CGUIButton::GetProperties( EPropList& PropList ) 00468 { 00469 CGUIStatic::GetProperties(PropList); 00470 00471 PropList.AddTab("Button"); 00472 EPropertyCombo *pStateCombo = PropList.AddPropCombo(this, "State", &m_iCurrentState); 00473 pStateCombo->AddString("Add uiState...", 1000); 00474 00475 for (int i=0; i<m_iuStateCount; i++) 00476 { 00477 CString uiState; 00478 uiState.Format("State #%d", i); 00479 pStateCombo->AddString(uiState, i); 00480 } 00481 if(m_pButtonStates !=NULL) 00482 { 00483 pStateCombo->AddString("Remove State...", 2000); 00484 00485 PropList.AddPropSeparator(this, "Button Events"); 00486 EPropertyCombo *pEventCombo = PropList.AddPropCombo(this, "Events", &m_pButtonStates[m_iCurrentState].m_iEventCount); 00487 00488 if(m_pButtonStates[m_iCurrentState].m_iEventCount < 4) 00489 { 00490 if(m_pButtonStates[m_iCurrentState].m_iEventCount < 3) 00491 { 00492 if(m_pButtonStates[m_iCurrentState].m_iEventCount < 2) 00493 { 00494 if(m_pButtonStates[m_iCurrentState].m_iEventCount < 1) 00495 pEventCombo->AddString("Add Normal Event", 1001); 00496 00497 pEventCombo->AddString("Add Mouse Over Event", 1002); 00498 } 00499 00500 pEventCombo->AddString("Add Mouse Down Event", 1003); 00501 } 00502 00503 pEventCombo->AddString("Add Disabled Event", 1004); 00504 } 00505 00506 if(m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_Default] == NULL) 00507 m_iNormalStateIndex = 1000; 00508 00509 if(m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_MouseOver] == NULL) 00510 m_iMouseOverStateIndex = 1000; 00511 00512 if(m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_MouseDown] == NULL) 00513 m_iMouseDownStateIndex = 1000; 00514 00515 if(m_pButtonStates[m_iCurrentState].m_pEventAnimations[Button_Disabled] == NULL) 00516 m_iDisabledStateIndex = 1000; 00517 00518 00519 for (int i=0; i<m_pButtonStates[m_iCurrentState].m_iEventCount; i++) 00520 { 00521 CString Event; 00522 Event.Format("%d", i); 00523 pEventCombo->AddString(Event, 1000 + i); 00524 } 00525 00526 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 0) 00527 { 00528 EPropertyCombo *pNormalCombo = PropList.AddPropCombo(this, "Normal", &m_iNormalStateIndex); 00529 pNormalCombo->AddString("None", 1000); 00530 00531 for (int i=0; i<CAnimationManager::GetSingleton().size(); i++) 00532 { 00533 CAnimation *pAnimation = (CAnimation *)CAnimationManager::GetSingleton().at(i); 00534 if(pAnimation->GetEntityType() == Entity_TextureFrameAnimation) 00535 pNormalCombo->AddString(pAnimation->GetName(), i); 00536 00537 if(GetEventAnimation(Button_Default) !=NULL && GetEventAnimation(Button_Default) == pAnimation) 00538 m_iNormalStateIndex = i; 00539 } 00540 } 00541 00542 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 1) 00543 { 00544 EPropertyCombo *pMouseOverCombo = PropList.AddPropCombo(this, "Mouse Over", &m_iMouseOverStateIndex); 00545 pMouseOverCombo->AddString("None", 1000); 00546 00547 for (int i=0; i<CAnimationManager::GetSingleton().size(); i++) 00548 { 00549 CAnimation *pAnimation = (CAnimation *)CAnimationManager::GetSingleton().at(i); 00550 if(pAnimation->GetEntityType() == Entity_TextureFrameAnimation) 00551 pMouseOverCombo->AddString(pAnimation->GetName(), i); 00552 00553 if(GetEventAnimation(Button_MouseOver) !=NULL && GetEventAnimation(Button_MouseOver) == pAnimation) 00554 m_iMouseOverStateIndex = i; 00555 } 00556 } 00557 00558 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 2) 00559 { 00560 EPropertyCombo *pMouseDownCombo = PropList.AddPropCombo(this, "Mouse Down", &m_iMouseDownStateIndex); 00561 pMouseDownCombo->AddString("None", 1000); 00562 00563 for (int i=0; i<CAnimationManager::GetSingleton().size(); i++) 00564 { 00565 CAnimation *pAnimation = (CAnimation *)CAnimationManager::GetSingleton().at(i); 00566 if(pAnimation->GetEntityType() == Entity_TextureFrameAnimation) 00567 pMouseDownCombo->AddString(pAnimation->GetName(), i); 00568 00569 if(GetEventAnimation(Button_MouseDown) !=NULL && GetEventAnimation(Button_MouseDown) == pAnimation) 00570 m_iMouseDownStateIndex = i; 00571 } 00572 } 00573 00574 00575 if(m_iuStateCount > 0 && m_pButtonStates[m_iCurrentState].m_iEventCount > 3) 00576 { 00577 EPropertyCombo *pDisabledCombo = PropList.AddPropCombo(this, "Disabled", &m_iDisabledStateIndex); 00578 pDisabledCombo->AddString("None", 1000); 00579 00580 for (int i=0; i<CAnimationManager::GetSingleton().size(); i++) 00581 { 00582 CAnimation *pAnimation = (CAnimation *)CAnimationManager::GetSingleton().at(i); 00583 if(pAnimation->GetEntityType() == Entity_TextureFrameAnimation) 00584 pDisabledCombo->AddString(pAnimation->GetName(), i); 00585 00586 if(GetEventAnimation(Button_Disabled) !=NULL && GetEventAnimation(Button_Disabled) == pAnimation) 00587 m_iDisabledStateIndex = i; 00588 } 00589 } 00590 } 00591 } 00592 00593 void CGUIButton::Destroy() 00594 { 00595 CGUIStatic::Destroy(); 00596 } 00597 00598 bool CGUIButton::IsOfType(eEntityType eType) 00599 { 00600 if(eType == Entity_GUIButton) 00601 return true; 00602 00603 return CGUIStatic::IsOfType(eType); 00604 } 00605

Generated on Sun Jul 17 21:34:26 2005 for OpenGL GUI by doxygen 1.3.8