ActionScript - ComboBox 是 SelectableList 吗?
我不明白 Adobe 的 SelectableList 类文档:
SelectableList 是基类 对于所有基于列表的组件--for 例如,List、TileList、DataGrid、 和ComboBox组件。
SelectableList 不是 ComboBox 的基类:
SelectableList > >基本滚动窗格> UI组件>雪碧>显示对象容器>交互对象>显示对象>事件调度器>对象
组合框 > UI组件>雪碧>显示对象容器>交互对象>显示对象>事件调度器> Object
import fl.controls.*;
var l:List = new List();
trace(l is SeletableList); //true
var tl:TileList = new TileList();
trace(tl is SelectableList); //true
var dg:DataGrid = new DataGrid();
trace(dg is SelectableList); //true
var cb:ComboBox = new ComboBox();
trace(cb is SelectableList); //false
这是一个错误吗?或者我错过了什么?
i don't understand Adobe's documentation for the SelectableList class:
The SelectableList is the base class
for all list-based components--for
example, the List, TileList, DataGrid,
and ComboBox components.
SelectableList isn't a base class for ComboBox:
SelectableList > BaseScrollPane > UIComponent > Sprite > DisplayObjectContainer > InteractiveObject > DisplayObject > EventDispatcher > Object
ComboBox > UIComponent > Sprite > DisplayObjectContainer > InteractiveObject > DisplayObject > EventDispatcher > Object
import fl.controls.*;
var l:List = new List();
trace(l is SeletableList); //true
var tl:TileList = new TileList();
trace(tl is SelectableList); //true
var dg:DataGrid = new DataGrid();
trace(dg is SelectableList); //true
var cb:ComboBox = new ComboBox();
trace(cb is SelectableList); //false
is this an error? or am i missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是 Adobe 有时在文档中表达自己的方式:令人困惑。
用简单的 OOP 术语来说,它是扩展类(“is a”)和使用组合(“has a”)之间的区别:
List、TileList、DataGrid 是一个可选择列表(因为每个一个扩展了可选列表)
组合框有一个可选列表(因为它有一个列表组件,通过它的dropdown 属性(是一个 可选列表))。
希望这能够清楚地说明这一点。
It's just the way Adobe express themselves in the documentation sometimes: confusingly.
To put it in simple OOP terms, it's the difference between extending a class("is a") and using composition("has a"):
List, TileList, DataGrid is a Selectable List (because each one extends Selectable List)
ComboBox has a Selectable List (because it has a List component, exposed through it's dropdown property(, which is a Selectable list)).
Hope this makes it clear.