void MultiViewerMain::OnPopupClick(wxCommandEvent &evt) { switch(evt.GetId()) { case eSelectAllOnPage: m_pTableDBDataGrid->SelectAll(); break; case eDeleteAll: m_pTableDBDataGrid->SelectAll(); break; case eAddRow: AddRow(); break; case eDeleteCurrentRow: DeleteRow(); break; case eModifyCurrentCol: ModifyCol(); break; case eDeleteCurrentCol: DeleteCol(); break; case eAddCol: AddCol(); break; default: break; } }
void CMembersView::OnDelete() { static const tchar* pszMsg = TXT("Delete the member: %s?\n\n") TXT("This will also delete their stats, any\n") TXT("income and their place in any team sheets."); // Ignore if no selection. if (!m_lvGrid.IsSelection()) return; // Get the current selection. int iLVItem = m_lvGrid.Selection(); CRow& oRow = Row(iLVItem); int nID = oRow[CMembers::ID]; CString strName = App.FormatName(oRow, CMembers::FORENAME, CMembers::SURNAME); // Get user to confirm action. if (QueryMsg(pszMsg, strName) != IDYES) return; // Remove any stats, income and team sheet places. m_oDB.m_oMemStats.DeleteMembersStats(nID); // m_oDB.m_oSubs; // m_oDB.m_oTeamSels; // Remove from the list view and collection. DeleteRow(iLVItem); m_oTable.DeleteRow(oRow); App.m_AppCmds.UpdateUI(); }
void ColorMapGridControl::OnPopupCommand(UINT nMenuID) { switch (nMenuID) { case WM_INSERT_ROW_BEFORE: { InsertRow(m_nCurrRow); break; } case WM_INSERT_ROW_AFTER: { InsertRow(m_nCurrRow + 1); break; } case WM_DELETE_ROW: { DeleteRow(m_nCurrRow); break; } case WM_COPYFROMCLIPBOARD: { CopyFromClipboardTable(m_nCurrRow); break; } default: ASSERT(0); break; } UpdateModifiedRows(); }
void ColorMapGridControl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { m_nCurrRow = m_cellActive.m_nRow - 1; if (m_nCurrRow >= 0) { bool bOpDone = false; switch (nChar) { case VK_DELETE: { DeleteRow(m_nCurrRow); bOpDone = true; break; } case VK_INSERT: { InsertRow(m_nCurrRow); bOpDone = true; break; } default: { break; } } if (bOpDone) { UpdateModifiedRows(); return; } } CGridCtrlCell::OnKeyDown(nChar, nRepCnt, nFlags); }
LFK_ForeignKey LFK_CreateForeignKey(long id) { return (LFK_ForeignKey){.id = id, .llup = -1}; } void TestDefragmentation(void) { People people = (People){LFK_NewTable(100)}; LFK_AddColumn(people.table, sizeof(int)); int i; int cl = 1 << 0; for (i = 0; i < cl; i++) { Person carl = InsertPerson(people, 3); LFK_ForeignKey carl_key = LFK_CreateForeignKey(carl.id); LFK_LookUp(people.table, &carl_key); assert(carl_key.llup == 0); DeleteRow(people.table, 0); LFK_LookUp(people.table, &carl_key); assert(carl_key.id == -1L); Person john = InsertPerson(people, 5); Person sara = InsertPerson(people, 7); LFK_ForeignKey john_key = LFK_CreateForeignKey(john.id); LFK_LookUp(people.table, &john_key); assert(john_key.llup == 1); LFK_ForeignKey sara_key = LFK_CreateForeignKey(sara.id); LFK_LookUp(people.table, &sara_key); assert(sara_key.llup == 2); LFK_Defragment(people.table); LFK_LookUp(people.table, &john_key); assert(john_key.llup == 0); LFK_LookUp(people.table, &sara_key); assert(sara_key.llup == 1); DeleteRow(people.table, 0); DeleteRow(people.table, 1); LFK_Defragment(people.table); } LFK_FreeTable(people.table); }
void PeriodicalTranDialog::pt_DelPeriodic_clicked(wxCommandEvent &event) { if (dbperiod.GetCount() == 0) { wxMessageBox(_("Periodical transaction not found."),APPTITLE,wxOK|wxICON_EXCLAMATION,this); return; } //for DB dbperiod.Item(listselect).SetFlag(del_mt); DeleteRow(pt_PeriodicalList,listselect); }
///////////////////////////////////////////////////////////////////////////// // OnMenuCommand // This notification is called when the user has selected a menu item // in the pop-up menu. // Params: // col, row - the cell coordinates of where the menu originated from // setcion - identify for which portion of the gird the menu is for. // possible sections: // UG_TOPHEADING, UG_SIDEHEADING,UG_GRID // UG_HSCROLL UG_VSCROLL UG_CORNERBUTTON // item - ID of the menu item selected // Return: // <none> void CDropDayCug::OnMenuCommand(int col,long row,int section,int item) { UNREFERENCED_PARAMETER(col); UNREFERENCED_PARAMETER(section); if ( item == 1000 ) { DeleteRow( row ); RedrawAll(); m_bIsUpdated = TRUE; } }
void CTWenUGCtrlEx::RomoveRow_ButtonAdd(void) { int nRow = CUGCtrl::GetNumberRows(); if(nRow == 0) return; CUGCell cell; GetCell(0, nRow-1, &cell); if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Add))//如果有增加行 { DeleteRow(nRow-1); } }
status_t _EndpointList::MidiUnregistered(int32 id, AmEndpointType type) { BMidiEndpoint* endpoint = BMidiRoster::FindEndpoint(id); if (!endpoint) { ArpASSERT(false); return B_ERROR; } BString name = endpoint->Name(); _EndpointRow* p = ParentNamed(name, type); if (!p) return B_ERROR; if (!p->HasChanges() ) { DeleteRow(p); } else { p->SetIsValid(false); UpdateRow(p); } return B_OK; }
bool DefaultDetail::DeleteRows(size_t pos, size_t numRows) { if ( pos >=0 && pos < GetNumberRows() ) { wxList* row = GetRowData(pos); GetData()->RemoveAt(pos); DeleteRow(row); if ( GetView() ) { wxGridTableMessage msg(this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, pos, 1); GetView()->ProcessTableMessage(msg); } return true; } else { return false; } };
UsersForwardAddDialog::UsersForwardAddDialog(QSqlDatabase db, QWidget *parent) : QDialog(parent) { db_psql = db; setupUi( this ); QRegExp alpha ("-?[a-z.\\-_0-9]+"); QValidator *ValLocal_Part = new QRegExpValidator(alpha, this); connect(pushButton_Add, SIGNAL(clicked()), this, SLOT(NewRow())); connect(pushButton_Deleted, SIGNAL(clicked()), this, SLOT(DeleteRow())); connect(buttonBox, SIGNAL(accepted()), this, SLOT(Add())); lineEdit_Local_Part->setValidator(ValLocal_Part); tableWidget_recipients->setColumnWidth(0, 230); tableWidget_recipients->setColumnWidth(1, 230); completer = new QCompleter(this); lineEdit_Domain->setCompleter(completer); }
AliasesEditDialog::AliasesEditDialog(QSqlDatabase db,QString local_part, QString domain, QWidget *parent) : QDialog(parent){ QStringList list_recipients, list2_recipients; db_psql=db; setupUi( this ); index = NULL; lineEdit_Local_Part->setText(local_part); lineEdit_Domain->setText(domain); /* Get recipients from aliases */ TestQuery(); if( db_psql.isOpen() ){ QSqlQuery query( db_psql ); query.prepare("SELECT recipients FROM aliases_view WHERE local_part=:local_part and domain=:domain LIMIT 1"); query.bindValue(":local_part", lineEdit_Local_Part->text()); query.bindValue(":domain", lineEdit_Domain->text()); if( query.exec() ){ for(int i = 0; i < query.size(); i++){ query.next(); list_recipients = query.value(0).toString().split(","); tableWidget_recipients->setRowCount(list_recipients.size()); for(int j = 0; j < list_recipients.size(); j++){ list2_recipients=list_recipients.at(j).split("@"); __item0 = new QTableWidgetItem(); __item0->setText(list2_recipients.at(0)); tableWidget_recipients->setItem(j, 0, __item0); if(list2_recipients.count() > 1){ __item1 = new QTableWidgetItem(); __item1->setText(list2_recipients.at(1)); tableWidget_recipients->setItem(j, 1, __item1); }else{ __item1 = new QTableWidgetItem(); __item1->setText(lineEdit_Domain->text()); tableWidget_recipients->setItem(j, 1, __item1); } } } query.clear(); }else{ QMessageBox::warning(this, tr("Query Error"), query.lastError().text(), QMessageBox::Ok); query.clear(); } }else{ this->reject(); } lineEdit_Local_Part->setReadOnly(true); lineEdit_Domain->setReadOnly(true); connect(pushButton_Add, SIGNAL(clicked()), this, SLOT(NewRow())); connect(pushButton_Deleted, SIGNAL(clicked()), this, SLOT(DeleteRow())); connect(buttonBox, SIGNAL(accepted()), this, SLOT(Update())); connect(tableWidget_recipients ,SIGNAL(itemClicked(QTableWidgetItem * )), this, SLOT(SelectRow(QTableWidgetItem * )));//updte tableWidget_recipients->setColumnWidth(0, 230); tableWidget_recipients->setColumnWidth(1, 230); }
void _EndpointList::DeleteCurrentSelection() { _EndpointRow* row = dynamic_cast<_EndpointRow*>(CurrentSelection() ); ArpVALIDATE(row && !row->mIsValid, return); DeleteRow(row); }