long * DCirfile::IntArrRight(void) { if (SecFound) return SecFile->IntArrRight(); if (CurrRight == NULL) return NULL; if (!ListRight()) return NULL; long count = 0; char *chp = NULL; while ((chp = ListItem()) != NULL) { count++; DeleteName(chp); } long *ptr = new long[count + 1]; ListRight(); for (long i = 0; i < count; i++) { ptr[i] = atol(chp = ListItem()); DeleteName(chp); } ptr[count] = 0; return ptr; }
/* sets values in the show/hide list for structures */ NLM_EXTERN void Cn3D_SetStrucList(void) { PDNMS pdnmsMaster, pdnmsSlave; PMSD pmsdMaster, pmsdSlave; Int4 iCount = 0; Reset(Cn3D_lStruc); pdnmsMaster = GetSelectedModelstruc(); if (pdnmsMaster != NULL) { pmsdMaster = (PMSD) pdnmsMaster->data.ptrvalue; ListItem(Cn3D_lStruc, pmsdMaster->pcPDBName); SetItemStatus(Cn3D_lStruc, iCount + 1, pmsdMaster->bVisible); iCount++; pdnmsSlave = pmsdMaster->pdnmsSlaves; while (pdnmsSlave) { pmsdSlave = (PMSD) pdnmsSlave->data.ptrvalue; ListItem(Cn3D_lStruc, pmsdSlave->pcPDBName); SetItemStatus(Cn3D_lStruc, iCount + 1, pmsdSlave->bVisible); iCount++; pdnmsSlave = pdnmsSlave->next; } } }
static void /*FCN*/FillFeatList ( Boolean needHide ){ Int2 i; Int2 feat; CharPtr name; if ( needHide ){ Hide( featList ); Reset ( featList ); } for ( i=0; i<nHideFeatures; i++ ){ feat = featAr[i]; name = mSM_allfeatureNames[feat]; if ( (name==NULL) || (*name=='\0') ) ListItem ( featList, unknownName ); else ListItem ( featList, name ); } if ( nHideFeatures != totalFeatures ){ ListItem ( featList, "-- Hidden features --" ); for ( ; i<totalFeatures; i++ ){ feat = featAr[i]; name = mSM_allfeatureNames[feat]; if ( (name==NULL) || (*name=='\0') ) ListItem ( featList, unknownName ); else ListItem ( featList, name ); } } if ( needHide ) Show( featList); }
static void /*FCN*/FillGroupList ( Boolean needHide ){ Int2 i; CharPtr name; if ( needHide ){ Hide( groupList ); Reset ( groupList ); } for ( i=0; i<nHideGroups; i++ ){ name = (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS, groupAr[i],MSM_STRING); if ( (name == NULL) || (*name == 0) ) ListItem ( groupList, unknownName ); else ListItem ( groupList, name ); } if ( nHideGroups != totalGroups ) { ListItem ( groupList, "-- Hidden groups: --" ); for ( ; i<totalGroups; i++ ){ name = (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS, groupAr[i],MSM_STRING); if ( (name == NULL) || (*name == 0) ) ListItem ( groupList, unknownName ); else ListItem ( groupList, name ); } } if ( needHide ) { Show( groupList); } }
QList<ListItem> ListItem::convertList(QList<CatItem> cList){ QList<ListItem> res; for(int i=0; i< cList.count(); i++){ res.append(ListItem(cList[i])); } return res; }
static void ListItem(h5item *item) { char *name = strcpy(malloc(strlen(item->name)+1),item->name); char *tmp; h5item *itm; for (itm = item->parent; itm; itm=itm->parent) { tmp = malloc(strlen(name)+strlen(itm->name)+2); strcpy(tmp,itm->name); strcat(tmp,"/"); strcat(tmp,name); free(name); name = tmp; } free(name); if (item->attribute) ListItem(item->attribute); if (item->child) ListItem(item->child); if (item->brother) ListItem(item->brother); }
static void VarList( void ) { //========================= // Process one variable list in a DATA statement. OPR last_opr; OPR opr; int do_level; itnode *last_node; do_level = 0; last_opr = FindSlash( &last_node ); while( CITNode != last_node ) { if( AError ) break; if( RecTrmOpr() && ( CITNode != ITHead ) ) { --do_level; FinishImpDo(); } else if( StartImpDo() ) { ++do_level; } else if( ReqName( NAME_VAR_OR_ARR ) ) { InitVar = LkSym(); if( InitVar->u.ns.u1.s.typ == FT_STRUCTURE ) { // make sure structure size is calculated - normally // structure size is calculated by StructResolve() which // is not called until the first executable statement CalcStructSize( InitVar->u.ns.xt.sym_record ); } CkFlags(); opr = CITNode->opr; ProcDataExpr(); CITNode->opr = opr; ListItem(); if( !RecTrmOpr() ) { ReqComma(); } } else { AdvanceITPtr(); AError = true; break; } } if( AError ) { while( do_level != 0 ) { // clean up hanging do entrys TermDo(); --do_level; } } else { CITNode->opr = last_opr; ReqDiv(); } }
/* fill out domain list */ NLM_EXTERN void Cn3D_ListDomainProc(void) { Char MolName[20]; Int4 iCount = 0, iCountActive = 0; Reset(Cn3D_lFeature); for (iCount = 0; iCount < iDomainCount; iCount++) { domaindata[iCount]->bVisibleParent = GetItemStatus(Cn3D_lStruc, domaindata[iCount]->iStrucIndex + 1); } for (iCount = 0; iCount < iDomainCount; iCount++) { if (domaindata[iCount]->iDomain == 0) sprintf(MolName, "%4s %2s", domaindata[iCount]->pcPDBName, domaindata[iCount]->pcMolName); else sprintf(MolName, "%4s %2s %2d", domaindata[iCount]->pcPDBName, domaindata[iCount]->pcMolName, domaindata[iCount]->iDomain); if (domaindata[iCount]->bVisibleParent) { ListItem(Cn3D_lFeature, (CharPtr) MolName); iCountActive++; if (!GetStatus(Cn3D_bDisplayAlignedDomain)) SetItemStatus(Cn3D_lFeature, iCountActive, domaindata[iCount]->bVisible); else { if (domaindata[iCount]->bAligned) { SetItemStatus(Cn3D_lFeature, iCountActive, TRUE); domaindata[iCount]->bVisible = TRUE; } else if (!domaindata[iCount]->bAligned) { SetItemStatus(Cn3D_lFeature, iCountActive, FALSE); domaindata[iCount]->bVisible = FALSE; } } } } return; }
void ProcessList( void ) { //===================== // This procedure will process one 'thing' from the i/o list. A 'thing' is: // 1) initializing an implied DO // 2) finishing an implied DO // 3) an i/o list item if( RecTrmOpr() ) { FinishImpDo(); if( !RecTrmOpr() ) { ReqComma(); } } else if( !StartImpDo() ) { ProcIOExpr(); ListItem(); if( !RecTrmOpr() ) { ReqComma(); } } }
bool FileFilter::FilterEdit() { if (bMenuOpen) return false; Changed = true; bMenuOpen = true; int ExitCode; bool bNeedUpdate=false; const auto FilterList = VMenu2::create(MSG(MFilterTitle), nullptr, 0, ScrY - 6); FilterList->SetHelp(L"FiltersMenu"); FilterList->SetPosition(-1,-1,0,0); FilterList->SetBottomTitle(MSG(MFilterBottom)); FilterList->SetMenuFlags(/*VMENU_SHOWAMPERSAND|*/VMENU_WRAPMODE); FilterList->SetId(FiltersMenuId); std::for_each(RANGE(FilterData(), i) { MenuItemEx ListItem(MenuString(&i)); ListItem.SetCheck(GetCheck(i)); FilterList->AddItem(ListItem); });
/************************************************************************** * ReloadNames() **************************************************************************/ static void /*FCN*/ReloadNames ( void ){ Int2 i,total; Hide(namesList); Reset(namesList); total = Nlm_GetMuskTotalSt(); for ( i=0; i<total; i++ ) { ListItem ( namesList, Nlm_GetMuskStyleName(i) ); } SetValue ( namesList, Nlm_GetMuskCurrentSt()+1 ); Show(namesList); if ( Nlm_GetMuskCurrentSt() == 0 ){ Disable ( modifyButton ); Disable( deleteButton ); } else { Enable ( modifyButton ); Enable ( deleteButton ); } } /* End of ReloadNames() */
ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding) { // Try and grab the list ChanData* cd = extItem.get(channel); if (adding) { if (tidy) ModeParser::CleanMask(parameter); if (parameter.length() > 250) return MODEACTION_DENY; // If there was no list if (!cd) { // Make one cd = new ChanData; extItem.set(channel, cd); } // Check if the item already exists in the list for (ModeList::iterator it = cd->list.begin(); it != cd->list.end(); it++) { if (parameter == it->mask) { /* Give a subclass a chance to error about this */ TellAlreadyOnList(source, channel, parameter); // it does, deny the change return MODEACTION_DENY; } } if ((IS_LOCAL(source)) && (cd->list.size() >= GetLimitInternal(channel->name, cd))) { /* List is full, give subclass a chance to send a custom message */ TellListTooLong(source, channel, parameter); return MODEACTION_DENY; } /* Ok, it *could* be allowed, now give someone subclassing us * a chance to validate the parameter. * The param is passed by reference, so they can both modify it * and tell us if we allow it or not. * * eg, the subclass could: * 1) allow * 2) 'fix' parameter and then allow * 3) deny */ if (ValidateParam(source, channel, parameter)) { // And now add the mask onto the list... cd->list.push_back(ListItem(parameter, source->nick, ServerInstance->Time())); return MODEACTION_ALLOW; } else { /* If they deny it they have the job of giving an error message */ return MODEACTION_DENY; } } else { // We're taking the mode off if (cd) { for (ModeList::iterator it = cd->list.begin(); it != cd->list.end(); ++it) { if (parameter == it->mask) { cd->list.erase(it); return MODEACTION_ALLOW; } } } /* Tried to remove something that wasn't set */ TellNotSet(source, channel, parameter); return MODEACTION_DENY; } }
void main() { IFrameWindow frame("List box Custom Drawing"); DrawHandler listHandler; // Attach to the list box owner so that we get the // setSize events (WM_MEASUREITEM is sent during the // creation of the list box). listHandler.handleEventsFor(&frame); // Create a client area list box. IListBox list(0x8008, &frame, &frame, IRectangle(), IListBox::defaultStyle() | IWindow::saveBits); list .enableMultipleSelect() .enableDrawItem(); // Dummy up the data for each class in the // heirarchy. ListItem items[] = {ListItem("IBase", 0,true, false), ListItem("IVBase", 1,true, false), ListItem("IWindow", 2,true, false), ListItem("IControl", 3,true, false), ListItem("ICanvas", 4,true, true), ListItem("IContainerControl", 4,false,false), ListItem("IListBox", 4,false, false), ListItem("INotebook", 4,false, false), ListItem("IScrollBar", 4,false, false), ListItem("ISpinButton", 4,false, false), ListItem("ITextControl", 4,true, false), ListItem("IButton", 5,true, false), ListItem("IPushButton", 6,true, false), ListItem("IGraphicPushButton",7,false, false), ListItem("ISettingButton", 6,true, false), ListItem("I3StateCheckBox", 7,false, false), ListItem("ICheckBox", 7,false, false), ListItem("IRadioButton", 7,false, false), ListItem("IEntryField", 5,true, false), ListItem("IComboBox", 6,false, false), ListItem("IGroupBox", 5,false, false), ListItem("IMultiLineEdit", 5,false, false), ListItem("IStaticText", 5,true, false), ListItem("IBitmapControl", 6,false, true), ListItem("IInfoArea", 6,false, false), ListItem("ITitle", 5,false, false), ListItem("IFrameWindow", 3,true, false), ListItem("IFileDialog", 4,false, false), ListItem("IFontDialog", 4,false, false), ListItem("IHelpWindow", 3,false, false), ListItem("IMenu", 3,true, false), ListItem("IMenuBar", 4,false, false), ListItem("IPopUpMenu", 4,false, false), ListItem("ISubmenu", 4,false, false), ListItem("ISystemMenu", 4,false, false), ListItem("IObjectWindow", 3,false, false)}; // Add the items to the list box by creating an // IString from the item data address. for(int i=0; i< sizeof(items)/sizeof(ListItem); i++) { list.add(i, IString((unsigned long)&items[i])); } // Put the list box in the client and show the app. frame .setClient(&list) .setFocus() .show(); IApplication::current().run(); }