REM    _____________________________________________________
REM   |\___________________________________________________/| 
REM   | |                                                 | |
REM   | | SOURCE TITLE:    Garrett's HotSpot Example      | |
REM   | | ------------                                    | |
REM   | | SOURCE AUTHOR:   Original source by Tommy Sools | |
REM   | | -------------    Modified by Garrett R. Hylltun | |
REM   | |                                                 | |
REM   | | DATE:            5 April, 2000                  | |
REM   | | ----                                            | |
REM   | | REQUIREMENTS:    VDS 3.x; VDSDLL 2.x            | |
REM   | | ------------                                    | |
REM   | | SOURCE STATUS:   Public Domain                  | |
REM   | | -------------                                   | |
REM   | | SOURCE DESCRIPTION:                             | |
REM   | | ------------------                              | |
REM   | |   This example shows you how to use the VDSDLL  | |
REM   | | to make a clickable hotspot.                    | |
REM   | |_________________________________________________| |
REM   |/___________________________________________________\|

  External vdsdll.dll,Public Freeware Key|90257236
  DIALOG CREATE,GT HotSpot Example,-1,0,200,100
  DIALOG ADD,STYLE,STYLE6,Courier New,8,,,
  DIALOG ADD,STYLE,STYLE5,Wingdings,24,,BACKGROUND,FOREGROUND
  DIALOG ADD,TEXT,TEXT6,26,86,27,36,O,STYLE5
  DIALOG ADD,STATUS,STATUS1
  DIALOG SHOW
  Dialog Set,TEXT6,@chr(56)
  REM   --- |-------------------------------------------------| ---
  REM   --- | You need set a sleeptime for this to work.      | ---
  REM   --- |-------------------------------------------------| ---
  Option Sleeptime,100
:EVLOOP
  wait event,0
  %E = @event()
  If %E
    Goto %E
  End
  Goto Evloop
:TIMER
  REM   --- |-------------------------------------------------| ---
  REM   --- | %D = Left X coordinate of Area or Element.      | ---
  REM   --- | %E = Left X + Width of Area or Element.         | ---
  REM   --- | %F = Top Y coordinate of Area or Element.       | ---
  REM   --- | %G = Top Y + Height of Area or Element.         | ---
  REM   --- |-------------------------------------------------| ---
  gosub COORDINATESWINDOW
  REM   --- |-------------------------------------------------| ---
  REM   --- | Element or Area Coordinates = 26,86,27,36       | ---
  REM   --- | Here, hard code the area you want to track.     | ---
  REM   --- |-------------------------------------------------| ---
  %D = @sum(%B,86)
  %E = @sum(%B,113)
  REM   --- |-------------------------------------------------| ---
  REM   --- | If using a normal Title bar, add 20 to the Top  | ---
  REM   --- | Coordinate.                                     | ---
  REM   --- |-------------------------------------------------| ---
  %F = @sum(%C,46)
  %G = @sum(%C,82)
  REM   --- |-------------------------------------------------| ---
  REM   --- | If the mouse is in our area, then check for     | ---
  REM   --- | mouse click.                                    | ---
  REM   --- |-------------------------------------------------| ---
  if @not(@greater(%D,%I)@greater(%I,%E)@greater(%F,%J)@greater(%J,%G))
    Dialog set,STATUS1,Mouse is over hotspot now.
    if @dll(keyboard,Lbutton)
      REM   --- |-------------------------------------------------| ---
      REM   --- | Mouse is pressed down                           | ---
      REM   --- |-------------------------------------------------| ---
      Repeat
      until @not(@dll(keyboard,Lbutton))
      REM   --- |-------------------------------------------------| ---
      REM   --- | When the mouse is released, then do what you    | ---
      REM   --- | want.  Unless you are using this as part of     | ---
      REM   --- | Window or Element move.. then you'd want to put | ---
      REM   --- | your code inside the repeat loop.               | ---
      REM   --- |-------------------------------------------------| ---
      Goto YourEvent
    End
  Else
    Dialog set,STATUS1,
  End
  goto evloop
:COORDINATESWINDOW
  %A = @winpos(GT HotSpot Example,LT)
  parse "%B;%C",%A
  %H = @mousepos()
  parse "%I;%J",%H
  Exit
:YourEvent
  Info You clicked the Hot Spot.
  goto evloop
:CLOSE
  Exit
