1

Topic: How to install the minimum size of a window?

How to set for a window with the changeable sizes the minimum size?
I know, what at usage PFC it is possible to set this parameter but how to be without it? From resize () to cause resize () I not so would like and how to cancel event to me it is not known sad...

2

Re: How to install the minimum size of a window?

It is possible, of course, directly in resize () to write something like
IF newwidth <MIN_WIDTH THEN newwidth = MIN_WIDTH
But what to do, if the user continues to drag a mouse? To make for 1-2 seconds the size of a window invariable? Too  somehow...

3

Re: How to install the minimum size of a window?

You correctly thought.
For example, as that so:

/* event resize windows */
if this. WindowState = Minimized! then
return
else
this. SetRedraw (false)
//restriction...
if this.height <= gi_minheightsheet then this.height = gi_minheightsheet
if this.width <= gi_minwidthsheet then this.width = gi_minwidthsheet
//a call  Resize window elements
of_ResizeControl ()
this. SetRedraw (True)
end if

4

Re: How to install the minimum size of a window?

Apprehension;
Good afternoon.
It is possible to use WinAPI
subroutine GetMinMaxInfo (ref str_minmaxinfo d, long s, long l) library ' kernel32.dll ' alias for "RtlMoveMemory; Ansi"
subroutine SetMinMaxInfo (long d, str_minmaxinfo s, long l) library ' kernel32.dll ' alias for "RtlMoveMemory; Ansi"
--
global type str_minmaxinfo from structure
str_point ptreserved
str_point ptmaxsize
str_point ptmaxposition
str_point ptmintracksize
str_point ptmaxtracksize
end type
--
event ue_getminmaxinfo pbm_getminmaxinfo
event ue_getminmaxinfo; str_MinMaxInfo lstr_MinMaxInfo
/* copy the data, pointed by the argument MinMaxInfo, to our lstr_MinMaxInfo structure */
GetMinMaxInfo (lstr_MinMaxInfo, MinMaxInfo, 40)
/* set the minimal size for our window */
lstr_MinMaxInfo.ptMinTrackSize.lx = 730
lstr_MinMaxInfo.ptMinTrackSize.ly = 250
/* copy the structure back into memory at the same place */
SetMinMaxInfo (MinMaxInfo, lstr_MinMaxInfo, 40)
/* important, according to the MS API, we must return 0 */
return 0
end event

5

Re: How to install the minimum size of a window?

umalov;
global type str_point from structure
long lx
long ly
end type

6

Re: How to install the minimum size of a window?

umalov, AIS I Thank!
Should tell that through system it turned out better: even at usage SetRedraw () in a case holding of a mouse the window all the same could twitch, as if in an easy epilepsy, and after system determinations stood as a rock under a wind.
The only thing: was really mandatory to use GetMinMaxInfo? I understood so that this function writes and reads from structure the pointer on which is transferred as  in event. But unless it is impossible as  to manage coercion of types? Really in PowerScript there is no such mechanism?