/*ARGSUSED*/ static void XawListInitialize(Widget temp1, Widget cnew, ArgList args, Cardinal *num_args) { ListWidget lw = (ListWidget)cnew; /* * Initialize all private resources */ /* record for posterity if we are free */ lw->list.freedoms = ((XtWidth(lw) != 0) * WidthLock + (XtHeight(lw) != 0) * HeightLock + (lw->list.longest != 0) * LongestLock); GetGCs(cnew); /* Set row height, based on font or fontset */ if (lw->simple.international == True) lw->list.row_height = XExtentsOfFontSet(lw->list.fontset)->max_ink_extent.height + lw->list.row_space; else lw->list.row_height = lw->list.font->max_bounds.ascent + lw->list.font->max_bounds.descent + lw->list.row_space; ResetList(cnew, WidthFree(lw), HeightFree(lw)); lw->list.highlight = lw->list.is_highlighted = NO_HIGHLIGHT; }
void ODSItemState :: ResetState ( ) { ResetValue(); ResetList(); }
void MainExitServer() { lprintf("ExitServer terminating server\n"); ExitAsyncConnections(); CloseAllSessions(); /* gotta do this before anything, cause it uses kod, accounts */ CloseDefaultChannels(); ResetLoadMotd(); ResetLoadBof(); ResetTable(); ResetBufferPool(); ResetSysTimer(); ResetDLlist(); ResetNameID(); ResetAccount(); ResetUser(); ResetString(); ResetRoomData(); ResetResource(); ResetTimer(); ResetList(); ResetObject(); ResetMessage(); ResetClass(); ResetConfig(); DeleteAllBlocks(); }
void CJmcHotkeyPage::GroupListChanged() { m_cGroupList.Reinit(); m_cGroup.Reinit (FALSE); // init columns ResetList(); SetControls(); }
void CTracker::CreateList (void) { int a; ResetList (); if (!(a = FindArg ("-internal_tracker")) || atoi (pszArgList [a + 1])) { Add (&d2xTracker); Add (&kbTracker); } AddFromCmdLine (); }
void CCustCommissionDialog::OnBnClickedButtonQuery() { // TODO: 在此添加控件通知处理程序代码 CString cust_no = m_ctlCust.GetCurSelKey(); if (cust_no.GetLength() == 0) return; BCRequestQryCustCommissionRate_851305(m_handle, cust_no.GetBuffer(), m_ccrs); ResetList(); }
void CTracker::DestroyList (void) { tServerListTable *pslt; while (serverListTable) { pslt = serverListTable; serverListTable = serverListTable->nextList; delete pslt; pslt = NULL; } ResetList (); }
void InterfaceReloadSystem() { EnterServerLock(); lprintf("InterfaceReloadSystem reloading system\n"); PauseTimers(); SendBlakodBeginSystemEvent(SYSEVENT_RELOAD_SYSTEM); GarbageCollect(); SaveAll(); ResetAdminConstants(); ResetUser(); ResetString(); ResetRoomData(); ResetLoadMotd(); ResetLoadBof(); ResetDLlist(); ResetNameID(); ResetResource(); ResetTimer(); ResetList(); ResetObject(); ResetMessage(); ResetClass(); LoadMotd(); LoadBof(); LoadRsc(); LoadKodbase(); UpdateSecurityRedbook(); LoadAdminConstants(); /* can't reload accounts because sessions have pointers to accounts */ if (!LoadAllButAccount()) eprintf("InterfaceReloadSystem couldn't load game. You are dead.\n"); AllocateParseClientListNodes(); /* it needs a list to send to users */ AddBuiltInDLlist(); SendBlakodEndSystemEvent(SYSEVENT_RELOAD_SYSTEM); UnpauseTimers(); LeaveServerLock(); }
void FillList( PSI_CONTROL list,PMACRO_BUTTON button ) { if( list ) { PMACRO_ELEMENT pme = button->elements; ResetList( list ); while( pme ) { SetItemData( AddListItem( list, (pme->button->text&&pme->button->text[0])?pme->button->text:pme->button->pTypeName ), (uintptr_t)pme ); //SetItemText( pli, (pme->button->text&&pme->button->text[0])?pme->button->text:pme->button->pTypeName ); pme = NextThing( pme ); } } }
static void ConfigureMacroButton( PMACRO_BUTTON button, PSI_CONTROL parent ) { PSI_CONTROL frame = LoadXMLFrameOver( parent, WIDE( "ConfigureMacroButton.isFrame" ) ); if( frame ) { int okay = 0; int done = 0; l.configuration_parent = parent; SetCommonButtons( frame, &done, &okay ); { PSI_CONTROL list; SetListboxIsTree( list = GetControl( frame, LIST_CONTROL_TYPES ), 1 ); ResetList( list ); FillControlsList( list, 1, TASK_PREFIX WIDE( "/control" ), NULL ); SetCommonButtonControls( frame ); SetButtonPushMethod( GetControl( frame, BUTTON_ADD_CONTROL ), AddButtonType, (uintptr_t)button ); //SetButtonPushMethod( GetControl( frame, BUTTON_EDIT_CONTROL ), AddButtonType, (uintptr_t)button ); { PSI_CONTROL list = GetControl( frame, LIST_MACRO_ELEMENTS ); if( list ) { PMACRO_ELEMENT pme = button->elements; while( pme ) { SetItemData( AddListItem( list, (pme->button->text&&pme->button->text[0])?pme->button->text:pme->button->pTypeName ), (uintptr_t)pme ); pme = NextThing( pme ); } } } SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_UP ), MoveElementUp, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_CLONE ), MoveElementClone, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_CLONE_ELEMENT ), CloneElement, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_DOWN ), MoveElementDown, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_CONFIGURE ), ConfigureElement, (uintptr_t)button ); SetButtonPushMethod( GetControl( frame, BUTTON_ELEMENT_REMOVE ), MoveElementRemove, (uintptr_t)button ); } DisplayFrameOver( frame, parent ); CommonWait( frame ); if( okay ) { GetCommonButtonControls( frame ); } DestroyFrame( &frame ); } }
BOOL CJmcHotkeyPage::OnInitDialog() { CPropertyPage::OnInitDialog(); //vls-begin// grouped hotkeys AddPage("hotkey", this); m_ImageList.Create(IDB_GROUP_ICONS, 16 , 2, (COLORREF)0xFFFFFF); //vls-end// DWORD Exstyle = ListView_GetExtendedListViewStyle(m_cHotkeysList.GetSafeHwnd()); Exstyle += LVS_EX_FULLROWSELECT; ListView_SetExtendedListViewStyleEx(m_cHotkeysList.GetSafeHwnd () , 0 , Exstyle); CString t; t.LoadString(IDS_KP_KEY_COL); m_cHotkeysList.InsertColumn (0 , t , LVCFMT_LEFT , 100 ); t.LoadString(IDS_AP_TEXT_COL); m_cHotkeysList.InsertColumn (1 , t , LVCFMT_LEFT , 200 ); //vls-begin// grouped hotkeys t.LoadString(IDS_AP_GROUP_COL); m_cHotkeysList.InsertColumn (2 , t , LVCFMT_LEFT , 100 ); m_cHotkeysList.SetImageList(&m_ImageList, LVSIL_SMALL); //vls-end// // fill list int size; PPCHotKey ppHot = GetHotList(&size); for ( int i = 0 ; i < size ; i++ ) { AddItem(ppHot[i]); } m_cHotkeysList.SortItems(HkeyCompareFunc, 0); m_wndHotCtrl.SubclassDlgItem(IDC_KEY, this); //vls-begin// grouped hotkeys // init group list m_cGroupList.Reinit(); m_cGroup.Reinit (FALSE); ResetList(); //vls-end// SetControls(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
Clef *Layer::GetClef(LayerElement *test) { Object *testObject = test; if (!test) { return GetCurrentClef(); } // make sure list is set ResetList(this); if (!test->Is(CLEF)) { testObject = GetListFirstBackward(testObject, CLEF); } if (testObject && testObject->Is(CLEF)) { Clef *clef = dynamic_cast<Clef *>(testObject); assert(clef); return clef; } return GetCurrentClef(); }
void CPROC ReadComplete( PCLIENT pc, POINTER buffer, size_t size ) { static uint64_t LastMessage; // this is safe - only ONE connection EVER uint64_t test; int ToRead = 8; if( !buffer ) { Log( WIDE("Initial Read issued allocated buffer...read events a go.") ); buffer = Allocate( 1024 ); } else { ((TEXTCHAR*)buffer)[size] = 0; if( !LastMessage ) { Log1( WIDE("Message is: %8.8s"), buffer ); if( *(uint64_t*)buffer == *(uint64_t*)"USERLIST" ) { Log1( WIDE("Message is: USERLIST!!"), buffer ); ToRead = 2; LastMessage = *(uint64_t*)buffer; Log1( WIDE("Last Message is: %8.8s"), &LastMessage ); } else if( *(uint64_t*)buffer == *(uint64_t*)"USERDEAD" ) { BasicMessageBox( WIDE("Relay Responce"), WIDE("User has been terminated!") ); RemoveClient( pc ); } else if( *(uint64_t*)buffer == *(uint64_t*)"ALL DONE" ) { RemoveClient( pc ); } else if( *(uint64_t*)buffer == *(uint64_t*)"MESSAGE!" || *(uint64_t*)buffer == *(uint64_t*)"WINNERS:" ) { ToRead = 1; LastMessage = *(uint64_t*)buffer; } else if( *(uint64_t*)buffer == *(uint64_t*)"MASTERIS" ) { LastMessage = *(uint64_t*)buffer; } else { printf( WIDE("Unknown responce from relay: %8.8s"), buffer ); } } else { Log1( WIDE("Continuing message: %8.8s"), &LastMessage ); if( LastMessage == *(uint64_t*)"MESSAGE!" || LastMessage == *(uint64_t*)"WINNERS:" ) { Log( WIDE("(1)") ); ToRead = *(uint8_t*)buffer; LastMessage++; } else if( (test = ((*(uint64_t*)"WINNERS:")+1)), (LastMessage == test) ) { PCONTROL pcList = GetControl( frame, LST_WINNERS ); TEXTCHAR *winnerlist = (TEXTCHAR*)buffer; TEXTCHAR *endline, lastchar; ResetList( pcList ); winnerlist[size] = 0; Log2( WIDE("Got %d bytes of data:%s"), size, winnerlist ); endline = winnerlist; do { while( endline[0] && ( endline[0] != ',' && endline[0] != ':' ) ) { if( endline[0] == 3 ) endline[0] = ' '; // space fill this... endline++; } lastchar = endline[0]; //if( endline[0] ) { endline[0] = 0; AddListItem( pcList, winnerlist ); if( lastchar ) { winnerlist = endline+1; while( winnerlist[0] && winnerlist[0] == ' ' ) winnerlist++; endline = winnerlist; } } } while( endline[0] ); LastMessage = 0; } else if( (test = ((*(uint64_t*)"MESSAGE!")+1)), (LastMessage == test) ) { Log( WIDE("(2)") ); BasicMessageBox( WIDE("Relay Message"), DupCharToText( (char*)buffer ) ); LastMessage = 0; } else if( LastMessage == *(uint64_t*)"MASTERIS" ) { if( *(uint64_t*)buffer == *(uint64_t*)"ABSENT.." ) { SetControlText( GetControl( frame, CHK_MASTER ), WIDE("Game Master is absent") ); } else if( *(uint64_t*)buffer == *(uint64_t*)"PRESENT!" ) { SetControlText( GetControl( frame, CHK_MASTER ), WIDE("Game Master is PRESENT") ); } else { BasicMessageBox( WIDE("Master Status"), WIDE("Unknown Responce...") ); } LastMessage = 0; RemoveClient( pc ); } else if( LastMessage == (*(uint64_t*)"USERLIST") ) { Log( WIDE("(3)") ); ToRead = *(uint16_t*)buffer; Log1( WIDE("User list with size of %d"), ToRead ); LastMessage++; } else if( (test = ((*(uint64_t*)"USERLIST")+1) ), (LastMessage == test) ) { PCONTROL pcList = GetControl( frame, LST_USERS ); TEXTCHAR *userlist = (TEXTCHAR*)buffer; TEXTCHAR *endline; //Log1( WIDE("Got %d bytes of data..."), size ); ResetList( pcList ); userlist[size] = 0; endline = userlist; do { while( endline[0] && endline[0] != '\n' ) { if( endline[0] == 3 ) endline[0] = ' '; // space fill this... endline++; } if( endline[0] ) { TEXTCHAR *endname; TEXTCHAR *realname; PLISTITEM hli; endline[0] = 0; hli = AddListItem( pcList, userlist ); endname = userlist; while( endname[0] != ' ' ) endname++; endname[0] = 0; realname = NewArray( TEXTCHAR, ( endname - userlist ) + 1 ); StrCpyEx( realname, userlist, max( ( endname - userlist ), size ) ); SetItemData( hli, (uintptr_t)realname ); endline++; userlist = endline; } } while( endline[0] ); LastMessage = 0; RemoveClient( pc ); } else { Log1( WIDE("Unknonw Continuation state for %8.8s"), &LastMessage ); } } } ReadTCPMsg( pc, buffer, ToRead ); }
void UserList2(int mode) { DIR *dp; FILE *statefp; char fname[256]; USERSTATE udata; int i,x=0; struct dirent *dirinfo; struct stat st; Data userdat; Header h; CreateList(&h); printf("\x1b[0mRetrieving List.."); fflush(stdout); sprintf(fname,"%s/users/",BBSDIR); dp = opendir(fname); while((dirinfo = readdir(dp)) != NULL) { if(dirinfo->d_name[0] == '.') continue; sprintf(fname,"%s/users/%s/state",BBSDIR,dirinfo->d_name); if((statefp = fopen(fname,"rb")) != NULL) { if(fread((char *)&udata,sizeof(USERSTATE),1,statefp) == 1) { strcpy(userdat.name,dirinfo->d_name); userdat.time_laston = udata.time_laston; userdat.no_calls = udata.no_calls; userdat.no_posts = udata.no_posts; userdat.no_drops = udata.no_drops; userdat.time_posting = udata.time_posting; if(mode == NON_MEMBERS) { sprintf(fname,"%s/users/%s/keycode",BBSDIR,dirinfo->d_name); if(!stat(fname,&st)) {/** if keycode **/ AddItem(&h, &userdat); x++; } } else { sprintf(fname,"%s/users/%s/keycode",BBSDIR,dirinfo->d_name); if(stat(fname,&st)) {/** if no keycode **/ AddItem(&h, &userdat); x++; } } } fclose(statefp); } } closedir(dp); printf("\n\033[0;35mCounted \033[1;35m%d \033[0;35mUser(s)\n\n",x); Pause2(); printf("\n"); Sort(&h); ResetList(&h); PrintListHeader(); i=0; while(NextItem(&h)) { if(i>(rows-6)) { fflush(stdout); if(!More2()) { printf("\n"); return; } printf("\n"); i=0; PrintListHeader(); } GetItem(h,&userdat); sprintf(fname,"%s/users/%s/user_profile",BBSDIR,userdat.name); if(stat(fname,&st)) printf("\x1b[0m%-17.17s", userdat.name); else printf("\x1b[1;33m%-17.17s", userdat.name); printf("\x1b[0;35m%5.1f", ((time(NULL) - userdat.time_laston )/86400.0)); printf("\x1b[32m%4d", userdat.no_calls); printf("\x1b[31m%4d", userdat.no_posts); printf("\x1b[33m%2d ", userdat.no_drops); printf("\x1b[34m%d\n", userdat.time_posting); i++; fflush(stdout); } printf("\n"); ClearList(&h); return; }
void CJmcHotkeyPage::OnSelchangeGroups() { ResetList(); }
void OverviewPlaylistWidget::contextMenuEvent(QContextMenuEvent *pContextMenuEvent) { QAction *tAction; QMenu tMenu(this); if (!mLwFiles->selectedItems().isEmpty()) { tAction = tMenu.addAction("Play selected"); QIcon tIcon0; tIcon0.addPixmap(QPixmap(":/images/22_22/Audio_Play.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon0); tMenu.addSeparator(); } tAction = tMenu.addAction("Add an entry"); QIcon tIcon1; tIcon1.addPixmap(QPixmap(":/images/22_22/Plus.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon1); if (!mLwFiles->selectedItems().isEmpty()) { tAction = tMenu.addAction("Rename selected"); QIcon tIcon15; tIcon15.addPixmap(QPixmap(":/images/22_22/Contact_Edit.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon15); tAction = tMenu.addAction("Delete selected"); QIcon tIcon2; tIcon2.addPixmap(QPixmap(":/images/22_22/Minus.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon2); } tMenu.addSeparator(); if (GetListSize() > 0) { tAction = tMenu.addAction("Reset playlist"); QIcon tIcon3; tIcon3.addPixmap(QPixmap(":/images/22_22/Reload.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon3); tMenu.addSeparator(); } tAction = tMenu.addAction("Endless loop"); tAction->setCheckable(true); tAction->setChecked(mEndlessLoop); QAction* tPopupRes = tMenu.exec(pContextMenuEvent->globalPos()); if (tPopupRes != NULL) { if (tPopupRes->text().compare("Play selected") == 0) { ActionPlay(); return; } if (tPopupRes->text().compare("Add an entry") == 0) { AddEntryDialog(); return; } if (tPopupRes->text().compare("Rename selected") == 0) { RenameDialog(); return; } if (tPopupRes->text().compare("Delete selected") == 0) { DelEntryDialog(); return; } if (tPopupRes->text().compare("Reset playlist") == 0) { ResetList(); return; } if (tPopupRes->text().compare("Endless loop") == 0) { mEndlessLoop = !mEndlessLoop; LOG(LOG_VERBOSE, "Playlist has now endless loop activation %d", mEndlessLoop); return; } } }
// Object bearbeiten ---------------------------------------------------------- int end_previous_object (void) { long irc = 0L; lgi++; /* Geometriezaehler korrigieren */ if (lgi < koord_paare) return (db_error (EGCNT, ASCPARSER, yylineno)); // bevor irgend etwas passiert Header neu einlesen if (g_fReReadHeader) { DEXN_ReReadHeader(); DEXN_ReScale(); g_fReReadHeader = false; // nur einmal } // auswerten ob Komplexobjekt if (lgi == 0) { if (RelCount() == 0) return db_error (EBADKO, ASCPARSER, yylineno); if (!r_flag) return EOKAY; // keine Relationen, keine KomplexObjekte sta[0] = K_OBJEKT; // Status setzen sta[1] = 0; } HPROJECT hPr = DEX_GetDataSourceHandle(); _ASSERTE(NULL != hPr); irc = CreateObject (on, id, sta, mi, lgi, gxi, gyi); if (g_flag) { // evtl. ObjectGuid setzen if (irc && '\0' != guid[0]) { OBJECTGUID OUID; INITSTRUCT (OUID, OBJECTGUID); OUID.lONr = on; if (SUCCEEDED(CLSIDFromString (WideString(guid), &OUID.guid))) { // versuchen über GUID zu finden if (FAILED(DEX_FindObjectFromGuidEx (hPr, OUID))) { // alten Guid wieder setzen HRESULT hr = DEX_SetObjectGuid (OUID); // if (FAILED(hr) && HRESULT_FROM_ERRCODE(S_DUPLICATE) == hr) { // TX_ASSERT(0 != OUID.lONr); // Objekt muß existieren // // // GUID bereits in GeoDB vorhanden !!?? // irc = S_DUPLICATE; // // // neu erzeugtes Objekt löschen // DEX_DeleteObject (on); // CountObjects (sta[1], false); // // // Geometrie an existierendem Objekt korrigieren // on = OUID.lONr; // hier spielt die Musik // irc = CreateObject (on, id, sta, mi, lgi, gxi, gyi); // } } } } } else irc = UpdateFeatures (hPr, on, id, sta, mi); // evtl. zur AusgabeObjektmenge hinzufügen if (irc && g_Enum.IsValid()) g_Enum -> AddItem (on); // Protocoll, Relationen etc. bool fBreak = false; if (NULL != g_pDlg) { if (irc) g_pDlg -> SetPos (ftell (yyin), on); fBreak = g_pDlg -> Break(); } if (fpProt) fprintf (fpProt, "Satz %5ld, Objekt %5ld: Irc = %3ld\n", satz_nr, on, irc); if (irc && r_flag) { if (RelCount()) { // Relationen aufbauen long lONr, lRCode; short iRTyp; ResetList(); while (RetrieveNextFromList (&lONr, &lRCode, &iRTyp)) CreateRelation (on, lONr, lRCode, iRTyp); ClearList(); } // Zuordnung Objekt <--> SatzNummer für Relationen merken StoreInTree (on, satz_nr); } return fBreak; }
void GOSoundScheduler::Reset() { GOMutexLocker lock(m_Mutex); ResetList(m_Work); m_NextItem.exchange(0); }
ListOfObjects *ObjectListInterface::GetList( Object *node ) { ResetList( node ); return &m_list; }
ManiAntiRejoin::ManiAntiRejoin() { gpManiAntiRejoin = this; ResetList(); }