From a TEXT i can do it through:
((Text)control).getSelectionCoun开发者_JS百科t();
But, how can i access it on a CCombo?
((CCombo)control).getSelectionCount(); is not implemented...
Thanks.
Looking at the implementation of Text.getSelectionCount()
it's trivial to do:
Point selection = myCCombo.getSelection();
int selectionCount = selection.y - selection.x;
You can also implement your own MyCCombo
:
class MyCCombo extends CCombo {
...
public int getSelectionCount() {
Point selection = getSelection();
return selection.y - selection.x;
}
}
精彩评论