property pHelpOn,pHelpText,pWidth,pHeigth,pSprite,pCursor

on new me
  set pHelpOn = FALSE
  set pHelpText = ""
  set pWidth = 0
  set pHeigth = 0
  set pSprite = 0
  set pCursor = []
  puppetSprite 30,TRUE
  set the visible of sprite 30 to FALSE
  
  return me
end new


on mKillHelp me
  mCloseHelp(me)
  set pHelpOn = FALSE
end mKillHelp


on mOpenHelp me,helpText,wichOne,wichCur
  if pHelpOn then
    set pSprite   = wichOne
    set pHelpText = helpText
    set pCursor   = wichCur
    set the text of field "helptxt" to pHelpText
    set pWidth    = the width of member "helptxt"
    set pHeigth   = the height of member "helptxt"
    
    set the visible of sprite 30 to TRUE
  end if
end mOpenHelp


on mCloseHelp me
  if pHelpOn then
    set the visible of sprite 30 to FALSE
    if count(pCursor) > 0 then
      set the cursor of sprite pSprite to pCursor
    else
      cursor -1
    end if
  end if
end mCloseHelp


on mShowHelp me
  if pHelpOn then
    if count(pCursor) > 0 then
      set the cursor of sprite pSprite to 200
    else
      cursor 200  
    end if
    set the locH of sprite 30 to the mouseH - (pWidth/2)
    set the locV of sprite 30 to the mouseV - (pHeigth/2)
  end if
end mShowHelp


on mToggleHelp me
  mCloseHelp(me)
  if pHelpOn then
    set pHelpOn = FALSE
  else
    set pHelpOn = TRUE
  end if
end mToggleHelp
