Allow CommandMenu subclasses to provide their own item renderer.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@544 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -138,12 +138,21 @@ public class CommandMenu extends Menu
|
|||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
itemRenderer = new ClassFactory(CommandMenuItemRenderer);
|
itemRenderer = new ClassFactory(getItemRenderer());
|
||||||
|
|
||||||
verticalScrollPolicy = ScrollPolicy.OFF;
|
verticalScrollPolicy = ScrollPolicy.OFF;
|
||||||
addEventListener(MenuEvent.ITEM_CLICK, itemClicked);
|
addEventListener(MenuEvent.ITEM_CLICK, itemClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called in the CommandMenu constructor, this should return the item rendering class for this
|
||||||
|
* CommandMenu.
|
||||||
|
*/
|
||||||
|
protected function getItemRenderer () :Class
|
||||||
|
{
|
||||||
|
return CommandMenuItemRenderer;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures the event dispatcher to be used when dispatching this menu's command events.
|
* Configures the event dispatcher to be used when dispatching this menu's command events.
|
||||||
* Normally they will be dispatched on our parent (usually the SystemManager or something).
|
* Normally they will be dispatched on our parent (usually the SystemManager or something).
|
||||||
|
|||||||
Reference in New Issue
Block a user