[Gambas-user] Fixed a minor mascot issue

Benoit Minisini gambas at ...1...
Thu Oct 19 19:30:14 CEST 2006


On Thursday 19 October 2006 02:08, Christopher Brian Jack wrote:
> This slightly modified _init in the IDE code shirnks the form (with a
> slight constant of kludgery) to the size of the largest animation image.
> On my Debian system the space is noticeable as the form won't allow itself
> to be dragged past the screen edge.  Without the resize the mascot is a
> good inch or so from the right edge of the screen at maximum right-drag
> and ends up way over left of the scrollbar in the code window.  Shrinking
> the from to the image size allows dragging much closer to the lower right
> screen corner and getting him out of the code window.
>
> STATIC PUBLIC SUB _init()
>
>   DIM iInd AS Integer
>   DIM maxW AS Integer
>   DIM maxH AS Integer
>
>   $cAnim["Blink"] = "1,0,1,0"
>   $cAnim["Blink2"] = "3,4,3,0"
>   $cAnim["Depressive"] = "2,6,7,-8,6,2,0,-8"
>   $cAnim["Happy"] = "5,0,5,0"
>
>   'Shrinks the form to match
>   'the largest animation image
>   maxW = 0
>   maxH = 0
>   FOR iInd = 0 TO 7
>     $hPict[iInd] = Picture["img/anim/gambas" & CStr(iInd + 1) & ".png"]
>     maxH = Max(maxH, $hPict[iInd].Height)
>     maxW = Max(maxW, $hPict[iInd].Width)
>   NEXT
>   'The +11,+3 is a kludge to even the padding
>   'of the Form versus the background image,
>   'tested by dragging to the four corners of
>   'the screen and adjusting the numbers to
>   'even the spacing to the edges on all
>   'screen corners.
>   ME.Resize(maxW + 11, maxH + 3)
>
> END
>
>

Thanks. But I don't understand the need of adding 11 and 3. Hardcoded values 
like this are rarely a good idea...

-- 
Benoit Minisini





More information about the User mailing list