wxGrid GetSelectedCells 返回空数组
wxGrid GetSelectedCells returns empty array
我想在使用单击按钮时删除选定的行。
到目前为止,代码如下所示:
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
希望它会有所帮助,但它没有。
我怎样才能让它工作?
您使用的是哪个版本的 wxgrid?旧的wxgrid似乎有一个问题,它在调用GetSelectedCells时总是返回空。也许您可以参考 http://forums.wxwidgets.org/viewtopic.php?t=6335 来尝试它是否适合您的情况。
相关文章:
- 为什么 C++ 中的字符数组返回其项目而不是地址?
- C++ bool 数组返回 1 或 0 以外的值
- C++ ostream 从对象数组返回数据
- 类中的重载运算符 [],因此它可以从模板类中的数组返回对象
- 指向对象的指针数组返回jibberish
- 具有基本结构的结构数组返回错误的答案
- 数组返回乐趣 movie_check()
- C++从字符数组返回类型为T的指针
- C++-将数组返回到主函数,并将数组传递给另一个函数
- C++:如何通过异常处理从越界数组返回值
- 整数数组返回类型
- 从字符串流复制到 char * 数组返回为函数参数
- C++函数从对象数组返回对象的副本.这是默认行为吗?
- 8字节数组返回长(C#到C++)
- 向c#数组返回一个字符数组c++
- 从并行数组返回值,并在以后的函数中使用这些值
- 将c++中的浮点数数组返回给Python
- 如何在gsoap中使字符串数组返回值
- 将两个字符相乘并向数组返回int
- C++套接字 - 从结构数组返回单个地址信息