[Gambas-user] Fixed a minor mascot issue

Christopher Brian Jack brian at ...1334...
Thu Oct 19 02:08:06 CEST 2006


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


.=================================================.
|  Christopher BRIAN Jack aka "Gau of the Veldt"  |
+================================================='
| oevna at ...1544...
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...
Hi Humans, my email address uses rot13 cipher





More information about the User mailing list