本文整理汇总了C++中JGetUserNotification函数的典型用法代码示例。如果您正苦于以下问题:C++ JGetUserNotification函数的具体用法?C++ JGetUserNotification怎么用?C++ JGetUserNotification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了JGetUserNotification函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: JGetString
void
JCheckForNewerVersion
(
JPrefsManager* prefsMgr,
const JPrefID& prefID
)
{
const JString& versionURL = JGetString("VERSION_URL");
JString protocol, host, path;
JIndex port;
if (!JParseURL(versionURL, &protocol, &host, &port, &path))
{
cerr << "unable to parse url: " << versionURL << endl;
return;
}
if (port == 0 && !JGetDefaultPort(protocol, &port))
{
cerr << "unknown protocol in versionURL: " << versionURL << endl;
return;
}
VersionSocket* socket = new VersionSocket(host, path, prefsMgr, prefID);
assert( socket != NULL );
const JString vers = socket->GetLatestVersion();
if (socket->TimeToRemind())
{
const JCharacter* map[] =
{
"vers", vers,
"site", host
};
const JString msg = JGetString("JRemindNewVersion", map, sizeof(map));
if ((JGetUserNotification())->AskUserYes(msg))
{
(JGetWebBrowser())->ShowURL(JGetString("DOWNLOAD_URL"));
}
}
if (socket->TimeToCheck())
{
ACE_INET_Addr addr(port, host);
VersionConnector* connector = new VersionConnector;
assert( connector != NULL );
if (connector->connect(socket, addr, ACE_Synch_Options::asynch) == -1 &&
jerrno() != EAGAIN)
{
// cerr << "unable to open socket: " << versionURL << endl;
delete connector;
}
}
else
{
delete socket;
}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:60,代码来源:jWebUtil.cpp
示例17:
void
CBApp::Quit()
{
if (!itsWarnBeforeQuitFlag ||
(JGetUserNotification())->AskUserNo("Are you sure you want to quit?"))
{
JXApplication::Quit();
}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:9,代码来源:CBApp.cpp
示例18: if
JBoolean
JXFileInput::InputValid()
{
if (itsAllowInvalidFileFlag)
{
return kJTrue;
}
else if (!JXInputField::InputValid())
{
return kJFalse;
}
const JString& text = GetText();
if (text.IsEmpty())
{
return JNegate(IsRequired());
}
JString fullName;
const JCharacter* errID = NULL;
if (JIsRelativePath(text) && !HasBasePath())
{
errID = kNoRelPathID;
RecalcAll(kJTrue);
}
else if (!JConvertToAbsolutePath(text, itsBasePath, &fullName) ||
!JFileExists(fullName))
{
errID = kDoesNotExistID;
}
else if (itsRequireReadFlag && !JFileReadable(fullName))
{
errID = kUnreadableID;
}
else if (itsRequireWriteFlag && !JFileWritable(fullName))
{
errID = kUnwritableID;
}
else if (itsRequireExecFlag && !JFileExecutable(fullName))
{
errID = kCannotExecID;
}
if (JStringEmpty(errID))
{
return kJTrue;
}
else
{
(JGetUserNotification())->ReportError(JGetString(errID));
return kJFalse;
}
}
开发者ID:mta1309,项目名称:mulberry-lib-jx,代码行数:53,代码来源:JXFileInput.cpp
示例19: strlen
JBoolean
JDiscreteValueNameValid
(
const JCharacter* str
)
{
JIndex i;
const JSize length = strlen(str);
if (length == 0)
{
(JGetUserNotification())->ReportError("Discrete values cannot be empty");
return kJFalse;
}
for (i=1; i<=length; i++)
{
if (isspace(str[i-1]))
{
(JGetUserNotification())->ReportError("Discrete values cannot contain spaces");
return kJFalse;
}
}
const JSize opCount = JPGetComparisonOpCount();
const JDecisionOperatorInfo* opInfo = JPGetComparisonOpInfo();
for (i=0; i<opCount; i++)
{
JSize offset;
if (JStringContains(str, length, opInfo[i].name, &offset))
{
(JGetUserNotification())->ReportError(
"Discrete values cannot contain comparison operators");
return kJFalse;
}
}
return kJTrue;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:40,代码来源:jParseDecision.cpp
示例20: assert
JBoolean
JXFSBindingTable::ExtractInputData
(
const JPoint& cell
)
{
assert( itsTextInput != NULL );
const JString& s = itsTextInput->GetText();
JBoolean ok = itsTextInput->InputValid();
if (ok && cell.x == kPatternColumn)
{
const JFSBinding* b = itsBindingList->GetBinding(cell.y);
const JBoolean changed = JI2B(b->GetPattern() != s);
if (JFSBinding::WillBeRegex(s))
{
const JError err = itsTestRegex->SetPattern(s);
err.ReportIfError();
ok = err.OK();
}
JIndex newIndex;
if (ok && changed && itsBindingList->SetPattern(cell.y, s, &newIndex))
{
JTableSelection& s = GetTableSelection();
s.ClearSelection();
s.SelectCell(newIndex, kPatternColumn);
Broadcast(DataChanged());
}
else if (ok && changed)
{
ok = kJFalse;
const JCharacter* map[] =
{
"pattern", s.GetCString()
};
const JString msg = JGetString(kPatternUsedID, map, sizeof(map));
(JGetUserNotification())->ReportError(msg);
}
}
else if (ok && cell.x == kCommandColumn &&
itsBindingList->SetCommand(cell.y, s))
{
Broadcast(DataChanged());
}
return ok;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:52,代码来源:JXFSBindingTable.cpp
注:本文中的JGetUserNotification函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论