Created attachment 174619 [details] This spreadsheet will allow you to test the ratios of the measured and model heights of three different dialogs. I wanted to dynamically place a dialog above the active cell. This requires the position of the top left corner of the cell, and the height of the dialog. The origin for the cells is the top left corner of cell A1. The origin of the dialog is the top left corner of the Calc sheet. The units for heights for the position of the cell and dialog are different. I measure the height of the dialog by aligning the top of the dialog with the top of the active cell, and then doing the same with the bottom of the dialog with the top of the cell. I then get the ratio of this height with the dialog.model.height. Measured Model Ratio 200 78 2.57 258 106 2.44 564 247 2.29 The ratios are not consistent, and vary with the height of the dialog. Also, the ratios change depending on how close, vertically, the active cell is to the Row 0. One of our users tried this one a system running Ubuntu, and he had ratios varying depending on the dialog etc. His ratios were quite different from mine (windows vs Ubuntu) It also seems that if I dynamically place the dialog so the top of the box aligns with the top of the active cell that, if it aligns for a row near the top of the spreadsheet, it drifts off the top of the row as the active row is farther down. I suspect an error in a decimal place in the conversion com.sun.star.util.MeasureUnit.MM_100TH or in Widows. It isn't a big thing, it may be in the fourth decimal. Finally, things don't align properly if Calc is not maximized and it moves to a different place on the screen. I am using Edition Windows 10 Home Version 21H1 Installed on 2020-11-26 OS build 19043.1165 Experience Windows Feature Experience Pack 120.2212.3530.0 I have 8 GB RAM. Processor: Intel(R) Pentium(R) CPU 2127U @ 1.90GHz 1.90 GHz I have attached a very stripped down version of our spreadsheet. You can run various tests with three different dialogs. To run a test, right click on a cell and choose Event Input Wizard. It is not imperative that we place the dialog exactly, but this could be an issue for some of our users. At the moment, two of our users have requested this feature. Consequently, I have chosen "minor" for severity.
Vladimir, the test case uses your code; could you please take a look if you see what the problem is, and possibly create a simpler test case? Thank you!
Mike, the problem was discussed in the topic "Dynamically position a dialog" ([1]). The solution was found using the AccessibleContext interfaces. The example in the attachment TestCellCoordinates.ods . Double-clicking a cell should position the dialog at the top left corner of the cell. The relative position must be the same for all cells shown on the screen and not change when the zoom changes. [1] https://ask.libreoffice.org/t/dynamically-position-a-dialog/67289/32
Created attachment 180417 [details] TestCellCoordinates.ods
Created attachment 180418 [details] TestCellCoordinates.ods
Thank you. I have tested those two spreadsheets, and they work very well! Your functions will be very useful.
(In reply to Vladimir Sokolinskiy from comment #2) > Mike, the problem was discussed in the topic "Dynamically position a dialog" > ([1]). > The solution was found using the AccessibleContext interfaces. > The example in the attachment TestCellCoordinates.ods . Double-clicking a > cell should position the dialog at the top left corner of the cell. The > relative position must be the same for all cells shown on the screen and not > change when the zoom changes. > > [1] https://ask.libreoffice.org/t/dynamically-position-a-dialog/67289/32 Vladimir: I see the reporter is happy, but do you think that something should be fixed or enhanced in LibreOffice code?
No reply yet, so adjusting status to something more correct.