Показать сообщение отдельно
Старый 23.10.2009, 12:45
Jean вне форума Посмотреть профиль Отправить личное сообщение для Jean Найти все сообщения от Jean
  № 3  
Ответить с цитированием
Jean

Регистрация: Dec 2005
Сообщений: 23
Код AS3:
public class SeparatorComboBox extends ComboBox
{
	private var _disabledFunction:Function;
 
	public function SeparatorComboBox()
	{
		super();
		itemRenderer = new ClassFactory(SeparatorComboBoxItemRenderer);
		dropdownFactory = new ClassFactory(SeparatorList);
		addEventListener(DropdownEvent.OPEN, openListener);
		addEventListener(ListEvent.CHANGE, change);
	}
 
    private function change(event:ListEvent) : void
    {
    	if (this.textInput.getTextField().truncateToFit())
    	{
    		this.toolTip = this.text; 
    	} else
    	{
    		this.toolTip = null;
    	}
    }
 
	public function set disabledFunction(value:Function):void
	{
		_disabledFunction = value;
	}
 
	public function get disabledFunction():Function
	{
		return _disabledFunction;
	}
 
	private function openListener(event:DropdownEvent):void
	{
		var list:SeparatorList = dropdown as SeparatorList;
		if (list != null)
            list.disabledFunction = _disabledFunction;
	}
}