I modified the userParentResize event handler of the message window.
I inteded to retain the position and the height/width ratio of it.
The following screenshot is showing that
1. the procedure has been executed twice for one resizing and
2. I have seen strange double frames.
The code is here:
Code: Select all
onUserParentResize(_Source, _Width, _Height) :-
% 2013.09.08. Retain position and shape,
PrevClientWidth=taskWindow::prevClientWidth,
PrevClientWidth>0,
PrevClientHeight=taskWindow::prevClientHeight,
PrevClientHeight>0,
A=getParent(),
A:getClientSize(CurrentClientWidth,CurrentClientHeight),
Plain=getVpiWindow(),
rct(OL,OT,OR,OB)=winGetOuterRect(Plain),
% stdio::writef("%\n % %\n",winGetText(Plain),"old outer", rct(OL,OT,OR,OB)),
HasMenu = b_false,
WsFlags = winGetState(Plain),
rct(CL,CT,CR,CB)= rectGetClient(WsFlags, HasMenu, rct(OL,OT,OR,OB)),
% stdio::writef("% %\n","old client", rct(CL,CT,CR,CB)),
WidthRatio=(CurrentClientWidth+0.0)/PrevClientWidth,
HeightRatio=(CurrentClientHeight+0.0)/PrevClientHeight,
% stdio::writef("%-12.12s = %9.2g\n","Width Ratio",WidthRatio),
% stdio::writef("%-12.12s = %9.2g\n","Height Ratio",HeightRatio),
NL=math::round(CL*WidthRatio),
NR=math::round(CR*WidthRatio),
NT=math::round(CT*HeightRatio),
NB=math::round(CB*HeightRatio),
stdio::writef("% %\n","new client",rct(NL,NT,NR,NB)),
winMove(Plain,rct(NL,NT,NR,NB)),
stdio::writef("% %\n","new outer", winGetOuterRect(Plain)),
!.