1
我想在使用單擊按鈕時刪除選定的行。wxGrid GetSelectedCells返回空數組
到目前爲止的代碼看起來像這樣:
this->grid_ = new wxGrid(parent, ...)
this->grid_->SetSelectionMode(wxGrid::wxGridSelectCells);
// Later, whene the button is clicked
this->grid_->SetFocus();
wxGridCellCoordsArray wx_cells = this->grid_->GetSelectedCells();
的問題是wx_cells
變量始終是空不管我選擇。 我嘗試GetSelectedRows沒有成功。 我已添加SetFocus
和SetSelectionMode
希望它會幫助,但它沒有。
我該如何得到這個工作?
到目前爲止,我對該論壇帖子的總結:'wxGridSelectCells'模式不起作用。 'GetSelectedRows','GetSelectedCols','GetSelectedCells'不起作用。解決方案是使用塊:'GetSelectionBlockTopLeft'和'GetSelectionBlockBottomRight'。如果你想做一些簡單的事情,你也可以通過網格單元並調用IsInSelection – Arthur