itemchanged(long row,dwobject dwo,string data) return long
row:正在改变的值得行号(long类型)
dwo:是正在改变值的列对象的应用传递,不是列的名字
data:改变后的值
return值:
0:默认值,成功接受改变值
1:反对改变值并且焦点不移动
2:反对改变值且焦点移动
itemstring(row,"sfc_shop_order_header_status_code", primary!, TRUE)
取得传入行的原始信息
row:获取的是哪一行数据
column:sfc_shop_order_header_status_code->获取数据的列名
dwbuffer:primary!->主缓冲区,delete->删除缓冲区,filter->过滤缓冲区等中获取数据
boolean:true->获取原始值,false->获取当前值
getitemstring(row,col , primary!, TRUE)
col:要获取数据在数据窗口中的列号
getitemdate(row,col , primary!, TRUE)
getitemdatetime(row,col , primary!, TRUE)
If AncestorReturnValue <> 0 Then Return AncestorReturnValue
继承父窗口的内容,父窗口返回出错,子窗口返回值继承父窗口的返回值
弹出提示窗口:
String ll_rtn
ll_rtn=messagebox(" 提 示 "," 你将要修改纪录,是否继续",question!,yesno!)
if ll_rtn=1 then
messagebox(’ ’,rtn)
end if
完成功能:(状态下拉菜单只能选择完成,完成后不能取消)
String ls_status_code
long ll_rtn
//取得第row行sfc_shop_order_header_status_code列的原始数据
ls_status_code=itemstring(row,"sfc_shop_order_header_status_code", primary!, TRUE)
//判断数值改变的列是否sfc_shop_order_header_status_code列,不是返回0
if col = "sfc_shop_order_header_status_code" then
//判断选择是否符合要求,是返回0,否返回1(焦点不移动)或2(焦点移动)
if data = "F" or data = ls_status_code then
return 0
else
return 2
end if
end if
return 0
小细节:字符串居左,日期、时间居中,数据居右
clicked(integer xpos,integer ypos,long row,dwobject dwo) returns long
xpos:距离数据窗口的左边界的像素数
ypos:距离数据窗口的上边界的像素数
row:点击的第几行
dwo:点击的数据窗口
return值:
0:继续处理
1:阻止焦点改变
Constructor()return long(在数据窗口显示之前改变其属性)
destructor()return long(在数据窗口关闭之后立即发生)
//设置主菜单上的显示功能使增加、删除、修改、撤销删除为不可见
this.object.bands('main').tools('tinsert').visible = false
this.object.bands('main').tools('tdelete').visible = false
this.object.bands('main').tools('tundelete').visible = false
this.object.bands('main').tools('tupdate').visible = false
protect:保护sfc_shop_order_header_status_code列数据
//当次列数据的内容是F而且没有被修改过,被保护后不能被修改
if( sfc_shop_order_header_status_code = 'F' and not isRowModified(),1,0)
isRowModified()是否修改,如果修改返回true,否则返回false
messagebox('这里是标题内容','这里是提示内容')默认图标information!
MessageBox ( title, text {, icon {, button {, default } } } )
title :左上角的标题
text :提示内容
icon (可不选) 内容旁边的图标
值是:Information!(默认) StopSign! Exclamation! Question!
None!
button (可不选) 最下方的按钮
值是:OK!(默认)确定
OKCancel! 确定和取消
YesNo!是否
YesNoCancel! 是、否和取消
RetryCancel!重试和取消
AbortRetryIgnore! 中止、重试和忽略
FileExists ( filename )
指定文件是否存在,若存在返回true,不存在返回false,文件名为null,返回null
AddToLibraryList ( filelist )
在运行时添加一个应用程序或组件的路径
Return
1:运行在内部,不是一个独立的可执行文件
2:列表为空或是另一个内部发生错误
getcurrentdirectory()获得当前目录为目标程序
//点击按钮添加文件路径
string ls_pathname, ls_pathname_src
string ls_filename, ls_initpath
string ls_ext
integer li_ret
ls_filename = is_filename
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename = "新建 "
choose case parent.is_filetype
case "xls"
ls_ext = "Microsoft Excel(*.xls),*.xls,Microsoft Excel(*.xlsx),*.xlsx"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "Microsoft Excel 工作表"
ls_filename += ".xls"
case "dbf"
ls_ext = "Dbase III(*.dbf),*.dbf"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "dbf 文件"
ls_filename += ".dbf"
case "doc"
ls_ext = "Microsoft Word(*.doc),*.doc"getsavefilename
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "Microsoft Word 文档"
ls_filename += ".doc"
case "txt"
ls_ext = "文本文件(*.txt),*.txt"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "文本文档"
ls_filename += ".txt"
case "htm"
ls_ext = "超文本文件(*.htm),*.htm"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "超文本文件"
ls_filename += ".htm"
case "psr"
ls_ext = "报表格式文件(*.psr),*.psr"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "psr 文件"
ls_filename += ".psr"
case "xlsx"
ls_ext = "Microsoft Excel(*.xlsx),*.xlsx"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "Microsoft Excel 工作表"
ls_filename += ".xlsx"
case "wps"
ls_ext = "WPS(*.wps),*.wps"
if isnull(is_filename) or len(is_filename) <= 0 then ls_filename += "wps 文件"
ls_filename += ".wps"
end choose
ls_pathname_src = GetCurrentDirectory()
ls_initpath = "导出文件"
if not DirectoryExists(ls_initpath) then CreateDirectory(ls_initpath)
ls_initpath = ls_pathname_src + "\" + ls_initpath
ls_pathname = ls_initpath + "\" + ls_filename
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论