开发者

Powerbuilder: Positioning of a popup

开发者 https://www.devze.com 2023-02-07 06:13 出处:网络
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 clic

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开发者_StackOverflow社区 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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号