社区
PowerBuilder
帖子详情
我想在数据窗口上输入查询条件,然后查询,直接在这个数据窗口上显示结果
gongfar
2007-12-16 11:00:29
我想在数据窗口上输入查询条件,然后查询,直接在这个数据窗口上显示结果。
我现在的做法:设置数据窗口上所有字段的retrieval argument,在数据窗口上insertrow(0),然后在空行上输入查询条件,点击查询按钮后,在数据窗口上显示结果。清屏按钮reset 数据窗口,然后再insertrow(0)
感觉很慢,而且不太稳定。
有什么成熟的做法?
...全文
371
7
打赏
收藏
我想在数据窗口上输入查询条件,然后查询,直接在这个数据窗口上显示结果
我想在数据窗口上输入查询条件,然后查询,直接在这个数据窗口上显示结果。 我现在的做法:设置数据窗口上所有字段的retrieval argument,在数据窗口上insertrow(0),然后在空行上输入查询条件,点击查询按钮后,在数据窗口上显示结果。清屏按钮reset 数据窗口,然后再insertrow(0) 感觉很慢,而且不太稳定。 有什么成熟的做法?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
jlwei888
2007-12-16
打赏
举报
回复
你问得基本都是基本问题
DW本身就有这个功能
dw_1.Object.DataWindow.QueryMode = yes
之后再retrieve()
dawugui
2007-12-16
打赏
举报
回复
5、编写用户对象的Constructor事件:
String ls_Syntax
String ls_line
IF This.DataObject = '' Then Return
//创建Footer区
IF Integer(This.Describe("DataWindow.Footer.Height") ) < 120 Then
This.Object.DataWindow.Footer.Height='120'
End IF
//在Footer区添加线
ls_line = 'Create line(band=footer ' + &
'background.mode="2" background.color="16777215"' + &
'pen.style="0" pen.width="5" pen.color="0" x1="0" y1="2" ' + &
'x2="' + String(This.Width - 100) + '" y2="2" )~r~n'
this.modify( ls_line )
//获取设计时的数据窗口语法串
ls_Syntax = This.object.DataWindow.Syntax
//添加按钮语法串
ls_Syntax = uf_addbutton( ls_Syntax )
if this.Create( ls_Syntax ) <> 1 then
MessageBox('提示信息','创建数据窗口出错', StopSign!)
End If
6、从u_dw_button继承就可以了。如下图:
图贴不上来.
dawugui
2007-12-16
打赏
举报
回复
数据窗口中按钮的封装
在数据库的操作中,对数据表记录的检索、添加、删除和保存等操作是最基本和最常用的,可以说这些操作是数据表的标准操作。但PB并没有提供上述封装好的按钮对象,如果每次都要来添加命令按钮并编写脚本,工作是很繁琐的,而且还不能保证界面的一致性。
在PB的数据窗口对象中,可以直接放置按钮对象,而且开发人员既可以给这些按钮制定默认的操作,也可以自己定义按钮的功能。在可以指定的默认操作中就包含了上面提到的所有数据表的基本操作,这样一来在数据窗口需要相应的按钮时,只需要加入按钮对象然后指定其功能就行了。
实际上可以利用PB面向对象的编程技术,实现一个包含标准操作按钮的数据窗口对象,这样在需要用到标准操作的时候,只需要从该对象继承即可满足基本的数据应用需求。
实现过程如下(利用PB9自带数据库,EAS Demo DB V9):
1、建立一个工作空间(workspace),取名为:dwbutton。
2、建立一个应用(application),取名为:dwbutton。
3、建立一个标准的可视用户对象,类型为:datawindow,取名为:u_dw_button。
4、定义用户对象级私有函数uf_addbutton(string as_oldsyntax) return string
//功能:修改数据窗口语法串,为其增加常用功能按钮
//入口参数:as_OldSyntax 原有数据窗口语法串
//返回值: ls_NewSyntax 修改后的语法串
//应用条件:数据窗口中有Footer区, 高度> 90的区域是按钮带区
String ls_AddButton
String ls_NewSyntax
Integer li_button_width
Integer li_button_x
//确定Button的位置参数
li_button_width = (This.Width + 20) / 10 - 40
IF li_button_width > 220 Then
li_button_width = 220
li_button_x = (This.Width - 240*10) / 2
IF li_button_x <=0 Then li_button_x = 10
Else
li_button_x = 20
End if
ls_NewSyntax = as_OldSyntax
//---------------添加按钮语法串------------------------------
//检索按钮
ls_AddButton = 'button(band=footer name=cb_retrieve text="检索" ' + &
'enabled=yes action="2" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//首页按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_first text="首页" ' + &
'enabled=yes action="6" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//上页按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_prior text="上页" ' + &
'enabled=yes action="5" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//下页按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_next text="下页" ' + &
'enabled=yes action="4" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//末页按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_last text="末页" ' + &
'enabled=yes action="7" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//添加按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_append text="添加" ' + &
'enabled=yes action="11" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//插入按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_insert text="插入" ' + &
'enabled=yes action="12" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//删除按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_delete text="删除" ' + &
'enabled=yes action="10" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//保存按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_update text="保存" ' + &
'enabled=yes action="13" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
//打印按钮
li_button_x = li_button_x + li_button_width + 20
ls_AddButton = 'button(band=footer name=cb_print text="打印" ' + &
'enabled=yes action="15" border="1" color="8388608" ' + &
'x="' + string(li_button_x) + '" y="20" height="90" ' + &
'width="' + string(li_button_width) + '" ' + &
'vtextalign="0" htextalign="0" visible="1" ' + &
'font.charset="0" font.face="Arial" font.family="2" ' + &
'font.height="-9" font.pitch="2" font.weight="400" ' + &
'background.mode="2" background.color="12639424" )~r~n'
ls_NewSyntax = ls_NewSyntax + ls_AddButton
return ls_newsyntax
dawugui
2007-12-16
打赏
举报
回复
自己在窗口中放几个按钮,然后在按钮中写你需要的代码.
如果非要按你的想法:看我下面贴的东西你是否感兴趣.
jlwei888
2007-12-16
打赏
举报
回复
在窗口上部放几个编辑框,按钮,这样 做多简单
jlwei888
2007-12-16
打赏
举报
回复
那么设置显示列定义(column specification)空格,在需要检索的列的prompt列上打勾,
那么在retrieve()时,弹出检索窗口
要想又好看又实用的话,还的自己做!
gongfar
2007-12-16
打赏
举报
回复
dw_1.Object.DataWindow.QueryMode = yes 后,显示的行数很多,怎么才能只显示一行用于输入查询条件
Android gcore文件解析[代码]
本文详细介绍了在Android平台上使用linux-ramdump-parser-v2工具解析高通Q+A平台生成的gcore文件的步骤和方法。首先,需要将gcore文件解压并解析为ramdump文件,使用qvm_dump_parser工具完成这一过程。接着,通过linux-ramdump-parser-v2工具解析ramdump文件,需要准备Python环境、gcc调试工具,并配置local_settings.py文件。文章还提供了具体的命令示例和可能遇到的错误及解决方法,帮助开发者顺利完成gcore文件的解析工作。
光伏系统MPPT、恒功率控制切换Simulink仿真
光伏系统MPPT、恒功率控制切换Simulink仿真内容概要:本文档主要围绕光伏系统中的MPPT(最大功率点跟踪)与恒功率控制之间的切换机制,在Simulink环境中进行建模仿真研究。通过构建光伏发电系统的仿真模型,实现两种控制模式的平滑切换,以应对光照强度变化、负载波动等实际工况,提升系统运行效率与稳定性。文中涵盖了控制策略的设计、仿真模型搭建及结果分析,重点展示了MPPT算法(如扰动观察法或增量电导法)与恒功率控制的协调逻辑,并验证了在不同环境
条件
下系统响应的动态性能与稳态精度。; 适合人群:具备一定电力电子与自动控制理论基础,熟悉MATLAB/Simulink仿真环境的电气工程、新能源相关专业的本科生、研究生及从事光伏系统研发的工程技术人员。; 使用场景及目标:①用于教学实验中帮助学生理解光伏系统的核心控制策略;②为光伏逆变器控制系统开发提供仿真验证方案;③支持科研项目中对多模式切换控制算法的研究与优化; 阅读建议:建议结合MATLAB/Simulink软件动手实践,重点关注控制模块的设计逻辑与参数整定方法,同时可扩展研究不同MPPT算法对切换性能的影响,以深化对光伏系统动态行为的理解。
RK3588构建Ubuntu根文件系统[项目代码]
本文详细介绍了基于RK3588开发板构建Ubuntu 22.04根文件系统的完整流程。内容包括环境准备、根文件系统构建及镜像打包三大部分。环境准备部分涵盖Ubuntu Base下载、依赖软件安装、根文件系统解压与配置;构建部分包括必要软件安装、桌面环境配置、用户管理、网络设置等系统定制化操作;最后通过脚本打包生成可烧录的根文件系统镜像。文章提供了从零开始构建定制化嵌入式Linux系统的实践指南,适合需要在RK3588平台上部署Ubuntu系统的开发者参考。
LMCC模型下载、环境配置及代码实现全流程解析(附模型下载网址)
内容概要:本文详细介绍了在Windows和Linux系统上配置LMCC例卷机试所需的Python、PyTorch及Transformers库的完整环境搭建流程,并提供了针对T1和T2题目的代码解析。T1聚焦于构建系统提示词、应用聊天模板拼接
输入
以及实现单条与批量推理的核心逻辑;T2则涉及句向量的last-token池化方法、文本相似度计算及满足特定
条件
的数学问题
数据
集生成策略,同时强调了模型下载的国内外替代途径以应对网络限制。; 适合人群:具备Python编程基础,熟悉深度学习框架PyTorch和Hugging Face Transformers库,正在准备或参与类似LMCC机试的技术人员或学生;; 使用场景及目标:①指导考生正确配置本地开发环境并理解试题背后的实现机制;②帮助理解如何利用Hugging Face工具进行prompt工程、文本编码、模型推理与嵌入向量处理;③掌握受限
条件
下模型下载的可行方案,提升本地调试与评测效率; 阅读建议:此资源结合环境配置与代码实现,建议读者按步骤实操环境部署,深入理解每一段代码的功能与设计意图,尤其关注system prompt设计、token处理逻辑与相似度筛选机制,在实践中同步调试与优化代码。
ArcGIS分式注记表达[项目代码]
本文介绍了ArcGIS中分式注记的三种表达方式,通过具体的程序代码示例展示了不同的注记格式。第一种方式结合了字段OLD和name,使用vbcrlf进行换行;第二种方式则通过字段A02、A04、A06和A07的组合,并添加了连接符和换行符;第三种方式则利用字段MC、SSQY和SHAPE_Area,通过chr(10)实现换行,并添加了分隔线。这些方法为ArcGIS用户提供了灵活多样的注记表达选择,适用于不同的地图标注需求。
PowerBuilder
1,108
社区成员
66,453
社区内容
发帖
与我相关
我的任务
PowerBuilder
PowerBuilder 相关问题讨论
复制链接
扫一扫
分享
社区描述
PowerBuilder 相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章