Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ListBox & "x/y" = simple example of
#1
Gintaras,

Could you provide me with a simple example of how to place this listbox on a specific spot on the display/monitor via x/y coordinators:

EXAMPLE BEGINS:****************************
sel(ListDialog("1[]2[]3" "Description of Listbox" "Title of Listbox"))
case 1
case 2
case 3
case else ret
EXAMPLE ENDS:*****************************

Thanks ONCE MORE!!!
#2
Macro Macro2713
Code:
Copy      Help
int x=100 ;;100 pixels from left
int y=-1 ;;1 pixels from bottom
;_monitor=2
sel(ListDialog("1[]2[]3" "Description of Listbox" "Title of Listbox" 0 0 x y))
,case 1
,case 2
,case 3
,case else ret

;The 'monitor=2' line would move the dialog to the second monitor.
;The dialog then should be at x y relative to that monitor.
;However current QM version has a bug: if x or y are >0, the dialog would be in a wrong place in that monitor, because x and y then are interpreted as relative to the primary monitor (bug).
;Workarounds:
;;;1. Let x y be 0 or negative.
;;;2. Calculate and use raw x y relative to the primary monitor, and add flag 64.
;;;3. Don't use _monitor until QM 2.4.3.9.

Macro Macro2714
Code:
Copy      Help
;Gets coordinates of monitor 2 and shows dialog in that monitor using raw calculated coordinates.

int mx my mw mh; GetWorkArea mx my mw mh 0 2 ;;here 2 is monitor
sel(ListDialog("1[]2[]3" "Description of Listbox" "Title of Listbox" 64 0 mx+100 my+mh-300))
,case 1
,case 2
,case 3
,case else ret
#3
Thank you again! I see how this goes....


Forum Jump:


Users browsing this thread: 1 Guest(s)