本文整理汇总了C++中NextItem函数的典型用法代码示例。如果您正苦于以下问题:C++ NextItem函数的具体用法?C++ NextItem怎么用?C++ NextItem使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NextItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ListSort
void DBVPolyIF::FourColoring ()
{
char nameStr [DBStringLength];
DBInt symbol, maxSymbol = 0, line, index;
DBObjRecord *polyRec,*searchPoly, *neighborPolyRec, *lineRec, *symRec;
for (polyRec = FirstItem ();polyRec != (DBObjRecord *) NULL;polyRec = NextItem ())
SymbolFLD->Record (polyRec,(DBObjRecord *) NULL);
ListSort (LineNumFLD);
for (searchPoly = FirstItem ();searchPoly != (DBObjRecord *) NULL;searchPoly = NextItem ())
{
if (((DBInt) (SymbolFLD->Record (searchPoly) - (DBObjRecord *) NULL)) != 0) continue;
DBPause (searchPoly->RowID () * 100 / ItemNum ());
symbol = 1;
Restart:
for (polyRec = ItemTable->First (&index);polyRec != (DBObjRecord *) NULL;polyRec = ItemTable->Next (&index))
{
if (strcmp (polyRec->Name (),searchPoly->Name ()) != 0) continue;
lineRec = FirstLine (polyRec);
for (line = 0;line <= LineNum (polyRec);++line)
{
if (LineRightPoly (lineRec) == polyRec)
{
neighborPolyRec = LineLeftPoly (lineRec);
lineRec = LineNextLine (lineRec);
}
else
{
neighborPolyRec = LineRightPoly (lineRec);
lineRec = LinePrevLine (lineRec);
}
if (neighborPolyRec == (DBObjRecord *) NULL) continue;
if (SymbolFLD->Record (neighborPolyRec) == (DBObjRecord *) symbol)
{ symbol++; goto Restart; }
}
}
for (polyRec = ItemTable->First (&index);polyRec != (DBObjRecord *) NULL;polyRec = ItemTable->Next (&index))
if (strcmp (polyRec->Name (),searchPoly->Name ()) == 0) SymbolFLD->Record (polyRec,(DBObjRecord *) symbol);
maxSymbol = maxSymbol > symbol ? maxSymbol : symbol;
}
while (maxSymbol < SymbolTable->ItemNum ()) SymbolTable->Remove (SymbolTable->ItemNum () - 1);
while (maxSymbol > SymbolTable->ItemNum ()) SymbolTable->Add ();
for (symbol = 0;symbol < SymbolTable->ItemNum ();++symbol)
{
symRec = SymbolTable->Item (symbol);
sprintf (nameStr,"Symbol:%2d",symbol);
symRec->Name (nameStr);
StyleFLD->Int (symRec,0);
ForegroundFLD->Int (symRec,1);
BackgroundFLD->Int (symRec,0);
}
for (polyRec = FirstItem ();polyRec != (DBObjRecord *) NULL;polyRec = NextItem ())
SymbolFLD->Record (polyRec,SymbolTable->Item ((DBInt) (SymbolFLD->Record (polyRec) - (DBObjRecord *) NULL) - 1));
ListReset ();
}
示例2: SHRemoveDataBlock
/*************************************************************************
* @ [SHLWAPI.21]
*
* Remove an item from a DataBlock list.
*
* PARAMS
* lppList [O] List to remove the item from
* ulId [I] Id of item to remove
*
* RETURNS
* Success: TRUE.
* Failure: FALSE, If any parameters are invalid, or the item was not found.
*
* NOTES
* See SHWriteDataBlockList.
*/
BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId)
{
LPSHLWAPI_CLIST lpList = 0;
LPSHLWAPI_CLIST lpItem = NULL;
LPSHLWAPI_CLIST lpNext;
ULONG ulNewSize;
TRACE("(%p,%ld)\n", lppList, ulId);
if(lppList && (lpList = *lppList))
{
/* Search for item in list */
while (lpList->ulSize)
{
if(lpList->ulId == ulId ||
(lpList->ulId == CLIST_ID_CONTAINER && lpList[1].ulId == ulId))
{
lpItem = lpList; /* Found */
break;
}
lpList = NextItem(lpList);
}
}
if(!lpItem)
return FALSE;
lpList = lpNext = NextItem(lpItem);
/* Locate the end of the list */
while (lpList->ulSize)
lpList = NextItem(lpList);
/* Resize the list */
ulNewSize = LocalSize((HLOCAL)*lppList) - lpItem->ulSize;
/* Copy following elements over lpItem */
memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG));
if(ulNewSize <= sizeof(ULONG))
{
LocalFree((HLOCAL)*lppList);
*lppList = NULL; /* Removed the last element */
}
else
{
lpList = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)*lppList, ulNewSize,
LMEM_ZEROINIT|LMEM_MOVEABLE);
if(lpList)
*lppList = lpList;
}
return TRUE;
}
示例3: SHRemoveDataBlock
/*************************************************************************
* @ [SHLWAPI.21]
*
* Remove an item from a DataBlock list.
*
* PARAMS
* lppList [O] List to remove the item from
* dwSignature [I] Id of item to remove
*
* RETURNS
* Success: TRUE.
* Failure: FALSE, If any parameters are invalid, or the item was not found.
*
* NOTES
* See SHWriteDataBlockList.
*/
BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
{
LPDATABLOCK_HEADER lpList = 0;
LPDATABLOCK_HEADER lpItem = NULL;
LPDATABLOCK_HEADER lpNext;
ULONG ulNewSize;
TRACE("(%p,%d)\n", lppList, dwSignature);
if(lppList && (lpList = *lppList))
{
/* Search for item in list */
while (lpList->cbSize)
{
if(lpList->dwSignature == dwSignature ||
(lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature))
{
lpItem = lpList; /* Found */
break;
}
lpList = NextItem(lpList);
}
}
if(!lpItem)
return FALSE;
lpList = lpNext = NextItem(lpItem);
/* Locate the end of the list */
while (lpList->cbSize)
lpList = NextItem(lpList);
/* Resize the list */
ulNewSize = LocalSize(*lppList) - lpItem->cbSize;
/* Copy following elements over lpItem */
memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG));
if(ulNewSize <= sizeof(ULONG))
{
LocalFree(*lppList);
*lppList = NULL; /* Removed the last element */
}
else
{
lpList = LocalReAlloc(*lppList, ulNewSize, LMEM_ZEROINIT|LMEM_MOVEABLE);
if(lpList)
*lppList = lpList;
}
return TRUE;
}
示例4: md5_starts
uint32 mhmakefileparser::CreateEnvMd5_32() const
{
md5_context ctx;
string Md5;
string EnvVars=ExpandVar(USED_ENVVARS);
const char *pTmp=EnvVars.c_str();
// Now create the md5 string
md5_starts( &ctx );
DBGOUT(cout << "MD5 of " << m_MakeDir->GetQuotedFullFileName() << endl);
while (*pTmp)
{
string Var;
pTmp=NextItem(pTmp,Var,";");
if (!SkipVar(Var))
{
string Val=ExpandVar(Var);
transform(Val.begin(),Val.end(),Val.begin(),(int(__CDECL *)(int))toupper);
DBGOUT(cout << GetMakeDir()->GetQuotedFullFileName() << " -> Setting GetFromEnv var " << Var << " to " << Val << endl);
md5_update( &ctx, (uint8 *) Var.c_str(), (unsigned long)Var.size());
md5_update( &ctx, (uint8 *) "=", 1);
md5_update( &ctx, (uint8 *) Val.c_str(), (unsigned long)Val.size());
}
}
return md5_finish32( &ctx);
}
示例5: while
bool mhmakefileparser::SkipHeaderFile(const string &FileName)
{
if (!m_SkipHeadersInitialized)
{
m_SkipHeadersInitialized=true;
string HeadersToSkip=ExpandVar(SKIPHEADERS);
const char *pTmp=HeadersToSkip.c_str();
while (*pTmp)
{
string Item;
pTmp=NextItem(pTmp,Item);
if (Item.find('%')==string::npos)
{
m_SkipHeaders.insert(Item);
}
else
{
m_PercentHeaders.push_back(Item);
}
}
}
if (m_SkipHeaders.find(FileName)!=m_SkipHeaders.end())
return true;
vector<string>::const_iterator It=m_PercentHeaders.begin();
vector<string>::const_iterator ItEnd=m_PercentHeaders.end();
while (It!=ItEnd)
{
if (PercentMatch(FileName,*It++))
return true;
}
return false;
}
示例6: switch
DBObjRecord *DBVectorIF::Item (DBCoordinate coord) const
{
DBObjRecord *record, *retRecord = (DBObjRecord *) NULL;
switch (DataPTR->Type ())
{
case DBTypeVectorPoint:
{
DBFloat dist, minDist = DBHugeVal;
DBObjTableField *coordFLD = ItemTable->Field (DBrNCoord);
DBMathDistanceFunction distFunc = DBMathGetDistanceFunction (DataPTR);
for (record = FirstItem ();record != (DBObjRecord *) NULL;record = NextItem ())
{
dist = DBMathCoordinateDistance (distFunc,coord,coordFLD->Coordinate (record));
if (dist < minDist) { minDist = dist; retRecord = record; }
}
} break;
case DBTypeVectorLine: break;
case DBTypeVectorPolygon: break;
default: CMmsgPrint (CMmsgAppError, "Unknown Vector Data Type in: %s %d",__FILE__,__LINE__); break;
}
return (retRecord);
}
示例7: OnKey
bool OnKey(IInputProvider* pprovider, const KeyState& ks, bool& fForceTranslate)
{
VerifyScrollPos();
if (ks.bDown) {
switch (ks.vk) {
case VK_DOWN:
NextItem();
SelectionChanged();
return true;
case VK_UP:
PreviousItem();
SelectionChanged();
return true;
case VK_PRIOR: // page up
PageUp();
SelectionChanged();
return true;
case VK_NEXT: // page down
PageDown();
SelectionChanged();
return true;
}
}
return false;
}
示例8: al_wait_for_event
void CMenuState::HandleEvents(CGameEngine* game)
{
ALLEGRO_EVENT ev;
// wait for an event (mouse movement, key press, etc.)
al_wait_for_event(game->event_queue, &ev);
switch(ev.type) {
case ALLEGRO_EVENT_DISPLAY_CLOSE:
game->Quit();
break;
case ALLEGRO_EVENT_KEY_DOWN:
if(ev.keyboard.keycode == ALLEGRO_KEY_ESCAPE)
game->Quit();
else if(ev.keyboard.keycode == ALLEGRO_KEY_RIGHT)
NextItem();
else if(ev.keyboard.keycode == ALLEGRO_KEY_LEFT)
PrevItem();
else if(ev.keyboard.keycode == ALLEGRO_KEY_ENTER || ev.keyboard.keycode == ALLEGRO_KEY_SPACE)
items[menuIndex]->Activate(game);
break;
}
}
示例9: PageDown
void PageDown()
{
int delta = GetSignificantSize() / GetSignificantSize(*m_ppainter);
while (delta > 0) {
NextItem();
delta--;
}
}
示例10: Next
static bool Next( playlist_t *p_playlist )
{
playlist_item_t *p_item = NextItem( p_playlist );
if( p_item == NULL )
return false;
msg_Dbg( p_playlist, "starting playback of new item" );
ResyncCurrentIndex( p_playlist, p_item );
return PlayItem( p_playlist, p_item );
}
示例11: LoopRequest
static void LoopRequest( playlist_t *p_playlist )
{
playlist_private_t *p_sys = pl_priv(p_playlist);
assert( !p_sys->p_input );
/* No input. Several cases
* - No request, running status -> start new item
* - No request, stopped status -> collect garbage
* - Request, running requested -> start new item
* - Request, stopped requested -> collect garbage
*/
const int i_status = p_sys->request.b_request ?
p_sys->request.i_status : p_sys->status.i_status;
if( i_status == PLAYLIST_STOPPED || !vlc_object_alive( p_playlist ) )
{
p_sys->status.i_status = PLAYLIST_STOPPED;
if( p_sys->p_input_resource &&
input_resource_HasVout( p_sys->p_input_resource ) )
{
/* XXX We can unlock if we don't issue the wait as we will be
* call again without anything else done between the calls */
PL_UNLOCK;
/* input_resource_t must be manipulated without playlist lock */
input_resource_TerminateVout( p_sys->p_input_resource );
PL_LOCK;
}
else
{
if( vlc_object_alive( p_playlist ) )
vlc_cond_wait( &p_sys->signal, &p_sys->lock );
}
return;
}
playlist_item_t *p_item = NextItem( p_playlist );
if( p_item )
{
msg_Dbg( p_playlist, "starting playback of the new playlist item" );
PlayItem( p_playlist, p_item );
return;
}
msg_Dbg( p_playlist, "nothing to play" );
p_sys->status.i_status = PLAYLIST_STOPPED;
if( var_GetBool( p_playlist, "play-and-exit" ) )
{
msg_Info( p_playlist, "end of playlist, exiting" );
libvlc_Quit( p_playlist->p_libvlc );
}
}
示例12: Button
MouseResult Button(
IInputProvider* pprovider,
const Point& point,
int button,
bool bCaptured,
bool bInside,
bool bDown
) {
VerifyScrollPos();
if (button == 0 && bDown) {
int nSize = GetSignificantSize(*m_ppainter);
int nSignificantMouseDim = (int)(m_bHorizontal ? point.X(): point.Y());
SetSelection(m_plist->GetItem((nSignificantMouseDim + GetScrollPos()) / nSize));
NeedPaint();
SelectionChanged();
if (pprovider->IsDoubleClick()) {
m_peventDoubleClick->Trigger();
}
else {
m_peventSingleClick->Trigger();
}
}
else if(button == 1 && bDown)
{
int nSize = GetSignificantSize(*m_ppainter);
int nSignificantMouseDim = (int)(m_bHorizontal ? point.X(): point.Y());
SetSelection(m_plist->GetItem((nSignificantMouseDim + GetScrollPos()) / nSize));
NeedPaint();
SelectionChanged();
if (pprovider->IsDoubleClick()) {
m_peventDoubleRightClick->Trigger();
}
else {
m_peventSingleRightClick->Trigger();
}
} else if(button == 8 && bDown) { //Imago 8/14/09 mouse wheel
NextItem();
SelectionChanged();
} else if(button == 9 && bDown) {
PreviousItem();
SelectionChanged();
}
return MouseResult();
}
示例13: NextItem
CObject* Search::FindNextObjectOfType( void )
{
CObject* obj = NextItem();
while ( obj )
{
Dbg_AssertType( obj, CObject );
if ( obj->GetType() == obj_type )
{
return obj;
}
obj = NextItem();
}
return obj;
}
示例14: casesin
/*****************************************************************************
*
* casesin takes a list of selections 'tptr' and returns the number of
* distinct selections (including an ELSE if one present).
*
*****************************************************************************/
PRIVATE int casesin (treenode * tptr)
{
int n = 0;
for (; !EndOfList (tptr); tptr = NextItem (tptr)) {
treenode *thisguard = CondGuardOf (skipspecifications (ThisItem (tptr)));
if (TagOf (thisguard) == S_ELSE)
n++;
else
n += listitems (thisguard);
}
return (n);
}
示例15: while
long
DCirfile::GetItemCount(void)
{
long count = 0;
while (NextItem())
count++;
Section(CurrSectName);
return count;
}