属性和代码如下
wroot_dw_query属性
X = Y = Width = Height =
Visible = true Enabled = true TitleBar = true Title = 定位查询
ControlMenu = true Border = true WindowType = response! WindowState = normal!
BackColor =
窗口实例变量
Boolean ib_changed
Long MaxEditRow =
String sWhere oldsql orisql is_title is_section = WhereClause
DataWindow dw_resultdw_detail
pfc_n_cst_string inv_string
string sSyntax
注释apfc_n_cst_string 为PFC用户对象
窗口事件代码
close 事件
功能将用户本次所输入的查询条件记录到文件sIniFile的WhereClausen小节中去以备下次启动时置初始查询条件
open 事件
功能设置初始值具体请看代码中的注释
integer i row li_where_row =
string tmp
str_result_column lstr_
//结构str_result_column的成员adw_result指查询结果所产生作用的dw
// 成员adw_column指在本窗口查询条件所要显示的dw
lstr_ = MessagePowerObjectParm
dw_result = lstr_adw_result
dw_detail = lstr_adw_column
if isnull(dw_result) or not isvalid(dw_result) then return
if isnull(lstr_adw_column) or not isvalid(lstr_adw_column) then return
window act_w
act_w=MainWindowgetactivesheet()
x = act_wx +
y = act_wy + act_wheight height+
width = act_wwidth
cb_execx=width cb_execwidth
cb_exitx=width cb_execwidth
dw_wherex=
dw_whereWidth = width * dw_whereX cb_execwidth
//s
dw_columnvisible = False
wf_setcolumn(lstr_adw_column dw_column)
//orisql = dw_resultObjectDataWindowTableSelect //原始语法close中用
orisql = dw_resultGetSqlSelect() //上句对CrossTab无效
oldsql = lower(orisql)
For i = to li_where_row
dw_whereInsertRow()
Next
dw_wheresetrowfocusindicator(Hand!)
dw_whereScrollToRow()
dw_whereSetColumn(column)
cb_execSetFocus()
datawindowchild dwc
dw_whereGetChild(columndwc)
dwcSetTransObject(sqlca)
dwcReset()
For i = to dw_columnRowCount()
tmp = dw_columnGetItemString(i)
row = dwcInsertRow()
dwcSetItem(rowtmp)
Next
//将用户上次所输入的查询条件从文件sIniFile的WhereClausen小节中取出来
//本次启动时置为初始查询条件
window w_parent
if dw_resultGetParent()typeof() = window! then
w_parent = dw_resultGetParent()
is_title = w_parenttitle
else
is_title = dw_resultDataObject
end if
ib_changed = True
row =
tmp =
is_title = gnv_appis_regkey + \ + is_title + \ + scname
For i = to li_where_row
RegistryGet(is_title is_section + String(i) RegString! tmp)
//tmp = ProfileString(sinifileis_titleWhereClause + string(i))
if tmp <> and (Not IsNull(tmp)) then
//SetProfileString(sinifileis_titleWhereClause + string(i))
RegistrySet(is_title is_section + String(i) RegString! )
row ++
dw_whereobjectdata[row] = inv_stringof_gettoken(tmp )
dw_whereobjectdata[row] = inv_stringof_gettoken(tmp )
dw_whereobjectdata[row] = inv_stringof_gettoken(tmp )
dw_whereobjectdata[row] = inv_stringof_gettoken(tmp )
dw_whereobjectdata[row] = inv_stringof_gettoken(tmp )
dw_whereobjectdata[row] = inv_stringof_gettoken(tmp )
end if
Next
MaxEditRow = row // MaxEditRow 为dw_where中当前已编辑过的最大行的行号实例变量
If MaxEditRow = Then MaxEditRow =