Flex: TextInput 监听回车事件

Categories: Flex; Tagged with: ; @ November 13th, 2009 21:12

有时候需要监听TextInput的回车按下事件, 以直接进行某操作.

可使用FlexEvent.ENTER如:

_textKeywords.addEventListener(FlexEvent.ENTER, onTextKeyWordsEnterPressed);

Windows 下OTF字体提示破损(Font Damaged)无法安装解决方法

Categories: Development Notes; Tagged with: ; @ November 8th, 2009 17:53

此问题是由于 Microsoft Windows XP 为设备驱动程序分配了一定量的空间所导致的。 NIVIDIA 驱动程序需要额外的空间。

如要解决此问题,请执行以下步骤:

  1. 点击 “开始” ,然后点击 “运行”

  2. 键入 “regedit” ,然后按 “Enter” 。

  3. 导航至 “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management”

  4. 点击 “编辑”“新建” ,然后选择 “DWORD 值”

  5. 键入 “SessionImageSize” 以命名新值,然后按 “Enter” 。

  6. 右键点击 “SessionImageSize” ,然后选择 “修改”

  7. 在 “值数据” 字段中键入 “20” 。 确认已选中“十六进制”,然后点击 “确定”

  8. 关闭注册表编辑器,然后重新启动笔记本电脑。

参阅: http://h50176.www5.hp.com/support/FN778AV/solve/112848.html

List set row height 设置单元格的高度

Categories: Flex; Tagged with: ; @ November 5th, 2009 9:23

rowHeight:Number [read-write]

The height of the rows in pixels. Unless the variableRowHeight property is true, all rows are the same height. If not specified, the row height is based on the font size and other properties of the renderer

variableRowHeight:Boolean

A flag that indicates whether the individual rows can have different height. This property is ignored by TileList and HorizontalList. If true, individual rows can have different height values.

The default value is false.

Flex: HBox horizontalAlign 靠左/右排序

Categories: Flex; Tagged with: ; @ October 27th, 2009 13:42

hboxActions.setStyle(“horizontalAlign”, “right”); 便可实现… 今天早晨脑子被挤,发现设了之后还是靠左…良久, 才想起来没有设定hboxActions的宽度

Flex TileList 使用自定义ItemRnederer低级错误举例

Categories: Flex; Tagged with: ; @ October 23rd, 2009 14:17

使用Flex TileList实现如下效果:

image

考虑到日后可能需要在其后添加按钮, 考虑到日后可能会在后面加入其它内容, 于是继承HBox, 实现IDropInListItemRenderer, IDataRenderer.

但屡屡发现出现错误: 每次仅显示最后的一个或两个Item, 前面的有, 但不再显示.

image

经过检查, 发现在Renderer中, 实现set data()时, 未呼叫super.data

Container中data setter如下

    /**
     *  @private
     */
    public function set data(value:Object):void
    {
        _data = value;

        dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));

        invalidateDisplayList();
    }

增加super.data后, 功能实现.

更正后的ItemRender:

package com.liguoliang.es.app.class_.ui
{

import mx.containers.Box;
import mx.containers.BoxDirection;
import mx.controls.CheckBox;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.IDropInListItemRenderer;
import mx.core.IDataRenderer;

public class RenderForInitCE extends Box implements IDropInListItemRenderer, IDataRenderer
{
	private var _listData:BaseListData; // 为实现IDropInListItemRenderer而创建.

	/** UI */
	protected var _box:Box;
	protected var _checkBoxCE:CheckBox;
	
	public function RenderForInitCE() {
		super();
		_box = new Box();
		_box.direction = BoxDirection.HORIZONTAL;
		_checkBoxCE = new CheckBox();
	}
	
	//-------------------------Renderer-------------------------------
    [Bindable("dataChange")]
    [Inspectable(environment="none")]
	public function get listData():BaseListData {
		return _listData;
	}
	
	public function set listData(value:BaseListData):void {
		_listData = value;
	}
	
	
    [Bindable("dataChange")]
    [Inspectable(environment="none")]
	/** @inheritDoc */
	override public function get data():Object {
		return super.data;
	}
	
	/** @inheritDoc */
	override public function set data(value:Object):void {
		super.data = value;
		removeAllChildren();
		_checkBoxCE.label = (value as ClassEnrollment).user_.nameFull;
		addChild(_checkBoxCE);
		_checkBoxCE.percentWidth = 100;
	}
	
} // End of class
} // End of package

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.