MoveResizeWindow (function;pixels;where)

We think you will find this one of the most useful functions in your collection. We use it in every solution we write. Add it to script steps New Window, Go To Related Record and Move/Resize Window.

Replace the "function" parameter with the name of the calculation step in the new window dialog box. Height, Width, Distance from Top, Distance from Left. The "pixels" parameter is the height of the window in the Height and Top function and the width in the Width and Left functions. "where" refers to the position on the screen where you want the window and can be Top, Bottom, Left, Right, Center or Offset. If you use offset as a parameter then pixels is the amout of offset. Positive values will move the window right and down. Negative values move the window up and right.

Download a copy of DataIsland Functions and see this function at work as the opening window scrolls on and off the screen.

MoveResizeWindow (function;pixels;where)

Case (

function = "Height" ; pixels + (Get ( WindowHeight ) - Get ( WindowContentHeight )) + 1; // Given the height in pixels of the target layout area, returns the height parameter required to display it.

function = "Width" ; pixels + (Get ( WindowWidth ) - Get ( WindowContentWidth )); // Given the width in pixels of the target layout area, returns the width parameter required to display it.

function = "Top" ; // In the Move/Resize Window script step.

Case (

where = "Top" ; 0 ; // Places the window at the top of the screen

where = "Center" ; ( Get ( WindowDesktopHeight ) - MoveResizeWindow ( "Height"; pixels; "" ) ) / 2 ; // Places the window at the vertical center of the screen.

where = "Bottom" ; Get ( WindowDesktopHeight ) - MoveResizeWindow ( "Height"; pixels; "" ) ; // Places the window at the bottom edge of the screen.

where = "Offset" ; Get ( WindowTop ) + pixels ;// Moves the window up (-) or down (+) the specified number of pixels.

pixels // Unspecified where

) ; // end Top case

function = "Left" ; // In the Move/Resize Window script step.

Case (

where = "Left" ; 0 ; // Places the window at the left edge of the screen.

where = "Center" ; ( Get ( WindowDesktopWidth ) - MoveResizeWindow ( "Width"; pixels; "" ) ) / 2 ; // Places the window in the horizontal center of the screen

where = "Right" ; Get ( WindowDesktopWidth ) - MoveResizeWindow ( "Width"; pixels; "" ) ; // Places the window at the right edge of the screen.

where = "Offset" ; Get ( WindowLeft ) + pixels ; // Moves the window left (+) or right (-) the specified number of pixels.

pixels // Unspecified where

) ; // end Left case

pixels // Unspecified function

) // end outer case

Contact Us | Privacy | Policies

Copyright © 2006 DataIsland Software LLC. All rights reserved.

Notice: Product specifications and availability are subject to change without notice.