Powerbuilder: Popup Positioning

I have a master-detail data window. In the detailed window, when the user clicks on a row, I open another data window as a popup data window, which is located just below the line that the user clicked on. It works fine as long as there are less than 11 lines in the details window. When a window contains more than 11 lines, and the user clicks on a line from the bottom area, the popup does not fit where it should be.

I assume that when the user clicks on a row in the lower pane, the window scrolls to the bottom, and some rows are hidden as a result of scrolling. If two lines are hidden as a result of scrolling, a pop-up window opens towing lines below the desired line. My positioning logic is 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 solve this problem?

+4
source share
1 answer

I have a solution. The trick is to use the FirstRowOnPage property for a detailed data window 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 
+5
source

Source: https://habr.com/ru/post/1337640/


All Articles