void CDirstatDoc::RefreshAfterUserDefinedCleanup(const USERDEFINEDCLEANUP *udc, CItem *item) { switch (udc->refreshPolicy) { case RP_NO_REFRESH: break; case RP_REFRESH_THIS_ENTRY: { RefreshItem(item); } break; case RP_REFRESH_THIS_ENTRYS_PARENT: { RefreshItem(NULL == item->GetParent() ? item : item->GetParent()); } break; // case RP_ASSUME_ENTRY_HAS_BEEN_DELETED: // Feature not implemented. // break; default: ASSERT(0); } }
void browsers::topedlay_list::defaultLayer(word newl, word oldl) { wxListItem info; // first remove the icon from the previous default layer long ID = FindItem(-1, oldl); info.SetId(ID);info.SetColumn(2); if ( GetItem(info) ) { info.SetMask(wxLIST_MASK_IMAGE);info.SetImage(-1); SetItem(info); } info.SetColumn(0); if ( GetItem(info) ) { info.SetFont(_llfont_normal); SetItem(info); } RefreshItem(ID); // Now attach the Icon to the current default layer ID = FindItem(-1, newl); info.SetId(ID);info.SetColumn(2); if ( GetItem(info) ) { info.SetMask(wxLIST_MASK_IMAGE);info.SetImage(0); SetItem(info); } info.SetColumn(0); if ( GetItem(info) ) { info.SetFont(_llfont_bold); SetItem(info); } RefreshItem(ID); }
void MainWidget::addData() { QString logname; QString svcname; RDSqlQuery *q; QString sql; std::vector<QString> newlogs; RDAddLog *log; if(rda->user()->createLog()) { log=new RDAddLog(&logname,&svcname,NULL,tr("Add Log"),this); if(log->exec()!=0) { delete log; return; } delete log; sql=QString("insert into LOGS set ")+ "NAME=\""+RDEscapeString(logname)+"\","+ "TYPE=0,"+ "DESCRIPTION=\""+RDEscapeString(logname)+" log\","+ #ifdef WIN32 "ORIGIN_USER=\""+RDEscapeString(RD_USER_LOGIN_NAME)+"\","+ #else "ORIGIN_USER=\""+RDEscapeString(rda->ripc()->user())+"\","+ #endif // WIN32 "ORIGIN_DATETIME=now(),"+ "LINK_DATETIME=now(),"+ "SERVICE=\""+RDEscapeString(svcname)+"\""; q=new RDSqlQuery(sql); if(!q->isActive()) { QMessageBox::warning(this,tr("Log Exists"),tr("Log Already Exists!")); delete q; return; } delete q; RDCreateLogTable(RDLog::tableName(logname)); EditLog *editlog=new EditLog(logname,&log_filter,&log_group,&log_schedcode, &log_clipboard,&newlogs,this); editlog->exec(); delete editlog; ListListViewItem *item=new ListListViewItem(log_log_list); item->setText(1,logname); RefreshItem(item); log_log_list->setSelected(item,true); log_log_list->ensureItemVisible((Q3ListViewItem *)item); for(unsigned i=0;i<newlogs.size();i++) { item=new ListListViewItem(log_log_list); item->setText(1,newlogs[i]); RefreshItem(item); } } }
void ListEncoders::addData() { QString name; QString sql; RDSqlQuery *q; RDSqlQuery *q1; AddEncoder *ad=new AddEncoder(&name,list_stationname,this); if(ad->exec()==0) { sql=QString().sprintf("select ID from ENCODERS \ where (NAME=\"%s\")&&(STATION_NAME=\"%s\")", (const char *)RDEscapeString(name), (const char *)RDEscapeString(list_stationname)); q=new RDSqlQuery(sql); if(q->first()) { EditEncoder *ee=new EditEncoder(q->value(0).toInt()); if(ee->exec()==0) { RDListViewItem *item=new RDListViewItem(list_list_view); item->setId(q->value(0).toInt()); item->setText(0,name); RefreshItem(item); list_list_view->ensureItemVisible(item); } else { sql=QString().sprintf("delete from ENCODERS \ where (NAME=\"%s\")&&(STATION_NAME=\"%s\")", (const char *)RDEscapeString(name), (const char *)RDEscapeString(list_stationname)); q1=new RDSqlQuery(sql); delete q1; } delete ee; }
void cChar::glowHalo(P_ITEM pi) { if (pi->glow != INVALID_SERIAL) { P_ITEM pHalo=FindItemBySerial(pi->glow); if (!pHalo) return; pHalo->layer=pi->layer; // copy layer information of the glowing item to the invisible light emitting object if(pHalo->layer==0 && pi->isInWorld()) // unequipped -> light source coords = item coords { pHalo->dir=29; pHalo->pos.x=pi->pos.x; pHalo->pos.y=pi->pos.y; pHalo->pos.z=pi->pos.z; } else if (pHalo->layer==0 && !pi->isInWorld()) // euqipped -> light source coords = players coords { pHalo->pos.x=this->pos.x; pHalo->pos.y=this->pos.y; pHalo->pos.z=this->pos.z+4; pHalo->dir=99; // gives no light in backpacks } else { pHalo->pos.x=this->pos.x; pHalo->pos.y=this->pos.y; pHalo->pos.z=this->pos.z+4; pHalo->dir=29; } RefreshItem(pHalo);//AntiChrist } }
void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation ) { SCH_SCREEN* screen = GetScreen(); SCH_ITEM* item = screen->GetCurItem(); SCH_COMPONENT* component = (SCH_COMPONENT*) item; GetCanvas()->MoveCursorToCrossHair(); if( item->GetFlags() == 0 ) SetUndoItem( item ); component->SetOrientation( aOrientation ); m_canvas->CrossHairOn( ); if( item->GetFlags() == 0 ) { addCurrentItemToScreen(); SchematicCleanUp(); } TestDanglingEnds(); RefreshItem( item ); if( item->GetFlags() == 0 ) OnModify(); }
void ListLog::logInsertedData(int line) { bool appended=false; if(line>=list_log->size()) { line=list_log->size()-1; } if(line>=list_log->size()-1) { appended=true; } int count; RDListViewItem *item=GetItem(line+1); while(item!=NULL) { if((count=item->text(15).toInt())>=0) { item->setText(15,QString().sprintf("%d",count+1)); } item=(RDListViewItem *)item->nextSibling(); } item=new RDListViewItem(list_log_list); list_log->logLine(line)->setListViewItem(item); RefreshItem(item,line); if(appended) { if((item=(RDListViewItem *)list_log_list->findItem("-2",13))!=NULL) { list_log_list->ensureItemVisible(item); } } }
void wxCheckListBox::Toggle(unsigned int uiIndex) { wxCHECK_RET( IsValid(uiIndex), wxT("bad wxCheckListBox index") ); GetItem(uiIndex)->Toggle(); RefreshItem(uiIndex); }
static void AddItem(DEBUG_INFO *dbg, VARINFO *var, int cursoreip, WATCHDATA *ptr) { WATCHINFO *x = MatchItem(var, ptr); if (x) { x->marked = FALSE; FreeVarInfo(var); } else { HTREEITEM previous = 0; if (ptr->watchinfo_count >= ptr->watchinfo_max) { if (ptr->watchinfo_max >= 128) { ExtendedMessageBox("Watch Error", MB_SETFOREGROUND | MB_SYSTEMMODAL, "There are too many items in the watch window\nNot adding the current selection"); return ; } ptr->watchinfo_max += 64; ptr->watchinfo_list = realloc(ptr->watchinfo_list, ptr->watchinfo_max *sizeof (WATCHINFO)); } if (ptr->watchinfo_count) previous = ptr->watchinfo_list[ptr->watchinfo_count - 1].info->hTreeItem; memset(&ptr->watchinfo_list[ptr->watchinfo_count], 0, sizeof(ptr->watchinfo_list[0])); ptr->watchinfo_list[ptr->watchinfo_count].info = var; ptr->watchinfo_list[ptr->watchinfo_count].dbg_info = dbg; ptr->watchinfo_list[ptr->watchinfo_count++].cursoreip = cursoreip; RefreshItem(ptr, &ptr->watchinfo_list[ptr->watchinfo_count - 1], var->address, NULL, TRUE); InsertSubTree(0, previous, var, ptr->watchinfo_count - 1, ptr); } }
void BattleListCtrl::UpdateBattle( IBattle& battle ) { int index = GetIndexFromData( &battle ); RefreshItem( index ); MarkDirtySort(); }
void BattleDataViewCtrl::UpdateBattle(IBattle& battle) { if (ContainsItem(battle)) { RefreshItem(battle); } else { return; } }
void ListCasts::addCartData() { QString cutname; RDCutDialog *cd=new RDCutDialog(&cutname,rdstation_conf,cast_system, &cast_filter,&cast_group,&cast_schedcode, cast_ripc->user()); if(cd->exec()!=0) { delete cd; return; } delete cd; RDFeed::Error err; unsigned cast_id=list_feed->postCut(cast_user,rdstation_conf,cutname,&err, config->logXloadDebugData(),config); if(err!=RDFeed::ErrorOk) { QMessageBox::warning(this,tr("Posting Error"),RDFeed::errorString(err)); return; } EditCast *edit_cast=new EditCast(cast_id,this); edit_cast->exec(); RDListViewItem *item=new RDListViewItem(list_casts_view); item->setId(cast_id); RefreshItem(item); list_casts_view->setSelected(item,true); list_casts_view->ensureItemVisible(item); delete edit_cast; }
void MainWidget::RefreshList() { RDSqlQuery *q; QString sql; ListListViewItem *item; log_log_list->clear(); // Note: clear here, in case user has no perms. sql=QString("select NAME from LOGS where ")+ "(TYPE=0)&&"+ "(LOG_EXISTS=\"Y\")"; if(log_service_box->currentItem()!=0) { sql+="&&(SERVICE=\""+RDEscapeString(log_service_box->currentText())+"\")"; } QString filter=log_filter_edit->text(); if(!filter.isEmpty()) { sql+="&&((NAME like \"%%"+RDEscapeString(filter)+"%%\")||"; sql+="(DESCRIPTION like \"%%"+RDEscapeString(filter)+"%%\")||"; sql+="(SERVICE like \"%%"+RDEscapeString(filter)+"%%\"))"; } if(log_recent_check->isChecked()) { sql+=QString().sprintf("order by ORIGIN_DATETIME desc limit %d", RDLOGEDIT_LIMIT_QUAN); } q=new RDSqlQuery(sql); while(q->next()) { item=new ListListViewItem(log_log_list); item->setText(1,q->value(0).toString()); RefreshItem(item); } delete q; }
void wxListBox::SetString(int n, const wxString& s) { wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") ); (*m_strings)[n] = s; if ( HasHorzScrollbar() ) { // we need to update m_maxWidth as changing the string may cause the // horz scrollbar [dis]appear wxCoord width; GetTextExtent(s, &width, NULL); // it might have increased if the new string is long if ( width > m_maxWidth ) { m_maxWidth = width; m_maxWidthItem = n; m_updateScrollbarX = true; } // or also decreased if the old string was the longest one else if ( n == m_maxWidthItem ) { RefreshHorzScrollbar(); } } RefreshItem(n); }
void AddItem(DEBUG_INFO *dbg, VARINFO *var, int cursoreip, int page) { WATCHINFO *x = MatchItem(var, page); if (x) { FreeVarInfo(var); } else { HTREEITEM previous = 0; if (watchinfo_count[page] >= watchinfo_max[page]) { if (watchinfo_max[page] >= 128) { ExtendedMessageBox("Watch Error", MB_SETFOREGROUND | MB_SYSTEMMODAL, "There are too many items in the watch window\nNot adding the current selection"); return ; } watchinfo_max[page] += 64; watchinfo_list[page] = realloc(watchinfo_list[page], watchinfo_max[page] *sizeof (WATCHINFO)); } if (watchinfo_count[page]) previous = watchinfo_list[page][watchinfo_count[page] - 1].info->hTreeItem; memset(&watchinfo_list[page][watchinfo_count[page]], 0, sizeof(watchinfo_list[page][0])); watchinfo_list[page][watchinfo_count[page]].info = var; watchinfo_list[page][watchinfo_count[page]].dbg_info = dbg; watchinfo_list[page][watchinfo_count[page]++].cursoreip = cursoreip; RefreshItem(&watchinfo_list[page][watchinfo_count[page] - 1], var->address, NULL); InsertSubTree(0, previous, var, watchinfo_count[page] - 1, page); } }
void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck) { wxCHECK_RET( IsValid(uiIndex), wxT("bad wxCheckListBox index") ); GetItem(uiIndex)->Check(bCheck); RefreshItem(uiIndex); }
void NickDataViewCtrl::UserUpdated(const User& user) { if (ContainsItem(user)) { RefreshItem(user); } DoUsersFilter(); }
void DownloadDataViewCtrl::UpdateDownloadsList() { for(auto item : GetItemsContainer()) { const_cast<DownloadInfo*>(item)->UpdateInfo(); RefreshItem(*item); } }
void wxListBox::SetCurrentItem(int n) { if ( n != m_current ) { if ( m_current != -1 ) RefreshItem(m_current); m_current = n; if ( m_current != -1 ) { m_currentChanged = true; RefreshItem(m_current); } } //else: nothing to do }
bool PlayerVendorSpeech(cChar* pVendor, const QString& comm, cChar* pPlayer, UOXSOCKET s) { if (!(pVendor->npcaitype == 17)) return 0; if (pPlayer->dist(pVendor) > 4) return 0; if (!VendorChkName(pVendor,comm)) return false; //if (strstr(comm, " BROWSE") || strstr(comm, " VIEW") || strstr(comm, " LOOK")) if ((comm.contains(" BROWSE")) || (comm.contains(" VIEW")) || (comm.contains(" LOOK"))) { npctalk(s,pVendor,"Take a look at my goods.",1); P_ITEM pi_backpack = Packitem(pVendor); if (pi_backpack != NULL) { backpack(s, pi_backpack->serial); return true; } } //if (strstr(comm, " BUY") || strstr(comm, " PURCHASE")) if ((comm.contains(" BUY")) || (comm.contains(" PURCHASE"))) { addx[s]=pVendor->serial; npctalk(s,pVendor,"What would you like to buy?",0); target(s,0,1,0,224," "); return true; } if (!pPlayer->Owns(pVendor)) return 0; //if (strstr( comm, " COLLECT") || strstr( comm, " GOLD") || strstr( comm, " GET")) if ((comm.contains(" COLLECT")) || (comm.contains(" GOLD")) || (comm.contains(" GET"))) { PlVGetgold(s, pVendor); return true; } //if (strstr( comm, "PACKUP")) if (comm.contains("PACKUP")) { P_ITEM pDeed = Items->SpawnItem(pPlayer, 1, "employment deed", 0, 0x14F0, 0, 1); if (pDeed) { pDeed->type = 217; pDeed->value = 2000; RefreshItem( pDeed ); Npcs->DeleteChar( pVendor ); sysmessage(s, "Packed up vendor %s.", pVendor->name.c_str()); return true; } } return false; }
void browsers::topedlay_list::hideLayer(word layno, bool hide) { long ID = FindItem(-1, layno); wxListItem info; info.SetId(ID); if ( GetItem(info) ) { info.SetTextColour((hide ? *wxLIGHT_GREY : *wxBLACK)); SetItem(info); RefreshItem(ID); } }
void MainWidget::editData() { ListListViewItem *item=(ListListViewItem *)log_log_list->selectedItem(); std::vector<QString> newlogs; if(item==NULL) { return; } EditLog *log=new EditLog(item->text(1),&log_filter,&log_group,&log_schedcode, &log_clipboard,&newlogs,this); log->exec(); delete log; RefreshItem(item); for(unsigned i=0;i<newlogs.size();i++) { item=new ListListViewItem(log_log_list); item->setText(1,newlogs[i]); RefreshItem(item); } }
void ListLog::RefreshList(int line) { RDListViewItem *next=(RDListViewItem *)list_log_list->firstChild(); while((next!=NULL)&&next->text(15).toInt()!=line) { next=(RDListViewItem *)next->nextSibling(); } if(next!=NULL) { RefreshItem(next,line); } }
void wxListBox::DoSetSelection(int n, bool select) { if ( select ) { if ( m_selections.Index(n) == wxNOT_FOUND ) { if ( !HasMultipleSelection() ) { // selecting an item in a single selection listbox deselects // all the others DeselectAll(); } m_selections.Add(n); RefreshItem(n); } //else: already selected } else // unselect { int index = m_selections.Index(n); if ( index != wxNOT_FOUND ) { m_selections.RemoveAt(index); RefreshItem(n); } //else: not selected } // sanity check: a single selection listbox can't have more than one item // selected wxASSERT_MSG( HasMultipleSelection() || (m_selections.GetCount() < 2), _T("multiple selected items in single selection lbox?") ); if ( select ) { // the newly selected item becomes the current one SetCurrentItem(n); } }
void browsers::topedlay_list::lockLayer(word layno, bool lock) { long ID = FindItem(-1, layno); wxListItem info; info.SetId(ID);info.SetColumn(2); if ( GetItem(info) ) { info.SetMask(wxLIST_MASK_IMAGE); info.SetImage((lock ? 1 : -1)); SetItem(info); RefreshItem(ID); } }
void MainWidget::openData() { RDListViewItem *item=(RDListViewItem *)cast_feed_list->selectedItem(); if(item==NULL) { return; } ListCasts *casts=new ListCasts(item->id(),this); casts->exec(); RefreshItem(item); delete casts; }
bool CustomVirtListCtrl<T,L>::AddItem( const T& item ) { if ( GetIndexFromData( item ) != -1 ) return false; m_data.push_back( item ); SetItemCount( m_data.size() ); RefreshItem( m_data.size() - 1 ); MarkDirtySort(); return true; }
void CDirstatDoc::RecurseRefreshMountPointItems(CItem *item) { if(IT_DIRECTORY == item->GetType() && item != GetRootItem() && GetWDSApp()->IsVolumeMountPoint(item->GetPath())) { RefreshItem(item); } for(int i = 0; i < item->GetChildrenCount(); i++) { RecurseRefreshMountPointItems(item->GetChild(i)); } }
void CDirstatDoc::RecurseRefreshJunctionItems(CItem *item) { if (item->GetType() == IT_DIRECTORY && item != GetRootItem() && GetApp()->IsJunctionPoint(item->GetPath())) { RefreshItem(item); } for (int i=0; i < item->GetChildrenCount(); i++) { RecurseRefreshJunctionItems(item->GetChild(i)); } }
void ListAuxFields::editData() { RDListViewItem *item=(RDListViewItem *)list_list_view->selectedItem(); if(item==NULL) { return; } EditAuxField *ef=new EditAuxField(item->id(),this); if(ef->exec()==0) { RefreshItem(item); } delete ef; }