English

Problem: Resize ArcView windows to fit a new monitor size

Solution or Workaround

Summary

The ArcView windows are the wrong size when opening a project on another PC with a different size monitor.

Cause

The project file stores windows sizes in pixels units. Windows become larger or smaller when a project is moved to a machine with a different monitor pixel size.

Solution

· Use the View's corner handles to manually resize the window. If windows have moved off the visible extent of the monitor, they can be restored by using the Window menu items, like Tile or Cascade options.

· Use Avenue to automatically update window sizes.

1. Return the monitor dimensions of the PC the project was created on.

a. Open a new script window.
b. Paste the following code into the new script.

Code:
'-- Return the dimensions of your monitor.
Size = System.ReturnScreenSizeInches
Height = Size.GetY
Width = Size. GetX
MsgBox.Info("Height ="++Height.AsString+NL+"Width ="
++width.AsString,"Screen Size")


c. Compile and run the script.
d. Make a note of the width and height values.
Note:
If the numbers seem wrong, the monitor may be out of calibration. See the ArcView Help topic 'Calibrating your monitor' for more information.

2. Create a startup script for the project.

a. Open the project file in ArcView.
b. Open a new script window.
c. Paste the following code into the new script window.
Code:
'-- Query the current monitor for its size
thisScreenHeight = System.ReturnScreenSizeInches.GetY
thisScreenWidth = System.ReturnScreenSizeInches.GetX

'-- Find the difference between this screen
'-- and the screen you built the project on.
resizeFactorY = thisScreenHeight / origScreenHeight
resizeFactorX = thisScreenWidth / origScreenWidth

'-- Get the View, and find its current size
theView = av.GetProject.FindDoc("Your View")
viewWinHeight = theView.GetWin.ReturnExtent.GetY
viewWinWidth = theView.GetWin.ReturnExtent.GetX

'-- Resize the View DocWin so it is proportional
'-- to the size of this new monitor.
newViewWinHeight = viewWinHeight * resizeFactorY
newViewWinWidth = viewWinWidth * resizeFactorX
theView.GetWin.Resize(newViewWinWidth, newViewWinHeight)

d. Replace the text 'origScreenHeight' with the Height value in step 1.
e. Replace the text 'origScreenWidth' with the Width value returned in step 1.
f. Compile the script.
g. Switch to the Project Window.
h. Select Properties from the Project menu.
i. Click the button next to the Startup field.
j. Select the script.
k. Save the project.
Note:
When this project is opened the script will automatically adjust for any monitor size change.