预定义组件 wxFORM 用来显示一个输入界面,包括单行文本入框、富文本框、列表框、下拉框、复选框、按钮等常用控件,输入的数据可以作为参数提交给链接的页面来保存到数据库中或者作为查询参数。

OBJECT wxFORM aForm
{
OBJECT wxEDIT aEdit
{
aEdit.Name= Edit
aEdit.Rect[]= 10, 60, 180, 20
aEdit.Default= " 单行文本编辑框 "
}
OBJECT wxRICHEDIT aREdit
{
aREdit.Name= REdit
aREdit.Rect[]= 10, 90, 180, 40
aREdit.Default= " 富文本编辑框 "
}
OBJECT wxCHECKBOX aCheckBox
{
aCheckBox.Name= CheckBox
aCheckBox.Rect[]= 95, 190, 16, 16
aCheckBox.Default= 1
}
OBJECT wxCOMBOBOX aComboBox
{
aComboBox.Name= ComboBox
aComboBox.Rect[]= 95, 140, 90, 80
aComboBox.Default= "aa\bb\cc\dd\ee\ff"
}
OBJECT wxLISTBOX aListBox
{
aListBox.Name= ListBox
aListBox.Rect[]= 10, 140, 80, 80
aListBox.Default= "aa\bb\cc\dd\ee\ff"
}
OBJECT wxBUTTON aButton
{
aButton.Name= Confirm
aButton.Rect[]= 10, 222, 80, 20
aButton.Default= " 返回 "
aButton.Command= VK_LEFT
}
OBJECT wxBUTTON bButton
{
bButton.Name= Confirm
bButton.Rect[]= 100, 222, 80, 20
bButton.Default= " 提交 "
bButton.Command= VK_RIGHT
}
aForm.Rect[]= 18, 58, 160, 140
aForm.Link= grid.mas
aForm.Attachment[]= 1, 0
}
以上代码包含了所有类型的输入控件,当按下右键进入链接页面 grid.mas 的时候,所有输入的内容都自动形成参数一起传递给 grid.mas ,在 grid.mas 中可以通过 sysPARAMETER. 控件名的形式来读取到数据。
在 wxFORM 中虽然没有定义 wxPARAMETER ,但是系统自动默认包含有如下的定义:
OBJECT wxPARAMETER aParam
{
aParam. 控件名 = 控件值
…
}
当执行链接进入下一级页面时,根据此定义来形式参数传递进入。
其中 OBJECT wxBUTTON 的参数 aButton.Command= 具有系统预定义的功能可供选择:
aButton.Command= VK_LEFT
aButton.Command= VK_RIGHT
aButton.Command= VK_UP
aButton.Command= VK_DOWN
这四个功能表示按下对应的四个控制键。
第一页
|