Re: how to know 2 monitors are in use?
Someone loves overcomplicating things. I don't, most of the time. I just ran up a stack with 2 scrolling text fields called "VIDZ" and :VIDZ2" repectively, so that relative screen middles could go in the first one and absolute screen middles in the second one, and then popped this code in a button: on mouseUp put empty into fld "VIDZ" put empty into fld "VIDZ2" put the screenRects into fld "VIDZ" put 1 into VDUZ repeat until line VDUZ of fld "VIDZ" is empty put item 1 of line VDUZ of fld "VIDZ" into VW1 put item 3 of line VDUZ of fld "VIDZ" into VW2 put ((VW2-VW1)/2) into WIDD put (((VW2-VW1)/2)+VW1) into WIDD2 put item 2 of line VDUZ of fld "VIDZ" into VH1 put item 4 of line VDUZ of fld "VIDZ" into VH2 put ((VH2-VH1)/2) into HITE put (((VH2-VH1)/2)+VH1) into HITE2 put " screen centre at" && WIDD & "," && HITE after line VDUZ of fld "VIDZ" put " screen centre at" && WIDD2 & "," && HITE2 after line VDUZ of fld "VIDZ2" add 1 to VDUZ end repeat end mouseUp I'll try to post the stack to the Forums, but my ISP is currently playing "silly buggers" so I cannot guarantee anything. Richmond. On 26.09.2018 17:37, Bob Sneidar via use-livecode wrote: Or you could use the recent line intersect function recently posted by Richmond on the top,left bottom,right and bottom,left and top,right of your chosen monitor and round the results: http://forums.livecode.com/viewtopic.php?f=7=31565 Bob S On Sep 25, 2018, at 18:57 , Nicolas Cueto via use-livecode wrote: Thank you, Paul. Using "screenrects" as Paul suggested, here, for future reference, is a script snippet that places a stack on the right monitor: put the screenrects into tScrRects if the environment is "development" and the number of lines in tScrRects > 1 then -- CENTRE THE STACK ON THE RIGHT MONITOR put line 2 of tScrRects into tRMon -- right monitor rect put ((item 3 of tRMon - item 1 of tRMon) / 2 + item 1 of tRMon) & comma & \ ((item 4 of tRMon - item 2 of tRMon) / 2) into tRect set the loc of this stack to tRect else -- CENTRE THE STACK ON TE LEFT MONITOR set the loc of this stack to the screenloc end if -- Nicolas Cueto ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: how to know 2 monitors are in use?
All well and good, in theory, but I have just been fooling around with a monitor that gives me 0,0,1600,900, and then "getting its knickers in a twist" because when I feed the topleft of the VDU into my calculations I get a "tried to divide 0 by 0" thing. I suppose (?) one of the ways round this would be to change 0,0,1600,900 to 1,1,1600,900 and live with the "tragedy" that everything would be one pixel "out of whack". Richmond. On 26.09.2018 17:37, Bob Sneidar via use-livecode wrote: Or you could use the recent line intersect function recently posted by Richmond on the top,left bottom,right and bottom,left and top,right of your chosen monitor and round the results: http://forums.livecode.com/viewtopic.php?f=7=31565 Bob S On Sep 25, 2018, at 18:57 , Nicolas Cueto via use-livecode wrote: Thank you, Paul. Using "screenrects" as Paul suggested, here, for future reference, is a script snippet that places a stack on the right monitor: put the screenrects into tScrRects if the environment is "development" and the number of lines in tScrRects > 1 then -- CENTRE THE STACK ON THE RIGHT MONITOR put line 2 of tScrRects into tRMon -- right monitor rect put ((item 3 of tRMon - item 1 of tRMon) / 2 + item 1 of tRMon) & comma & \ ((item 4 of tRMon - item 2 of tRMon) / 2) into tRect set the loc of this stack to tRect else -- CENTRE THE STACK ON TE LEFT MONITOR set the loc of this stack to the screenloc end if -- Nicolas Cueto ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: how to know 2 monitors are in use?
Or you could use the recent line intersect function recently posted by Richmond on the top,left bottom,right and bottom,left and top,right of your chosen monitor and round the results: http://forums.livecode.com/viewtopic.php?f=7=31565 Bob S > On Sep 25, 2018, at 18:57 , Nicolas Cueto via use-livecode > wrote: > > Thank you, Paul. > > Using "screenrects" as Paul suggested, here, for future reference, is a > script snippet that places a stack on the right monitor: > > put the screenrects into tScrRects > if the environment is "development" and the number of lines in tScrRects > > 1 then > -- CENTRE THE STACK ON THE RIGHT MONITOR > put line 2 of tScrRects into tRMon -- right monitor rect > put ((item 3 of tRMon - item 1 of tRMon) / 2 + item 1 of tRMon) & > comma & \ >((item 4 of tRMon - item 2 of tRMon) / 2) into tRect > set the loc of this stack to tRect > else > -- CENTRE THE STACK ON TE LEFT MONITOR > set the loc of this stack to the screenloc > end if > -- > Nicolas Cueto ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: how to know 2 monitors are in use?
Thank you, Paul. Using "screenrects" as Paul suggested, here, for future reference, is a script snippet that places a stack on the right monitor: put the screenrects into tScrRects if the environment is "development" and the number of lines in tScrRects > 1 then -- CENTRE THE STACK ON THE RIGHT MONITOR put line 2 of tScrRects into tRMon -- right monitor rect put ((item 3 of tRMon - item 1 of tRMon) / 2 + item 1 of tRMon) & comma & \ ((item 4 of tRMon - item 2 of tRMon) / 2) into tRect set the loc of this stack to tRect else -- CENTRE THE STACK ON TE LEFT MONITOR set the loc of this stack to the screenloc end if -- Nicolas Cueto On Wed, 26 Sep 2018 at 10:03, Paul Dupuis via use-livecode < use-livecode@lists.runrev.com> wrote: > "the screenrects" will return the rectangles of all active monitors with > the default monitor as the 1st line. > > Unfortunately, "the screenLoc" only returns the center of the default > monitor. You would need to get the rect of any other monitor and > calculate the center for centering a dialog on other monitors. > > > > On 9/25/2018 8:52 PM, Nicolas Cueto via use-livecode wrote: > > During "development" on Windows with 2 monitors, how to use "set the loc > of > > this stack to the screenloc" so that a stack centres in on one or the > other > > monitor? (And, if not in the development environment? say, a standalone?) > > > > Thanks. > > > > -- > > Nicolas Cueto > > ___ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: how to know 2 monitors are in use?
"the screenrects" will return the rectangles of all active monitors with the default monitor as the 1st line. Unfortunately, "the screenLoc" only returns the center of the default monitor. You would need to get the rect of any other monitor and calculate the center for centering a dialog on other monitors. On 9/25/2018 8:52 PM, Nicolas Cueto via use-livecode wrote: > During "development" on Windows with 2 monitors, how to use "set the loc of > this stack to the screenloc" so that a stack centres in on one or the other > monitor? (And, if not in the development environment? say, a standalone?) > > Thanks. > > -- > Nicolas Cueto > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
how to know 2 monitors are in use?
During "development" on Windows with 2 monitors, how to use "set the loc of this stack to the screenloc" so that a stack centres in on one or the other monitor? (And, if not in the development environment? say, a standalone?) Thanks. -- Nicolas Cueto ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode