November 25, 2020, 05:08:04 AM

Author Topic: [bb] Set Client WidthHeight by Blaine [ 1+ years ago ]  (Read 547 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Set Client WidthHeight by Blaine [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
Title : Set Client WidthHeight
Author : Blaine
Posted : 1+ years ago

Description : 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.


Code :
Code: BlitzBasic
  1. Function SetClientWidth(win,width)
  2.         SetGadgetShape win,GadgetX(win),GadgetY(win),GadgetWidth(win)+(width-ClientWidth(win)),GadgetHeight(win)
  3. End Function
  4.  
  5. Function SetClientHeight(win,height)
  6.         SetGadgetShape win,GadgetX(win),GadgetY(win),GadgetWidth(win),GadgetHeight(win)+(height-ClientHeight(win))
  7. End Function


Comments :


TAS(Posted 1+ years ago)

 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.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal