當前位置: 首頁>>代碼示例>>C++>>正文


C++ Alert函數代碼示例

本文整理匯總了C++中Alert函數的典型用法代碼示例。如果您正苦於以下問題:C++ Alert函數的具體用法?C++ Alert怎麽用?C++ Alert使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Alert函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: Alert

/*!
	The assigner.
*/
Init const & Init::operator= (Init const & that)
{
	WatchError
	Alert(&that, eUndefAssigner);
    return *this;
	CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:10,代碼來源:init.cpp

示例2: itworked

Boolean itworked(short errcode)
/* Return TRUE if it worked, do an error message and return false if it didn't. Error
   strings for native C errors are in STR#1999, Mac errs in STR 2000-errcode, e.g
   2108 for not enough memory */

{
	if (errcode != 0) {
		short		 itemHit;
		Str255 		 errdesc;
		StringHandle strh;
	
		errdesc[0] = '\0';
		if (errcode > 0) GetIndString(errdesc,stdIOErrID,errcode);  /* STDIO file rres, etc */
		else {
			strh = GetString(2000-errcode);
			if (strh != (StringHandle) nil) {
				memcpy(errdesc,*strh,256);
				ReleaseResource((Handle)strh);
			}
		}
		if (errdesc[0] == '\0') {  /* No description found, just give the number */
			sprintf((char *)&errdesc[1],"a %d error occurred",errcode);
			errdesc[0] = strlen((char*)&errdesc[1]);
		}
		SetCursor(&qd.arrow);
		ParamText(errdesc,(StringPtr)"",gActivities[gTopactivity],(StringPtr)"");
		itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
	}
	return(errcode==0);
}
開發者ID:BarclayII,項目名稱:slashem-up,代碼行數:30,代碼來源:macerrs.c

示例3: DoCommand

void DoCommand(long mResult)
{
	short theItem;
	short theMenu;
	Str255		daName;
	short		daRefNum;
	
	theItem = LoWord(mResult);
	theMenu = HiWord(mResult);
	
	switch (theMenu)
	{
		case appleID:
		{
			if (theItem == 1)
			{
				Alert(rUserAlert, nil);
			}
			else
			{
				/* all non-About items in this menu are DAs */
				/* type Str255 is an array in MPW 3 */
				GetMenuItemText(GetMenuHandle(appleID), theItem, daName);
				daRefNum = OpenDeskAcc(daName);
			}
			break;
		}
		case fileID:
		{
			quit = 1;
			break;
		}
		case editID:
		{
			if (!SystemEdit(theItem-1)) // call Desk Manager to handle editing command if desk accessory window is the active window
			{
				switch (theItem) {
					case cutCommand:
						TECut(textH);
						break;
					case copyCommand:
						TECopy(textH);
						break;
					case pasteCommand:
						TEPaste(textH);
						break;
					case clearCommand:
						TEDelete(textH);
						break;
					default:
						break;
				}
			}
		}
		default:
			break;
	}
	
	HiliteMenu(0);
}
開發者ID:clehner,項目名稱:Retro68Test,代碼行數:60,代碼來源:Retro68Test.c

示例4: Init

/*!
	The Dupllicator
*/
RandomValidSC::RandomValidSC(RandomValidSC const & that) :
	Init(that), mRnd(that.mRnd)
{
    WatchError
    Alert(&that, eUndefDuplicator);
    CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:10,代碼來源:randomvalidsc.cpp

示例5: psf_read_exe

PostLoadCommand SNSFLoader::Apply(RawFile* file)
{
	BYTE sig[4];
	file->GetBytes(0, 4, sig);
	if (memcmp(sig, "PSF", 3) == 0)
	{
		BYTE version = sig[3];
		if (version == SNSF_VERSION)
		{
			const wchar_t *complaint;
			size_t exebufsize = SNSF_MAX_ROM_SIZE;
			BYTE* exebuf = NULL;
			//memset(exebuf, 0, exebufsize);

			complaint = psf_read_exe(file, exebuf, exebufsize);
			if(complaint) 
			{ 
				Alert(complaint);
				delete[] exebuf;
				return KEEP_IT; 
			}
			//pRoot->UI_WriteBufferToFile(L"uncomp.smc", exebuf, exebufsize);

			wstring str = file->GetFileName();
			pRoot->CreateVirtFile(exebuf, exebufsize, str.data());
			return DELETE_IT;
		}
	}

	return KEEP_IT;
}
開發者ID:soneek,項目名稱:vgmtrans,代碼行數:31,代碼來源:SNSFLoader.cpp

示例6: Alert

int ProjectFrame::OpenProject(const char *fname)
{
	bsString file;
	if (fname == 0)
	{
		const char *spc = ProjectItem::GetFileSpec(PRJNODE_PROJECT);
		const char *ext = ProjectItem::GetFileExt(PRJNODE_PROJECT);
		if (!BrowseFile(1, file, spc, ext))
			return 0;
		fname = file;
	}

	if (!CloseProject(1))
		return 0;

	theProject = new SynthProject;
	if (!theProject)
		return 0;

	theProject->AddRef();
	if (theProject->LoadProject(fname))
	{
		bsString msg;
		msg = "Could not load project: ";
		msg += theProject->WhatHappened();
		Alert(msg, "Ooops...");
		prjTree->RemoveAll();
		theProject->Release();
		theProject = 0;
		return 0;
	}
	InitPlayer();
	return 1;
}
開發者ID:travisgoodspeed,項目名稱:basicsynth,代碼行數:34,代碼來源:ProjectFrame.cpp

示例7: Alert

ChainGrowth const & ChainGrowth::operator= (ChainGrowth const & that)
{
    WatchError
	Alert(&that, eUndefAssigner);
    return *this;
    CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:7,代碼來源:chaingrowthinit.cpp

示例8: Alert

/*!
	The assigner.
*/
Move const & Move::operator= (Move const & that)
{
	WatchError
	Alert(&that, eUndefAssigner);
    return *this;
	CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:10,代碼來源:move.cpp

示例9: Init

/*!
	The Dupllicator
*/
ChainGrowth::ChainGrowth(ChainGrowth const & that) :
	Init(that), mRnd(that.mRnd)
{
    WatchError
    Alert(&that, eUndefDuplicator);
    CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:10,代碼來源:chaingrowthinit.cpp

示例10: Alert

/*!
	The assigner.
*/
ContactOrderObj const & ContactOrderObj::operator = (ContactOrderObj const & that)
{
	WatchError
	Alert(&that, eUndefAssigner);
	return *this;
	CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:10,代碼來源:contactorderobj.cpp

示例11: Alert

/*!
	The assigner.
*/
SideChainCns const & SideChainCns::operator = (SideChainCns const & that)
{
	WatchError
	Alert(&that, eUndefAssigner);
	return *this;
	CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:10,代碼來源:sidechaincons.cpp

示例12: Get1Resource

// Parse a single resource
bool XML_ResourceFork::ParseResource(ResType Type, short ID)
{
    ResourceHandle = Get1Resource(Type,ID);
    if (ResourceHandle == NULL) {
        return false;
    }

    HLock(ResourceHandle);
    if (!DoParse()) {
        const char *Name = SourceName ? SourceName : "[]";
#ifdef TARGET_API_MAC_CARBON
        csprintf(
            temporary,
            "There were configuration-file parsing errors in resource %hd of object %s",
            ID,Name);
        SimpleAlert(kAlertStopAlert,temporary);
#else
        psprintf(
            ptemporary,
            "There were configuration-file parsing errors in resource %hd of object %s",
            ID,Name);
        ParamText(ptemporary,0,0,0);
        Alert(FatalErrorAlert,NULL);
#endif
        ExitToShell();
    }
    HUnlock(ResourceHandle);
    ReleaseResource(ResourceHandle);
    return true;
}
開發者ID:blezek,項目名稱:marathon-ios,代碼行數:31,代碼來源:XML_ResourceFork.cpp

示例13: dprintf

int dprintf(
	const char *format,
	...)
{
	char buffer[257]; /* [length byte] + [255 string bytes] + [null] */
	va_list arglist;
	int return_value;
	
	if (debug_status)
	{
		va_start(arglist, format);
		return_value= vsprintf(buffer+1, format, arglist);
		va_end(arglist);
		
		*buffer= strlen(buffer+1);
#ifdef DEBUG
		if (debugger_installed)
		{
			DebugStr((StringPtr)buffer);
		}
		else
#endif
		{
			ParamText((StringPtr)buffer, (StringPtr)"\p?", (StringPtr)"", (StringPtr)"");
			Alert(alrtNONFATAL_ERROR, (ModalFilterUPP) NULL);
			ParamText((StringPtr)"", (StringPtr)"", (StringPtr)"", (StringPtr)"");
		}
	}
	else
	{
開發者ID:DrItanium,項目名稱:moo,代碼行數:30,代碼來源:macintosh_utilities.c

示例14: Alert

RandomValidSC const & RandomValidSC::operator= (RandomValidSC const & that)
{
    WatchError
	Alert(&that, eUndefAssigner);
    return *this;
    CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:7,代碼來源:randomvalidsc.cpp

示例15: Alert

RandomStructured const & RandomStructured::operator= (RandomStructured const & that)
{
    WatchError
	Alert(&that, eUndefAssigner);
    return *this;
    CatchError
}
開發者ID:swakkhar,項目名稱:platypus,代碼行數:7,代碼來源:randomstructured.cpp


注:本文中的Alert函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。