Exemplo n.º 1
0
CAAlertView *CAAlertView::create()
{
	CAAlertView *pAlert = new CAAlertView();
	if (pAlert && pAlert->init())
	{
		pAlert->autorelease();
		return pAlert;
	}
	CC_SAFE_DELETE(pAlert);
	return pAlert;
}
Exemplo n.º 2
0
CAAlertView *CAAlertView::createWithText(const char* pszTitle, const char* pszAlertMsg, const char* pszBtnText, ...)
{
	va_list args;
	va_start(args, pszBtnText);

	CAAlertView *pAlert = new CAAlertView();
	if (pAlert && pAlert->init())
	{
		pAlert->addButton(pszBtnText);
		const char* pszText = va_arg(args, const char*);
		while (pszText)
		{
			pAlert->addButton(pszText);
			pszText = va_arg(args, const char*);
		}
		va_end(args);

		pAlert->setTitle(pszTitle, CAColor_black);
		pAlert->setAlertMessage(pszAlertMsg);

		pAlert->autorelease();
		return pAlert;
	}