当前位置: 首页>>代码示例>>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;未经允许,请勿转载。