void CAAlertView::onClickButton(CAControl* btn, CCPoint point) { if (m_pCAlertBtnEvent && m_pCAlertTarget) { ((CAObject*)m_pCAlertTarget->*m_pCAlertBtnEvent)(btn->getTag()); } CAApplication* pApplication = CAApplication::getApplication(); CCAssert(pApplication != NULL, ""); pApplication->getRootWindow()->removeSubview(this); autorelease(); }
void CAAlertView::showMessage(std::string title, std::string alertMsg, std::vector<std::string>& vBtnText) { setTitleImage(CAImage::create("source_material/alert_title.png")); setContentBackGroundImage(CAImage::create("source_material/alert_content.png")); setTitle(title.c_str(), CAColor_white); setAlertMessage(alertMsg.c_str()); initAllButton(vBtnText); setAllBtnBackGroundImage(CAControlStateNormal, CAImage::create("source_material/alert_btn.png")); setAllBtnBackGroundImage(CAControlStateHighlighted, CAImage::create("source_material/alert_btn_sel.png")); setAllBtnTextColor(); calcuCtrlsSize(); CAApplication* pApplication = CAApplication::getApplication(); CCAssert(pApplication != NULL, ""); pApplication->getRootWindow()->insertSubview(this, CAWindowZoderCenter); retain(); }