从文本中我可以通过以下方式完成:
((Text)control).getSelectionCount();
但是,我如何在CCombo上访问它?
((CCombo)control).getSelectionCount(); is not implemented...
感谢。
答案 0 :(得分:3)
查看Text.getSelectionCount()
的实现,这很简单:
Point selection = myCCombo.getSelection();
int selectionCount = selection.y - selection.x;
您还可以实施自己的MyCCombo
:
class MyCCombo extends CCombo {
...
public int getSelectionCount() {
Point selection = getSelection();
return selection.y - selection.x;
}
}