本文整理汇总了C++中LList::ValidIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ LList::ValidIndex方法的具体用法?C++ LList::ValidIndex怎么用?C++ LList::ValidIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LList
的用法示例。
在下文中一共展示了LList::ValidIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EclRemoveAllWindows
void EclRemoveAllWindows()
{
while( windows.ValidIndex(0) )
{
EclRemoveWindow( windows[0]->m_name );
}
}
示例2: ClickNewsButton
void NewsScreenInterface::ClickNewsButton ( Button *button )
{
int index;
sscanf ( button->name, "news_story %d", &index );
index += baseoffset;
// Dirty the old button
char oldname [128];
UplinkSnprintf ( oldname, sizeof ( oldname ), "news_story %d", currentselect - baseoffset );
EclDirtyButton ( oldname );
CompanyUplink *cu = (CompanyUplink *) game->GetWorld ()->GetCompany ( "Uplink" );
UplinkAssert ( cu );
if ( cu->GetNews (index) ) {
currentselect = index;
// Reset the offset so the player can read it from line 1
ScrollBox *scrollBox = ScrollBox::GetScrollBox( "news_details" );
if ( scrollBox ) {
scrollBox->SetCurrentIndex( 0 );
char *newDetails = cu->GetNews (index)->GetDetails();
Button *detailsButton = EclGetButton ( "news_details box" );
UplinkAssert (detailsButton);
LList <char *> *wrappedtext = wordwraptext ( newDetails, detailsButton->width );
if ( wrappedtext ) {
scrollBox->SetNumItems( wrappedtext->Size() );
if ( wrappedtext->ValidIndex (0) && wrappedtext->GetData (0) )
delete [] wrappedtext->GetData(0);
delete wrappedtext;
}
else {
scrollBox->SetNumItems( 0 );
}
}
EclRegisterCaptionChange ( "news_details box", cu->GetNews (index)->GetDetails (), 2000 );
}
}
示例3: EclRemoveAllWindowsExclude
void EclRemoveAllWindowsExclude( char *exclude){
while( windows.ValidIndex(0) )
{
EclRemoveWindow( windows[0]->m_name );
}
}
示例4: DrawDetails
void NewsScreenInterface::DrawDetails ( Button *button, bool highlighted, bool clicked )
{
UplinkAssert (button);
int screenheight = app->GetOptions ()->GetOptionValue ( "graphics_screenheight" );
glScissor ( button->x, screenheight - (button->y + button->height), button->width, button->height );
glEnable ( GL_SCISSOR_TEST );
// Get the offset
char name_base [128];
sscanf ( button->name, "%s", name_base );
ScrollBox *scrollBox = ScrollBox::GetScrollBox( name_base );
if ( !scrollBox ) return;
int offset = scrollBox->currentIndex;
// Draw the button
glBegin ( GL_QUADS );
SetColour ( "PanelBackgroundA" ); glVertex2i ( button->x, button->y + button->height );
SetColour ( "PanelBackgroundB" ); glVertex2i ( button->x, button->y );
SetColour ( "PanelBackgroundA" ); glVertex2i ( button->x + button->width, button->y );
SetColour ( "PanelBackgroundB" ); glVertex2i ( button->x + button->width, button->y + button->height );
glEnd ();
SetColour ( "PanelBorder" );
border_draw ( button );
// Draw the text
int maxnumlines = (button->height - 10 ) / 15;
SetColour ( "DefaultText" );
LList <char *> *wrappedtext = wordwraptext ( button->caption, button->width );
if ( wrappedtext ) {
for ( int i = offset; i < wrappedtext->Size (); ++i ) {
if ( i > maxnumlines + offset )
break;
int xpos = button->x + 10;
int ypos = button->y + 10 + (i-offset) * 15;
GciDrawText ( xpos, ypos, wrappedtext->GetData (i), HELVETICA_10 );
}
//DeleteLListData ( wrappedtext ); // Only delete first entry - since there is only one string really
if ( wrappedtext->ValidIndex (0) && wrappedtext->GetData (0) )
delete [] wrappedtext->GetData (0);
delete wrappedtext;
}
glDisable ( GL_SCISSOR_TEST );
}