最新发布EhLib 6.2中的新功能DropDownForms的应用

DropDownForms 为这次更新中新增的一个功能,可定制下拉窗口。其实这个功能在以前版本的DEMO中已经实现了,使用起来也很简单。不过这次的更新,全我们使用起来更方便。现在让我们来看一下怎样来实现这个功能。

一、新建一个下拉窗口类TCustomDropDownFormEh的实例,通过菜单 File->New->Other …->Delphi Projects-> “EhLib Forms”-”DropDown Form” 创建一个下拉窗口。

二、根据你要实现的功能在这个From上安置各种控件。

三、设置下拉窗口的事件:

OnInitForm 事件 – 在该事件中接收从调用From传过来的参数.

OnReturnParams 事件 – 在该事件中可以返回值给调用窗口.

四、DropDownFormParams属性包含如下子属性:

属性名 类型 描述
DropDownForm: TCustomForm 指定要引用的下拉窗口名称.
DropDownFormClassName: String 指定引用的 DropDown Form类名.
Align: TDropDownAlign 下拉窗口相对于引用列的对齐方式.
PassParams: TDropDownPassParamsEh 指定参数的传递方式.
PassFieldNames: String 数据集的字段名,它们将作为参数传递到下拉窗口.
AssignBackFieldNames: String 数据集的字段名,指定哪些字段接收从下拉窗口返回的值。

五、通过 DropDownFormParams.PassParams 属性来指定哪些字段来作为参数传递给下拉窗口。该属性有如下选项:

pspByFieldNamesEh  – 将 PassFieldNames属性中指定的字段作为参数传递;

pspFieldValueEh   – 将当前编辑字段(当前列)的值作为参数传递;

pspRecordValuesEh  – 将当前数据集的全部字段作为参数传递;

(原文链接:http://www.tansoo.cn/?p=399)

Delphi 7 – 2006, CodeGear Delphi 2007, RAD Studio 2009, Embarcadero RAD Studio 2010, XE - XE4 What's new in version 6.2 + DropDownForms technology - customizing droped down windows. Typical DropDown window - is the list that appears in the TComboBox control when you click on the edit button with down arrow in the control. New technology of DropDropForms allows you to create forms that appear and work similarly to the drop down list of TComboBox. These forms can be displayed by pressing one of the edit buttons within controls TDBEditEh, TDBNumberEditEh, TInplaceEditor in DBGridEh etc. See detailed description of using DropDownForms in the document ; Section - DropDownForms and See an Example in the: \Demos\DropDownForm\Project1.dpr compiled project: \Demos\Bin\DropDownForm.Exe New properties to customize the drop-down Form are in the following classes: (For DBGridEh) TColumnEh.DropDownFormParam TColumnEh.EditButtons[i].DropDownFormParam (For DBVertGridEh) TFieldRowEh.DropDownFormParam TFieldRowEh.EditButtons[i].DropDownFormParam TDBEditEh.EditButton.DropDownFormParam TDBEditEh.EditButtons[i].DropDownFormParam In EditButtons for TDBNumberEditEh, TDBDateTimeEditEh, TDBComboBoxEh, TDBLookupComboBoxEh controls. (In DBVertGridEh) + Added possibility to group rows into categories. See TDBVertGridEh.RowCategories property. Assign category name in the property TFieldRowEh.CategoryName. The rows can be grouped by: Category Title, Field Type or presence/absence of values in the current record. + Added possibility to sort the rows by the row captions. See property TDBVertGridEh.RowsSortOrder. (В DBGridEh) + In DBGridEh at Design-Time it is allowed to create DB components and assign DataSource and DataSource.DataSet properties. Right-click above the Design-Time panel in the lower right corner of the Grid and select the menu to assign or create a required component.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值