Unit 'intuition' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#amunits]

ScreenPosition

Move screens with greater control.

Declaration

Source position: intuition.pas line 4161

procedure ScreenPosition(

  screen: pScreen;

  flags: LongWord;

  x1: LongInt;

  y1: LongInt;

  x2: LongInt;

  y2: LongInt

);

Arguments

screen

  

A pointer to a Screen structure

flags

  

Set to one of SPOS_RELATIVE, SPOS_ABSOLUTE, or SPOS_MAKEVISIBLE. You may additionally set SPOS_FORCEDRAG if you need. Use SPOS_RELATIVE (zero) for normal use (move screen a relative amount expressed by x1,y1). Set the SPOS_ABSOLUTE flag if you wish x1 and y1 to be absolute coordinates to move the screen to. Set SPOS_MAKEVISIBLE to position an oversized scrolling screen so that the rectangle described by (x1,y1)-(x2,y2) is on the visible part of the display. (A word-processor may wish to support autoscrolling as the user types. In that case, it could call ScreenPosition() with the SPOS_MAKEVISIBLE flag and a rectangle that encompasses the cursor with some space around it. In addition to any one of the above choices, you can additionally set SPOS_FORCEDRAG if you wish to reposition a screen that was opened with the [SA_Draggable, False] attribute.

x1

  

Absolute position or change in position you wish to apply to the screen, when using SPOS_ABSOLUTE or SPOS_RELATIVE.

y1

  

When using SPOS_MAKEVISIBLE, these variables describe the upper-left corner of the rectangle you would like to ensure is on the visible part of a scrolling screen.

x2

  

Ignored when using SPOS_ABSOLUTE or SPOS_RELATIVE. When using SPOS_MAKEVISIBLE, these variables describe the lower-right corner of the rectangle you would like to ensure is on the visible part of a scrolling screen.

y2

  

Note that these coordinates are in the same resolution as the screen.

Description

Moves the screen to the specified position or by the specified increment, in screen pixel resolution coordinates.

If the x1 and y1 variables you specify would move the screen in a way that violates any restrictions, the screen will be moved as far as possible. You may examine the LeftEdge and TopEdge fields of the Screen structure after this function returns to see where the screen really ended up.

Note that negative values for screen LeftEdge and TopEdge are valid for screens bigger than their display clip.

See also

MoveScreen

  

Attempt to move the screen by the increments provided.

RethinkDisplay

  

Grand manipulation of the entire Intuition display.


Documentation generated on: 2021-07-30