Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 2 Jahren, 11 Monaten
Letzter Beitrag:
vor 2 Jahren, 11 Monaten
Beteiligte Autoren:
David Egan, DarrenF

[WD17] Popup window on a Table

Startbeitrag von David Egan am 20.03.2015 02:04

Hi
I have a table with 5 columns visible. If the user right clicks in the first column I would like a window to popup at the right margin of that column. I therefore have a button off the screen, linked to the Right Mouse click in the column, which fires up the popup.

OpenPopupPosition does not recognise the individual columns/rows of the table so I can't use that. I therefore thought I would use OpenChildor OpenSister with the X & Y positions stipulated. The problem I have is finding the position of the right margin of the column. I can get the position where the mouse click appears easily enough but of course this can be anywhere in that column & I don't want my popup to obscure that data.

The window which contains the table is an MDI child window so I thought MDIParent..X + Window..X + Table..X + ColumnWidth should get me pretty close but it's not. Ignoring column width I'm approx 250 pixels short. As pretty well everything can be moved around, resized etc I have to code this dynamically or at least know why I'm out 250 pixels & that it will be constant.

Anyone have any ideas what I'm missing or if there's an easier way to do this?

Thanks

David

Antworten:

Well, I've got a work around but if anyone has any better ideas I'd be pleased to hear them.

I'm using CursorPos to give me the X & Y coordinates & then TableInfoxy to give me the column & row in the table where the mouse click originated. I've simply added the column width to the X coordinate & then run a loop backwards from that to X with TableInfoxy giving me the column no. on each iteration. As soon as the column is the same as my 'mouse click' column I break out of the loop. Not particularly elegant but it does work!

David

von David Egan - am 20.03.2015 06:27
Hi David,

Could you use TableSelect? This function recognises table column subscripts using tsColumn?

von DarrenF - am 20.03.2015 13:52
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.