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

WindowLimits

Set the minimum and maximum limits of a window.

Declaration

Source position: intuition.pas line 4188

function WindowLimits(

  window: pWindow;

  widthMin: LongInt;

  heightMin: LongInt;

  widthMax: LongWord;

  heightMax: LongWord

):LongBool;

Arguments

window

  

A pointer to a Window structure

widthMin

  

The new limits for the size of this window. If any of these is set to zero, it will be ignored and that setting will be unchanged.

Function result

Returns True if everything was in order. If any of the parameters was out of range (minimums greater than current size, maximums less than current size), False is returned and the errant limit request is not fulfilled (though the valid ones will be).

Description

Sets the minimum and maximum limits of the window's size. Until this routine is called, the window's size limits are equal to the initial values established in the OpenWindow() function.

After a call to this routine, the Window will be able to be sized to any dimensions within the specified limits.

If you don't want to change any one of the dimensions, set the limit argument for that dimension to zero. If any of the limit arguments is equal to zero, that argument is ignored and the initial setting of that parameter remains undisturbed.

If any of the arguments is out of range (minimums greater than the current size, maximums less than the current size), that limit will be ignored, though the others will still take effect if they are in range. If any are out of range, the return value from this procedure will be False. If all arguments are valid, the return value will be True.

If you want your window to be able to become "as large as possible" you may put -1 (i.e. not 0) in either or both Max arguments. But please note: screen sizes may vary for several reasons, and you must be able to handle any possible size of window you might end up with if you use this method. Note that you can use the function LockPubScreen() to find out how big the screen your window will appear in is. You may also refer to the WScreen field in your window structure, providing that your window remains open, which will ensure that the screen remains open, and thus the pointer remains valid.

If the user is currently sizing this window, the new limits will not take effect until after the sizing is completed.

See also

LockPubScreen

  

Prevent a public screen from closing.


Documentation generated on: 2021-07-30