本文整理汇总了C++中_List::Find方法的典型用法代码示例。如果您正苦于以下问题:C++ _List::Find方法的具体用法?C++ _List::Find怎么用?C++ _List::Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_List
的用法示例。
在下文中一共展示了_List::Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindUnusedObjectName
void FindUnusedObjectName (_String& prefix, _String& partName, _List& names, bool sorted)
{
if (partName.sLength==0) {
partName = prefix;
}
_String tryName (partName);
long k = 1;
if (sorted)
while (names.BinaryFind(&tryName)>=0) {
k++;
tryName = partName&k;
}
else
while (names.Find(&tryName)>=0) {
k++;
tryName = partName&k;
}
partName = tryName;
}
示例2: HandlePullDownWithFont
long HandlePullDownWithFont (_List& menuOptions, long l, long t,long startPos,_String fName,long fSize)
{
_String selRes = HandlePullDown (menuOptions, l, t, startPos);
return menuOptions.Find (&selRes);
}
示例3: switch
void _HYObjectInspector::KillObject (void)
{
_HYTable* dl = (_HYTable*)GetCellObject (HY_OBJECT_INSPECTOR_TABLE_ROW,0);
_HYButtonBar* b1 = (_HYButtonBar*)GetCellObject (0,0);
_HYPullDown* p1 = (_HYPullDown*)GetCellObject (0,2);
_SimpleList sel;
dl->GetSelection (sel);
if (sel.lLength) {
b1->EnableButton (0,true);
long f;
switch (p1->GetSelection()) {
case 0: {
for (f = 0; f<sel.lLength; f+=2) {
long treeID = LocateVarByName (*(_String*)dl->GetCellData (0,sel.lData[f]/2));
if (treeID>=0)
#ifndef USE_AVL_NAMES
treeID = variableReindex.lData[treeID];
#else
treeID = variableNames.GetXtra(treeID);
#endif
if (dl->cellTypes.lData[sel.lData[f]] & HY_TABLE_BOLD) {
_String prompt ("Tree ");
prompt = prompt & *LocateVar (treeID)->GetName() & objectInspectorKillPrompt;
if (warnTree||(!ProceedPromptWithCheck (prompt,donotWarnAgain,warnTree))) {
continue;
}
}
postTreeKillEvent (GetID(), treeID);
}
break;
}
case 1: {
for (f = 0; f<sel.lLength; f+=2) {
long dsID = dataSetNamesList.Find ((_String*)dl->GetCellData (0,sel.lData[f]/2));
if (dsID>=0) {
if (dl->cellTypes.lData[sel.lData[f]] & HY_TABLE_BOLD) {
_String prompt ("Dataset ");
prompt = prompt & *(_String*)dataSetNamesList(dsID) & objectInspectorKillPrompt;
if (!((!warnTree)&&ProceedPromptWithCheck (prompt,donotWarnAgain,warnDS))) {
continue;
}
}
postDSKillEvent (GetID(), dsID);
}
}
break;
}
case 2: {
for (f = 0; f<sel.lLength; f+=2) {
if (sel.lData[f]/2<modelTemplates.lLength) {
_List* modelT = FindModelTemplate((_String*)dl->GetCellData (0,sel.lData[f]/2));
if (modelT) { // template model
_String*fileLocation = (_String*)(*modelT)(2),
errMsg (*(_String*)dl->GetCellData (0,sel.lData[f]/2));
if (dl->cellTypes.lData[sel.lData[f]] & HY_TABLE_ITALIC) {
errMsg = errMsg & " is a template model. If you wish to delete it, please do so by removing the appropriate file from the \"Substitution Models\" directory.";
ProblemReport (errMsg);
} else {
errMsg = errMsg & " is about to be deleted. This action is NOT undoable.";
if (ProceedPrompt (errMsg,(Ptr)this)) {
if (remove (fileLocation->sData)) {
errMsg = "File delete operation failed.";
ProblemReport (errMsg);
} else {
errMsg = *(_String*)dl->GetCellData (0,sel.lData[f]/2);
for (long k=0; k<modelTemplates.lLength; k++) {
_List* thisList = (_List*)modelTemplates(k);
if (errMsg.Equal((_String*)(*thisList)(0))) {
modelTemplates.Delete (k);
}
}
BuildListOfObjects (2);
}
}
}
}
}
}
break;
}
}
}
}
示例4: windowTitle
void _HYObjectInspector::OpenObjectWindow (void)
{
_HYTable* dl = (_HYTable*)GetCellObject (HY_OBJECT_INSPECTOR_TABLE_ROW,0);
_HYButtonBar* b1 = (_HYButtonBar*)GetCellObject (0,0);
_HYPullDown* p1 = (_HYPullDown*)GetCellObject (0,2);
_SimpleList sel;
dl->GetSelection (sel);
if (sel.lLength) {
b1->EnableButton (0,true);
for (long k = 0; k<sel.lLength; k+=2) {
_String windowTitle (*(_String*)dl->GetCellData (0,sel.lData[k]/2));
long f;
switch (p1->GetSelection()) {
case 0: {
_String winTitle (windowTitle);
windowTitle = _String ("Tree ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
_HYTreePanel* newTreePanel = new _HYTreePanel (winTitle,winTitle);
newTreePanel->_Zoom(true);
newTreePanel->BringToFront();
//newTreePanel->Show();
} else {
_HYPlatformWindow* thisWindow = (_HYPlatformWindow*)windowObjects(f);
thisWindow->_Activate();
}
break;
}
case 1: {
_String winTitle (windowTitle);
windowTitle = _String ("DataSet ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
_HYDataPanel* newDataPanel = new _HYDataPanel (winTitle,winTitle);
newDataPanel->BringToFront();
} else {
_HYPlatformWindow* thisWindow = (_HYPlatformWindow*)windowObjects(f);
thisWindow->_Activate();
}
break;
}
case 2: {
_String winTitle (windowTitle);
windowTitle = _String ("Model ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
if (dl->cellTypes.lData[sel.lData[k]] & HY_TABLE_ITALIC) {
if (!warnModelOpen) {
windowTitle = _String ("Model \"") & winTitle & "\" is a template model, and it can't be opened. You can open a new model based on it, though.";
if (!warnModelOpen) {
if (!ProceedPromptWithCheck (windowTitle, donotWarnAgain, warnModelOpen)) {
break;
}
}
NewObject ();
break;
}
} else {
if (sel.lData[k]/2<modelTemplates.lLength) {
_List* modelSpec = FindModelTemplate (&winTitle);
if (modelSpec) {
OpenModelFromFile(*(_String*)(*modelSpec)(2));
}
} else {
OpenModelFromMatrix (winTitle);
}
}
} else {
_HYWindow* thisWindow = (_HYWindow*)windowObjectRefs(f);
thisWindow->BringToFront();
}
break;
}
case 3: {
_String winTitle (windowTitle);
windowTitle = _String ("Likelihood Function ")&windowTitle;
f = FindWindowByName (windowTitle);
if (f<0) {
f = likeFuncNamesList.Find(&winTitle);
if (f>=0) {
_HYParameterTable* newParameterTable = new _HYParameterTable (windowTitle,f);
newParameterTable->_Zoom(true);
newParameterTable->BringToFront();
}
} else {
_HYPlatformWindow* thisWindow = (_HYPlatformWindow*)windowObjects(f);
thisWindow->_Activate();
}
break;
}
}
}
}
}