Powerbuilder:弹出窗口的定位

发布于 2024-10-15 08:16:03 字数 548 浏览 4 评论 0原文

我有一个主从数据窗口。在详细信息窗口中,当用户单击一行时,我将打开另一个数据窗口作为弹出数据窗口,该窗口位于用户单击的行的正下方。只要详细信息窗口中的行数少于 11 行,它就可以正常工作。当窗口包含超过 11 行并且用户单击下部区域中的一行时,弹出窗口不会放置在应有的位置。

我的猜测是,当用户单击下部区域中的一行时,窗口会滚动到底部,并且某些行会因滚动而隐藏。如果由于滚动而隐藏了两行,则弹出窗口将在所需行下方打开两行。我的定位逻辑如下 -

// "parent" is the user object that contains the datawindow 
// "row" contains clicked row number
// "this" points to the detail datawindow

ll_detail_height = long(this.Object.DataWindow.Detail.Height)
dw_status.y = this.y + ( ll_detail_height * (row) ) + parent.y

我该如何解决这个问题?

I have a master-detail datawindow. In the detail window, when user clicks on a row, I am opening another datawindow as a Pop up datawindow which is positioned just below the row on which the user clicked. It works fine as long as there are less that 11 rows in the detail window. When the window contains more than 11 rows and the user clicks on a row from lower region, the popup isn't placed where it's supposed to be.

My guess is that when the user clicks on a row in the lower region, the window is scrolled to the bottom and some rows gets hidden as a result of scrolling. If two rows gets hidden as a result of scrolling, the popup is opening tow rows below the desired row. My positioning logic is as below -

// "parent" is the user object that contains the datawindow 
// "row" contains clicked row number
// "this" points to the detail datawindow

ll_detail_height = long(this.Object.DataWindow.Detail.Height)
dw_status.y = this.y + ( ll_detail_height * (row) ) + parent.y

How can I resolve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

当梦初醒 2024-10-22 08:16:03

我已经找到解决办法了技巧是使用详细数据窗口的 F​​irstRowOnPage 属性并使用它来确定 y 位置 -

ll_first_row =  long( this.Object.DataWindow.FirstRowOnPage)
ll_row = row - ll_first_row + 1
ll_detail_height = long(this.Object.DataWindow.Detail.Height)
dw_status.y = this.y + ( ll_detail_height * ll_row ) + parent.y

I've got the solution. The trick is to use FirstRowOnPage property of the detail datawindow and use it to determine the y position -

ll_first_row =  long( this.Object.DataWindow.FirstRowOnPage)
ll_row = row - ll_first_row + 1
ll_detail_height = long(this.Object.DataWindow.Detail.Height)
dw_status.y = this.y + ( ll_detail_height * ll_row ) + parent.y
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文