// MODS
// Had to add another version of MoveCursor that issues mouse move messages so the drag and drop class can move stuff
// under auto cursor control.  Wrote a separate function to avoid others having problems with param changes.  Overloaded
// fn but need to make into a single function for next year.  Take out the mouse down faciliy as this is now provided by the
// button member.  Update help file


#ifndef AutoCursorH
#define AutoCursorH

#include <vcl.h>
#include "HSClass.h"

#define LEFT_DOUBLE_CLICK   WM_LBUTTONDBLCLK
#define LEFT_DOWN           WM_LBUTTONDOWN
#define LEFT_UP             WM_LBUTTONUP
#define MIDDLE_DOUBLE_CLICK WM_MBUTTONDBLCLK
#define MIDDLE_DOWN         WM_MBUTTONDOWN
#define MIDDLE_UP           WM_MBUTTONUP
#define RIGHT_DOUBLE_CLICK  WM_RBUTTONDBLCLK
#define RIGHT_DOWN          WM_RBUTTONDOWN
#define RIGHT_UP            WM_RBUTTONUP

enum {LEFT_CLICK, MIDDLE_CLICK, RIGHT_CLICK };

class TAutoCursor
{
  TForm *mpParent;
  int    mRepeatRate;       // Used when moving cursor with keys to speed it up with time
  bool   mPostingMessages;  // For quickness may not want to process all mouse move messages 

  public:
  TAutoCursor(TForm *Parent);
  void MoveCursor(int SourceX, int SourceY,int DestX, int DestY, bool MouseDown=false, int Speed=30, int Res=50);
  void MoveCursor(WORD Key, int Speed=0);
  void GotoXY(int X, int Y);
  void GotoXY(TPoint Pos);
  void GetCursorPos(int *X, int *Y);
  TPoint GetCursorPos();
  void ResetAcceleration() {mRepeatRate=0;}
  void ProcessMessages( bool PostState=false ) { mPostingMessages=PostState; }
  void Button(TPoint Pos, int Action, HWND TargetHandle=NULL);
  void Button(int X, int Y, int Action, HWND TargetHandle=NULL);
};

#endif
