I have an ancestor window with a general move and resize everything event in it that happily moves all controls as you resize the window that inherits it.
The inheritor runs super::resize(...) to actually run the move/grow.
When I try an implement a min/max size on the window it does not work.
In the resize event there is a set instance variable ii_base_minheight and it is set by an accessor function in the inherited window to (this.height)
and another that is set on open ii_win_original_height = this.height
so that the window should be able to grow but not shrink from original size
in the resize event a decimal is generated
ld_vconv = newheight / il_win_original_height
This factor is used to resize and move all controls, and it works.
so for all controls, using the decimal
ld_work = control.y * ld_vconv
control.y = ld_work
etc.
However, when I do this in resize
if (ii_base_minheight <> 0) and ( newheight < ii_base_minheight) then
newheight = ii_base_minheight
end if
ld_work = this.height * ld_vconv
this.height = ld_work
I can see the variables being set but the window height is still reduced to below the minimum. `
Can this be done?
Is there a better way to enforce min and max on resize in the ancestor?
Currently each window (not using the ancestor) implements its own code in the resize event
if this.height < n then
this.height = n
end if
Any help gratefully received.
Kevin.