当前位置: 首页>>代码示例>>C++>>正文


C++ JGetUserNotification函数代码示例

本文整理汇总了C++中JGetUserNotification函数的典型用法代码示例。如果您正苦于以下问题:C++ JGetUserNotification函数的具体用法?C++ JGetUserNotification怎么用?C++ JGetUserNotification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了JGetUserNotification函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: time

void
JCheckExpirationDate
	(
	const time_t		expireTime,
	const JCharacter*	map[],
	const JSize			size
	)
{
	const time_t t = time(NULL);
	if (t > expireTime)
		{
		map[1] = "";
		const JString msg = JGetString(kExpiredID, map, size);
		(JGetUserNotification())->DisplayMessage(msg);
		exit(0);
		}
	else if (t > expireTime - 14*24*3600)
		{
		JCharacter date[100];
		strftime(date, 100, "%B %e, %Y", localtime(&expireTime));
		map[1] = date;
		const JString msg = JGetString(kWarnExpireID, map, size);
		(JGetUserNotification())->DisplayMessage(msg);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:25,代码来源:jTime.cpp

示例2: JSplitPathAndName

JBoolean
GMApp::NewMailbox
	(
	const JCharacter*	filename,
	const JBoolean		openFile
	)
{
	JString path;
	JString name;
	JSplitPathAndName(filename, &path, &name);
	if (path.IsEmpty())
		{
		path = JGetCurrentDirectory();
		}
	if (!(JDirectoryExists(path) && JDirectoryReadable(path)))
		{
		JString notice = "You do not have write permissions in directory \"" + path + "\"";
		JGetUserNotification()->ReportError(notice);
		return kJFalse;
		}
	ofstream os(filename);
	if (!os.good())
		{
		JString notice = "Unable to create file \"" + path + name + "\"";
		JGetUserNotification()->ReportError(notice);
		return kJFalse;
		}
	os.close();
	if (openFile)
		{
		OpenMailbox(filename);
		}
	return kJTrue;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:34,代码来源:GMApp.cpp

示例3: is

void
GXDataDocument::LoadFile
	(
	const JCharacter* fileName
	)
{
	std::ifstream is(fileName);

	if (is.bad())
		{
		JGetUserNotification()->ReportError("Error opening file.");
		}
	else
		{
		const JString str = JReadLine(is);
		if (str == kGloveFileSignature)
			{
			if (!LoadNativeFile(is))
				{
				JGetUserNotification()->ReportError(
					"This file was created by a newer version of Glove.  "
					"You need the newest version in order to open it.");
				}
			}
		else
			{
			is.close();
			FileChanged(fileName, kJFalse);
			itsCurrentFileName = fileName;
			ChooseFileFilter();
			}
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:33,代码来源:GXDataDocument.cpp

示例4: if

JBoolean
JXGetNewDirDialog::OKToDeactivate()
{
	if (!JXGetStringDialog::OKToDeactivate())
		{
		return kJFalse;
		}
	else if (Cancelled())
		{
		return kJTrue;
		}

	const JString pathName = GetNewDirName();
	if (JDirectoryExists(pathName))
		{
		(JGetUserNotification())->ReportError(JGetString(kDirectoryExistsID));
		return kJFalse;
		}
	else if (JNameUsed(pathName))
		{
		(JGetUserNotification())->ReportError(JGetString(kNameUsedID));
		return kJFalse;
		}
	else
		{
		return kJTrue;
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:28,代码来源:JXGetNewDirDialog.cpp

示例5: JGetUserNotification

void
JXFSBindingTable::RemovePattern()
{
	JPoint cell;
	if ((GetTableSelection()).GetFirstSelectedCell(&cell))
		{
		if ((itsBindingList->GetBinding(cell.y))->IsSystemBinding())
			{
			JGetUserNotification()->ReportError(JGetString(kCantRemoveSystemBindingID));
			}
		else
			{
			CancelEditing();
			if (itsBindingList->DeleteBinding(cell.y))
				{
				RemoveRow(cell.y);
				}
			else
				{
				TableRefreshRow(cell.y);
				GetWindow()->Update();
				(JGetUserNotification())->DisplayMessage(JGetString(kReplacedBySystemID));
				}
			UpdateButtons();
			Broadcast(DataChanged());
			}
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:28,代码来源:JXFSBindingTable.cpp

示例6: GetSelectionManager

JBoolean
JXExprEditor::EIPGetExternalClipboard
	(
	JString* text
	)
{
	text->Clear();

	JBoolean gotData = kJFalse;
	JXSelectionManager* selManager = GetSelectionManager();

	JArray<Atom> typeList;
	if (selManager->GetAvailableTypes(kJXClipboardName, CurrentTime, &typeList))
		{
		JBoolean canGetText = kJFalse;
		Atom textType       = None;

		const JSize typeCount = typeList.GetElementCount();
		for (JIndex i=1; i<=typeCount; i++)
			{
			Atom type = typeList.GetElement(i);
			if (type == XA_STRING ||
				(!canGetText && type == selManager->GetUtf8StringXAtom()))
				{
				canGetText = kJTrue;
				textType   = type;
				break;
				}
			}

		Atom returnType;
		unsigned char* data = NULL;
		JSize dataLength;
		JXSelectionManager::DeleteMethod delMethod;
		if (canGetText &&
			selManager->GetData(kJXClipboardName, CurrentTime, textType,
								&returnType, &data, &dataLength, &delMethod))
			{
			if (returnType == XA_STRING)
				{
				*text = JString(reinterpret_cast<JCharacter*>(data), dataLength);
				gotData = kJTrue;
				}
			selManager->DeleteData(&data, delMethod);
			}
		else
			{
			(JGetUserNotification())->ReportError(
				"Unable to paste the current contents of the X Clipboard.");
			}
		}
	else
		{
		(JGetUserNotification())->ReportError("The X Clipboard is empty.");
		}

	return gotData;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:58,代码来源:JXExprEditor.cpp

示例7: ViewInheritedDeclaration

JBoolean
CBCClass::ViewDeclaration
	(
	const JCharacter*	fnName,
	const JBoolean		caseSensitive,
	const JBoolean		reportNotFound
	)
	const
{
	JBoolean found = kJFalse;

	JString headerName;
	if (!Implements(fnName, caseSensitive))
		{
		found = ViewInheritedDeclaration(fnName, caseSensitive, reportNotFound);
		if (!found && reportNotFound)
			{
			JString msg = "Unable to find any declaration for \"";
			msg += fnName;
			msg += "\".";
			(JGetUserNotification())->ReportError(msg);
			}
		}
	else if (GetFileName(&headerName))
		{
		CBDocumentManager* docMgr = CBGetDocumentManager();

		JIndex lineIndex;
		if (docMgr->SearchFile(headerName, fnName, caseSensitive, &lineIndex))
			{
			docMgr->OpenTextDocument(headerName, lineIndex);
			found = kJTrue;
			}
		else if (reportNotFound)
			{
			JString msg = "Unable to find the declaration of \"";
			msg += fnName;
			msg += "\".";
			(JGetUserNotification())->ReportError(msg);
			}
		}
	else if (reportNotFound)
		{
		JString msg = GetFullName();
		msg.PrependCharacter('"');
		msg += "\" is a ghost class, so no information is available for it.";
		(JGetUserNotification())->ReportError(msg);
		}

	return found;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:51,代码来源:CBCClass.cpp

示例8: input

void
TestDecisionEquality
	(
	const JCharacter* fileName
	)
{
	std::ifstream input(fileName);

	TestVarList theVarList(input);

	JDecision* d1 = NULL;
	JDecision* d2 = NULL;
	while (1)
		{
		if (!GetDecision(input, &theVarList, &d1))
			{
			break;
			}
		else if (d1 == NULL)
			{
			continue;
			}
		d1->Print(std::cout);
		std::cout << std::endl;

		if (!GetDecision(input, &theVarList, &d2))
			{
			jdelete d1;
			break;
			}
		else if (d2 == NULL)
			{
			jdelete d1;
			continue;
			}
		d2->Print(std::cout);
		std::cout << std::endl;

		if (*d1 == *d2)
			{
			(JGetUserNotification())->DisplayMessage("These decisions are the same");
			}
		else
			{
			(JGetUserNotification())->DisplayMessage("These decisions are not the same");
			}

		jdelete d1;
		jdelete d2;
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:51,代码来源:test.expr.fns.cpp

示例9: if

JBoolean
JX2DPlotPrintEPSDialog::OKToDeactivate()
{
	if (!JXEPSPrintSetupDialog::OKToDeactivate())
		{
		return kJFalse;
		}
	else if (Cancelled())
		{
		return kJTrue;
		}
	else if (!itsWidthInput->InputValid())
		{
		itsWidthInput->Focus();
		return kJFalse;
		}
	else if (!itsHeightInput->InputValid())
		{
		itsHeightInput->Focus();
		return kJFalse;
		}

	JCoordinate w,h;
	Unit u;
	GetPlotSize(&w, &h, &u);
	if (w < 50 || h < 50)
		{
		(JGetUserNotification())->ReportError(JGetString(kTooSmallID));
		return kJFalse;
		}
	else
		{
		return kJTrue;
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:35,代码来源:JX2DPlotPrintEPSDialog.cpp

示例10: dynamic_cast

void
GMApp::Receive
(
    JBroadcaster*					sender,
    const JBroadcaster::Message&	message
)
{
    if (sender == itsAboutDialog && message.Is(JXDialogDirector::kDeactivated))
    {
        const JXDialogDirector::Deactivated* info =
            dynamic_cast(const JXDialogDirector::Deactivated*, &message);
        assert(info != NULL);
        if (info->Successful() && itsOpenPrefsAfterAbout)
        {
            if (!itsPrefsNew)
            {
                JGetUserNotification()->DisplayMessage("Your mail preferences have been converted, please verify that they are correct.");
            }
            GGetAccountMgr()->EditAccounts();
        }
        itsAboutDialog			= NULL;
        itsOpenPrefsAfterAbout	= kJFalse;
        itsPrefsNew				= kJFalse;
    }

    else
    {
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:27,代码来源:GMApp.cpp

示例11: JGetString

void
CBCommand::ReportInfiniteLoop
	(
	const CBFunctionStack&	fnStack,
	const JIndex			startIndex
	)
{
	const JSize cmdCount = fnStack.GetElementCount();
	JString loop;
	for (JIndex i=startIndex; i>=1; i--)
		{
		if (!loop.IsEmpty())
			{
			loop += " -> ";
			}
		loop += fnStack.Peek(i);
		}
	loop += " -> ";
	loop += fnStack.Peek(startIndex);

	const JCharacter* map[] =
		{
		"loop", loop.GetCString()
		};
	const JString msg = JGetString("InfiniteLoop::CBCommand", map, sizeof(map));
	(JGetUserNotification())->ReportError(msg);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:27,代码来源:CBCommand.cpp

示例12: if

JBoolean
TestInputFieldsDialog::OKToDeactivate()
{
JInteger v1,v2;

	if (!JXDialogDirector::OKToDeactivate())
		{
		return kJFalse;
		}
	else if (Cancelled())
		{
		return kJTrue;
		}

	else if (itsLowerValue->GetValue(&v1) &&
			 itsUpperValue->GetValue(&v2) &&
			 v1 >= v2)
		{
		(JGetUserNotification())->ReportError("Low must be less than high.");
		itsLowerValue->Focus();
		return kJFalse;
		}

	else
		{
		return kJTrue;
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:28,代码来源:TestInputFieldsDialog.cpp

示例13: JXTextSelection

void
ClipboardWidget::HandleEditMenu
	(
	const JIndex index
	)
{
	if (index == kCopyCmd)
		{
		// We instantiate a selection object that is appropriate for
		// our data. 
		JXTextSelection* data = new JXTextSelection(GetDisplay(), itsText);
		assert(data != NULL);

		// The selection data is then given to the selection manager.
		if (!(GetSelectionManager())->SetData(kJXClipboardName, data))
			{
			(JGetUserNotification())->ReportError("Unable to copy to the X Clipboard.");
			}
		}
	else if (index == kPasteCmd)
		{
		// Paste if the clipboard has the type we need.
		Paste();
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:25,代码来源:ClipboardWidget.cpp

示例14: if

JBoolean
SCCircuitVarList::AddFunction
	(
	const JCharacter*	name,
	const JFunction&	f,
	const JBoolean		visible
	)
{
	JIndex index;
	if (!JNameValid(name))
		{
		return kJFalse;
		}
	else if (ParseVariableName(name, strlen(name), &index))
		{
		(JGetUserNotification())->ReportError("This variable name is already used.");
		return kJFalse;
		}
	else
		{
		VarInfo info;

		info.name = new JString(name);
		assert( info.name != NULL );

		info.f       = f.Copy();
		info.visible = visible;

		itsVars->AppendElement(info);
		Broadcast(VarInserted(GetElementCount()));
		return kJTrue;
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:33,代码来源:SCCircuitVarList.cpp

示例15: JGetString

void
JCheckSiteName
	(
	const JCharacter*	encSiteSuffix,
	const JCharacter	siteCode,
	const JCharacter*	map[],
	const JSize			size
	)
{
	JString siteSuffix = encSiteSuffix;
	const JSize len    = siteSuffix.GetLength();
	for (JIndex i=1; i<=len; i++)
		{
		siteSuffix.SetCharacter(i, siteSuffix.GetCharacter(i) ^ siteCode);
		}

	map[1] = siteSuffix.GetCString();

	if (!(JGetHostName()).EndsWith(siteSuffix, kJFalse))
		{
		const JString msg = JGetString(kWrongSiteID, map, size);
		(JGetUserNotification())->DisplayMessage(msg);
		exit(0);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:25,代码来源:jSysUtil_UNIX.cpp


注:本文中的JGetUserNotification函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。