Code archives/BlitzPlus Gui/Set Client Width\Height

This code has been declared by its author to be Public Domain code.

Download source code

Set Client Width\Height by Blaine2005
Two new functions, SetClientWidth() and SetClientHeight(), for Blitz+. Parameters are the window to modify, followed by the new width/height. Use to modify the client area of a window without using the 'client coordinates' flag. Note that the following limitations apply:
>These functions cannot make the window any smaller than the system allows.
>Since the functions base the new dimesions for the window off of the window's old dimensions, the old client area must be at least 1x1 or it will not work.
Function SetClientWidth(win,width)
	SetGadgetShape win,GadgetX(win),GadgetY(win),GadgetWidth(win)+(width-ClientWidth(win)),GadgetHeight(win)
End Function

Function SetClientHeight(win,height)
	SetGadgetShape win,GadgetX(win),GadgetY(win),GadgetWidth(win),GadgetHeight(win)+(height-ClientHeight(win))
End Function

Comments

TAS2008
I would only use SetGadgetshape before adding any child objects or after using SetGadgetlayout to lock down every child object edge or you are probably not going to like the results.


Code Archives Forum