VS:GetScreen: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 47: Line 47:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark>
 
([[User:Orso.b.schmid|Orso]], 2014.08.19): The values returned are pixels. For example my iMac returns "0, 0, 2560, 1440".




This seems to crash VW on Win98.
This seems to crash VW on Win98.


Works OK on 1000 8367 on XP.</remark>
Works OK on 1000 8367 on XP.</remark>
Line 70: Line 68:
==== Python ====
==== Python ====
<code lang="py">
<code lang="py">
 
def Example():
x1, y1, x2, y2 = vs.GetScreen()
vs.Message(x1,' ',y1,' ',x2,' ',y2);
Example()
</code>
</code>
</sample>
</sample>

Revision as of 09:29, 19 August 2014

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Procedure GetScreen returns the top-left and bottom-right corners of the display screen. These values will change as different sized screens are used. This procedure can be utilized to aid in development of dialog boxes, or as a check of screen size for sizing or displaying custom dialogs.

PROCEDURE GetScreen(
VAR x1 :INTEGER;
VAR y1 :INTEGER;
VAR x2 :INTEGER;
VAR y2 :INTEGER);
def vs.GetScreen():
    return (x1, y1, x2, y2)

Parameters

x1 INTEGER Returns X coordinate of top left of screen.
y1 INTEGER Returns Y coordinate of top left of screen.
x2 INTEGER Returns X coordinate of bottom right of screen.
y2 INTEGER Returns Y coordinate of bottom right of screen.

Remarks

(Orso, 2014.08.19): The values returned are pixels. For example my iMac returns "0, 0, 2560, 1440".


This seems to crash VW on Win98.

Works OK on 1000 8367 on XP.

Example

VectorScript

PROCEDURE Example;
VAR 
x1, y1, x2, y2 :INTEGER;
BEGIN
GetScreen(x1, y1, x2, y2);
Message(x1,' ',y1,' ',x2,' ',y2);
END;
RUN(Example);

Python

def Example():
	x1, y1, x2, y2 = vs.GetScreen()
	vs.Message(x1,' ',y1,' ',x2,' ',y2);
Example()

Version

Availability: from All Versions