[dasher] DefaultFilter retrieves coordinates even if paused, & passes to CStartHandler



commit 9edde8dd3177925388150f178a892b2e871dd477
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Thu Dec 2 13:35:00 2010 +0000

    DefaultFilter retrieves coordinates even if paused, & passes to CStartHandler
    
    => better mouse-line for StylusFilter
    => simplify StartHandlers, & these now use transformed coordinates
    
    Also rewrite TwoBox + Circle StartHandler state logic, removing LP_MOUSEPOS_BOX.

 Src/DasherCore/CircleStartHandler.cpp |  177 +++++++++++----------------------
 Src/DasherCore/CircleStartHandler.h   |   15 ++-
 Src/DasherCore/DefaultFilter.cpp      |   29 +++---
 Src/DasherCore/DefaultFilter.h        |    1 +
 Src/DasherCore/Parameters.h           |    3 +-
 Src/DasherCore/StartHandler.h         |    2 +-
 Src/DasherCore/TwoBoxStartHandler.cpp |   86 +++++++----------
 Src/DasherCore/TwoBoxStartHandler.h   |   11 ++-
 8 files changed, 127 insertions(+), 197 deletions(-)
---
diff --git a/Src/DasherCore/CircleStartHandler.cpp b/Src/DasherCore/CircleStartHandler.cpp
index c202c70..9cad985 100644
--- a/Src/DasherCore/CircleStartHandler.cpp
+++ b/Src/DasherCore/CircleStartHandler.cpp
@@ -27,137 +27,75 @@
 using namespace Dasher;
 
 CCircleStartHandler::CCircleStartHandler(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore, CDasherInterfaceBase *pInterface) 
-  : CStartHandler(pEventHandler, pSettingsStore, pInterface) {
-  m_iStatus = -1;
-  m_iChangeTime = 0;
-  m_iCircleRadius = GetLongParameter(LP_MAX_Y) * GetLongParameter(LP_CIRCLE_PERCENT) / 100;
-  m_iScreenRadius = 0;
+: CStartHandler(pEventHandler, pSettingsStore, pInterface), m_iEnterTime(std::numeric_limits<long>::max()), m_iScreenRadius(-1) {
 }
 
-bool CCircleStartHandler::DecorateView(CDasherView *pView) {
-  screenint iCX;
-  screenint iCY;
-
-  pView->Dasher2Screen(2048, 2048, iCX, iCY);
-
-  screenint iCX2;
-  screenint iCY2;
- 
-  pView->Dasher2Screen(2048, 2048 + m_iCircleRadius, iCX2, iCY2);
-
+void CCircleStartHandler::ComputeScreenLoc(CDasherView *pView) {
+  if (m_iScreenRadius!=-1) return;
+  pView->Dasher2Screen(GetLongParameter(LP_OX),GetLongParameter(LP_OY),m_screenCircleCenter.x,m_screenCircleCenter.y);
+  //compute radius against orientation. It'd be simpler to use
+  // Math.min(screen width, screen height) * LP_CIRCLE_PERCENT / 100
+  // - should we?
+  screenint iEdgeX, iEdgeY;
+  pView->Dasher2Screen(GetLongParameter(LP_OX), GetLongParameter(LP_OY) + (GetLongParameter(LP_MAX_Y)*GetLongParameter(LP_CIRCLE_PERCENT))/100, iEdgeX, iEdgeY);
+  
   int iDirection = GetLongParameter(LP_REAL_ORIENTATION);
-
+  
   if((iDirection == 2) || (iDirection == 3)) {
-    m_iScreenRadius = iCX2 - iCX;
+    m_iScreenRadius = iEdgeX - m_screenCircleCenter.x;
   }
   else {
-    m_iScreenRadius = iCY2 - iCY;
+    m_iScreenRadius = iEdgeY - m_screenCircleCenter.y;
   }
+}
 
-  if((m_iStatus == 0) || (m_iStatus == 2))
-    pView->Screen()->DrawCircle(iCX, iCY, m_iScreenRadius, 242, 2, 1);
-  else if((m_iStatus == 1) || (m_iStatus == 3))
-    pView->Screen()->DrawCircle(iCX, iCY, m_iScreenRadius, -1, 240, 1);
-  else if(m_iStatus == 5)
-    pView->Screen()->DrawCircle(iCX, iCY, m_iScreenRadius, 241, 2, 1);
-  else
-    pView->Screen()->DrawCircle(iCX, iCY, m_iScreenRadius, -1, 240, 3);
+bool CCircleStartHandler::DecorateView(CDasherView *pView) {
+  ComputeScreenLoc(pView);
+
+  const bool bAboutToChange = m_bInCircle && m_iEnterTime != std::numeric_limits<long>::max();
+  int fillColor, lineColor, lineWidth;
+  if (GetBoolParameter(BP_DASHER_PAUSED)) {
+    lineColor=2; lineWidth=1;
+    fillColor = bAboutToChange ? 241 : 242;
+  } else {
+    lineColor=240; fillColor=-1; //don't fill
+    lineWidth = bAboutToChange ? 3 : 1;
+  }
+  
+  pView->Screen()->DrawCircle(m_screenCircleCenter.x, m_screenCircleCenter.y, m_iScreenRadius, fillColor, lineColor, lineWidth);
 
   return true;
 }
 
-void CCircleStartHandler::Timer(int iTime, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel) {
-  screenint iCX;
-  screenint iCY;
-  pView->Dasher2Screen(2048, 2048, iCX, iCY);
+void CCircleStartHandler::Timer(int iTime, dasherint mouseX, dasherint mouseY,CDasherView *pView) {
+  ComputeScreenLoc(pView);
+  screenint x,y;
+  pView->Dasher2Screen(mouseX, mouseY, x, y);
+  x-=m_screenCircleCenter.x; y-=m_screenCircleCenter.y;
+  const bool inCircleNow = x*x + y*y <= (m_iScreenRadius * m_iScreenRadius);
   
-  screenint iCursorX;
-  screenint iCursorY;
-  pInput->GetScreenCoords(iCursorX, iCursorY, pView);
-
-  double dR;
-
-  dR = sqrt(pow(static_cast<double>(iCX - iCursorX), 2.0) + pow(static_cast<double>(iCY - iCursorY), 2.0));
-
-  int iNewStatus(-1);
-
-  // Status flags:
-  // -1 undefined
-  // 0 = out of circle, stopped
-  // 1 = out of circle, started
-  // 2 = in circle, stopped
-  // 3 = in circle, started
-  // 4 = in circle, stopping
-  // 5 = in circle, starting
-
-  // TODO - need to check that these respond correctly to (eg) external pauses
-
-  if(dR < m_iScreenRadius) {
-    switch(m_iStatus) {
-    case -1:
-      if(m_pInterface->GetBoolParameter(BP_DASHER_PAUSED))
-	iNewStatus = 2;
-      else
-	iNewStatus = 3;
-      break;
-    case 0:
-      iNewStatus = 5;
-      break;
-    case 1:
-      iNewStatus = 4;
-      break;
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-      iNewStatus = m_iStatus;
-      break;
+  if (inCircleNow) {
+    if (m_bInCircle) {
+      //still in circle...check they aren't still in there after prev. activation
+      if (m_iEnterTime != std::numeric_limits<long>::max() && iTime - m_iEnterTime > 1000) {
+        //activate!
+        if (GetBoolParameter(BP_DASHER_PAUSED))
+          m_pInterface->Unpause(iTime);
+        else
+          m_pInterface->Stop();
+        //note our HandleEvent method will then set
+        //   m_iEnterTime = std::numeric_limits<long>::max()
+        // thus preventing us from firing until user leaves circle and enters again
+      }
+    } else {// !m_bInCircle
+      //just entered circle
+      m_bInCircle=true;
+      m_iEnterTime = iTime;
     }
+  } else {
+    //currently outside circle
+    m_bInCircle=false;
   }
-  else {
-    switch(m_iStatus) {
-    case -1:
-      if(m_pInterface->GetBoolParameter(BP_DASHER_PAUSED))
-	iNewStatus = 0;
-      else
-	iNewStatus = 1;
-      break;
-    case 0:
-    case 1:
-      iNewStatus = m_iStatus;
-      break;
-    case 2:
-      iNewStatus = 0;
-      break;
-    case 3:
-      iNewStatus = 1;
-      break;
-    case 4:
-      iNewStatus = 1;
-      break;
-    case 5:
-      iNewStatus = 0;
-      break;
-    }
-  }
-
-  if(iNewStatus != m_iStatus) {
-    m_iChangeTime = iTime;
-  }
-
-  if(iTime - m_iChangeTime > 1000) {
-    if(iNewStatus == 4) {
-      iNewStatus = 2;
-      m_pInterface->Stop();
-    } 
-    else if(iNewStatus == 5) {
-      iNewStatus = 3;
-      m_pInterface->Unpause(iTime);
-    }
-  }
-
-  m_iStatus = iNewStatus;
-
 }
 
 void CCircleStartHandler::HandleEvent(Dasher::CEvent * pEvent) {
@@ -165,8 +103,13 @@ void CCircleStartHandler::HandleEvent(Dasher::CEvent * pEvent) {
     Dasher::CParameterNotificationEvent * pEvt(static_cast < Dasher::CParameterNotificationEvent * >(pEvent));
    
     switch (pEvt->m_iParameter) {
+    case LP_REAL_ORIENTATION:
+    case LP_CIRCLE_PERCENT:
+      //recompute geometry. TODO, need to trap arbitrary screen geom changes too...?
+      m_iScreenRadius = -1;
+      break;
     case BP_DASHER_PAUSED:
-      m_iStatus = -1;
+      m_iEnterTime = std::numeric_limits<long>::max();
       break;
     }
   }
diff --git a/Src/DasherCore/CircleStartHandler.h b/Src/DasherCore/CircleStartHandler.h
index be7e93d..10174ea 100644
--- a/Src/DasherCore/CircleStartHandler.h
+++ b/Src/DasherCore/CircleStartHandler.h
@@ -10,14 +10,19 @@ public:
   CCircleStartHandler(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore, CDasherInterfaceBase *pInterface);
 
   virtual bool DecorateView(CDasherView *pView);
-  virtual void Timer(int iTime, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel);
+  virtual void Timer(int iTime, dasherint iX, dasherint iY, CDasherView *pView);
   virtual void HandleEvent(Dasher::CEvent * pEvent);
 
-private:
-  int m_iStatus;
-  int m_iChangeTime;
-  int m_iCircleRadius;
+protected:
+  ///Time (as unix timestamp) when user entered circle; max() => already acted upon
+  long m_iEnterTime;
+  ///Whether the user was in the circle in last call to Timer
+  bool m_bInCircle;
+  ///Radius of circle in screen coordinates (-1 = needs recomputing)
   int m_iScreenRadius;
+  ///Center of screen circle (needs recomputing if radius does)
+  CDasherScreen::point m_screenCircleCenter;
+  virtual void ComputeScreenLoc(CDasherView *pView);
 };
 }
 /// @}
diff --git a/Src/DasherCore/DefaultFilter.cpp b/Src/DasherCore/DefaultFilter.cpp
index 1a03ab8..87913ed 100644
--- a/Src/DasherCore/DefaultFilter.cpp
+++ b/Src/DasherCore/DefaultFilter.cpp
@@ -40,15 +40,9 @@ CDefaultFilter::~CDefaultFilter() {
 }
 
 bool CDefaultFilter::DecorateView(CDasherView *pView, CDasherInput *pInput) {
-
+  
   bool bDidSomething(false);
 
-  if (GetBoolParameter(BP_DASHER_PAUSED)) {
-    //Timer() is not retrieving input coordinates, so we'd better do so here...
-    if (!pInput->GetDasherCoords(m_iLastX, m_iLastY, pView)) return false;
-    ApplyTransform(m_iLastX, m_iLastY, pView);
-  }
-
   if(GetBoolParameter(BP_DRAW_MOUSE)) {
     //Draw a small box at the current mouse position
     pView->DasherDrawCentredRectangle(m_iLastX, m_iLastY, 5, 2, false);
@@ -97,9 +91,12 @@ bool CDefaultFilter::DecorateView(CDasherView *pView, CDasherInput *pInput) {
   /*  std::cout << "(" << X[0] << "," << Y[0] << ") (" << X[noOfPoints-1] << "," << Y[noOfPoints-1] << ") "
 	    << "(" << CenterXY[0] << "," << CenterXY[1]
 	    << ") angle:" << angle << "," << angle*180.0/3.1415926 << std::endl;*/
+
     bDidSomething = true;
   }
-  
+  //only require another frame if we actually drew a mouse line in a different place to before...
+  bDidSomething = m_bGotMouseCoords & bDidSomething;
+  m_bGotMouseCoords = false;
   if(m_pStartHandler)
     bDidSomething = m_pStartHandler->DecorateView(pView) || bDidSomething;
 
@@ -107,15 +104,15 @@ bool CDefaultFilter::DecorateView(CDasherView *pView, CDasherInput *pInput) {
 }
 
 bool CDefaultFilter::Timer(int Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel, Dasher::VECTOR_SYMBOL_PROB *pAdded, int *pNumDeleted, CExpansionPolicy **pol) {
-  bool bDidSomething = false;
+  if (!(m_bGotMouseCoords = pInput->GetDasherCoords(m_iLastX, m_iLastY, pView))) {
+    m_pInterface->Stop(); //does nothing if already paused
+    return false;
+  };
+  //Got coordinates
+  ApplyTransform(m_iLastX, m_iLastY, pView);
+  bool bDidSomething(false);
   if (!GetBoolParameter(BP_DASHER_PAUSED))
   {
-    if (!(pInput->GetDasherCoords(m_iLastX, m_iLastY, pView))) {
-      m_pInterface->Stop();
-      return false;
-    };
-    ApplyTransform(m_iLastX, m_iLastY, pView);
-
     if(GetBoolParameter(BP_STOP_OUTSIDE)) {
       myint iDasherMinX;
       myint iDasherMinY;
@@ -136,7 +133,7 @@ bool CDefaultFilter::Timer(int Time, CDasherView *pView, CDasherInput *pInput, C
   }
 	
   if(m_pStartHandler)
-    m_pStartHandler->Timer(Time, pView, pInput, m_pDasherModel);
+    m_pStartHandler->Timer(Time, m_iLastX, m_iLastY, pView);
 
   return bDidSomething;
 }
diff --git a/Src/DasherCore/DefaultFilter.h b/Src/DasherCore/DefaultFilter.h
index 38ccf69..5e3eb7e 100644
--- a/Src/DasherCore/DefaultFilter.h
+++ b/Src/DasherCore/DefaultFilter.h
@@ -28,6 +28,7 @@ class CDefaultFilter : public CInputFilter {
 protected:
   /// Last-known Dasher-coords of the target
   myint m_iLastX, m_iLastY;
+  bool m_bGotMouseCoords;
 private:
   CAutoSpeedControl *m_pAutoSpeedControl;
   CStartHandler *m_pStartHandler;
diff --git a/Src/DasherCore/Parameters.h b/Src/DasherCore/Parameters.h
index dfc0ee1..4e5ee35 100644
--- a/Src/DasherCore/Parameters.h
+++ b/Src/DasherCore/Parameters.h
@@ -56,7 +56,7 @@ enum {
   LP_UNIFORM, LP_YSCALE, LP_MOUSEPOSDIST, LP_STOP_IDLETIME,
   LP_LM_MAX_ORDER, LP_LM_EXCLUSION,
   LP_LM_UPDATE_EXCLUSION, LP_LM_ALPHA, LP_LM_BETA,
-  LP_LM_MIXTURE, LP_MOUSE_POS_BOX, LP_NORMALIZATION, LP_LINE_WIDTH, 
+  LP_LM_MIXTURE, LP_NORMALIZATION, LP_LINE_WIDTH, 
   LP_LM_WORD_ALPHA, LP_USER_LOG_LEVEL_MASK, 
   LP_ZOOMSTEPS, LP_B, LP_S, LP_BUTTON_SCAN_TIME, LP_R, LP_RIGHTZOOM,
   LP_NODE_BUDGET, LP_OUTLINE_WIDTH, LP_MIN_NODE_SIZE, LP_NONLINEAR_X,
@@ -206,7 +206,6 @@ static lp_table longparamtable[] = {
   {LP_LM_ALPHA, "LMAlpha", PERS, 49, "LMAlpha"},
   {LP_LM_BETA, "LMBeta", PERS, 77, "LMBeta"},
   {LP_LM_MIXTURE, "LMMixture", PERS, 50, "LMMixture"},
-  {LP_MOUSE_POS_BOX, "MousePosBox", !PERS, -1, "Mouse Position Box Indicator"},
   {LP_NORMALIZATION, "Normalization", !PERS, 1 << 16, "Interval for child nodes"},
   {LP_LINE_WIDTH, "LineWidth", PERS, 1, "Width to draw crosshair and mouse line"},
   {LP_LM_WORD_ALPHA, "WordAlpha", PERS, 50, "Alpha value for word-based model"},
diff --git a/Src/DasherCore/StartHandler.h b/Src/DasherCore/StartHandler.h
index d693c34..e3d7d0e 100644
--- a/Src/DasherCore/StartHandler.h
+++ b/Src/DasherCore/StartHandler.h
@@ -14,7 +14,7 @@ public:
   };
 
   virtual bool DecorateView(CDasherView *pView) = 0;
-  virtual void Timer(int iTime, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel) = 0;
+  virtual void Timer(int iTime, dasherint iX, dasherint iY, CDasherView *pView) = 0;
 
 protected:
   CDasherInterfaceBase *m_pInterface;
diff --git a/Src/DasherCore/TwoBoxStartHandler.cpp b/Src/DasherCore/TwoBoxStartHandler.cpp
index 53b3fce..af83286 100644
--- a/Src/DasherCore/TwoBoxStartHandler.cpp
+++ b/Src/DasherCore/TwoBoxStartHandler.cpp
@@ -4,74 +4,62 @@
 using namespace Dasher;
 
 CTwoBoxStartHandler::CTwoBoxStartHandler(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore, CDasherInterfaceBase *pInterface)
-  : CStartHandler(pEventHandler, pSettingsStore, pInterface) {
-  m_bInBox = false;
+: CStartHandler(pEventHandler, pSettingsStore, pInterface), m_bFirstBox(true), m_iBoxEntered(std::numeric_limits<long>::max()) {
 }
 
 bool CTwoBoxStartHandler::DecorateView(CDasherView *pView) {
+  if (!GetBoolParameter(BP_DASHER_PAUSED)) return false;
+  
   int iHeight = pView->Screen()->GetHeight();
   int iWidth = pView->Screen()->GetWidth();
 
   int iMousePosDist = GetLongParameter(LP_MOUSEPOSDIST);
-  int iDrawMousePosBox = GetLongParameter(LP_MOUSE_POS_BOX);
 
-  switch (iDrawMousePosBox) {
-  case 1:
-    pView->Screen()->DrawRectangle(8, iHeight / 2 - iMousePosDist + 50, iWidth-16, iHeight / 2 - iMousePosDist - 50, -1, 119, 4);
-    return true;
-    break;
-  case 2:
-    pView->Screen()->DrawRectangle(8, iHeight / 2 + iMousePosDist + 50, iWidth-16, iHeight / 2 + iMousePosDist - 50, -1, 120, 4);
-    return true;
-    break;
-  default:
-    return false;
-    break;
+  int lineWidth = m_iBoxEntered == std::numeric_limits<long>::max() ? 2 : 4; //out/in box
+
+  if (m_bFirstBox) {
+    pView->Screen()->DrawRectangle(8, iHeight / 2 - iMousePosDist + 50, iWidth-16, iHeight / 2 - iMousePosDist - 50, -1, 119, lineWidth);
+  } else {
+    pView->Screen()->DrawRectangle(8, iHeight / 2 + iMousePosDist + 50, iWidth-16, iHeight / 2 + iMousePosDist - 50, -1, 120, lineWidth);
   }
+  return true;
 }
 
-void CTwoBoxStartHandler::Timer(int iTime, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel) { 
-  screenint iNewScreenX;
-  screenint iNewScreenY;
-  pInput->GetScreenCoords(iNewScreenX, iNewScreenY, pView);
-
-  int iBoxMax(-1);
-  int iBoxMin(0);
-
-  if(GetLongParameter(LP_MOUSE_POS_BOX) == 1) {
+void CTwoBoxStartHandler::Timer(int iTime, dasherint iDasherX, dasherint iDasherY, CDasherView *pView) { 
+  if (!GetBoolParameter(BP_DASHER_PAUSED)) return;
+  
+  int iBoxMin, iBoxMax;
+  if(m_bFirstBox) {
     iBoxMax = pView->Screen()->GetHeight() / 2 - (int)GetLongParameter(LP_MOUSEPOSDIST) + 50;
     iBoxMin = iBoxMax - 100;
   }
-  else if(GetLongParameter(LP_MOUSE_POS_BOX) == 2) {
+  else {
     iBoxMin = pView->Screen()->GetHeight() / 2 + (int)GetLongParameter(LP_MOUSEPOSDIST) - 50;
     iBoxMax = iBoxMin + 100;
   }
 
+  screenint iNewScreenX, iNewScreenY;
+  pView->Dasher2Screen(iDasherX, iDasherY, iNewScreenX, iNewScreenY);
+
   if((iNewScreenY >= iBoxMin) && (iNewScreenY <= iBoxMax)) {
-    if(!m_bInBox) {
+    if(m_iBoxEntered == std::numeric_limits<long>::max()) {
       m_iBoxEntered = iTime;
     }
-    else {
-      if(iTime - m_iBoxEntered > 2000) {
-
-        m_iBoxStart = iTime;
+    else if (iTime - m_iBoxEntered > 2000) {
+      m_iBoxStart = iTime;
 
-        if(GetLongParameter(LP_MOUSE_POS_BOX) == 1)
-          SetLongParameter(LP_MOUSE_POS_BOX, 2);
-        else if(GetLongParameter(LP_MOUSE_POS_BOX) == 2) {
-          SetLongParameter(LP_MOUSE_POS_BOX, -1);
-	  m_pInterface->Unpause(iTime);
-        }
-      }
+      if(m_bFirstBox)
+        m_bFirstBox=false;
+      else
+        m_pInterface->Unpause(iTime);
+      m_iBoxEntered = std::numeric_limits<long>::max();
     }
-
-    m_bInBox = true;
-  }
-  else {
-    if((GetLongParameter(LP_MOUSE_POS_BOX) == 2) && (iTime - m_iBoxStart > 2000))
-      SetLongParameter(LP_MOUSE_POS_BOX, 1);
+  } else {
+    //not in box
+    if(!m_bFirstBox && (iTime - m_iBoxStart > 2000))
+      m_bFirstBox=true;
     
-    m_bInBox = false;
+    m_iBoxEntered = std::numeric_limits<long>::max();
   }
 }
 
@@ -79,13 +67,7 @@ void CTwoBoxStartHandler::HandleEvent(Dasher::CEvent * pEvent) {
     if(pEvent->m_iEventType == 1) {
     Dasher::CParameterNotificationEvent * pEvt(static_cast < Dasher::CParameterNotificationEvent * >(pEvent));
    
-    switch (pEvt->m_iParameter) {
-    case BP_DASHER_PAUSED:
-      if(GetBoolParameter(BP_DASHER_PAUSED))
-	SetLongParameter(LP_MOUSE_POS_BOX, 1);
-      else
-	SetLongParameter(LP_MOUSE_POS_BOX, -1);
-      break;
-    }
+    if (pEvt->m_iParameter==BP_DASHER_PAUSED)
+      m_bFirstBox = true;
   }
 }
diff --git a/Src/DasherCore/TwoBoxStartHandler.h b/Src/DasherCore/TwoBoxStartHandler.h
index 7d8f6ef..34c483a 100644
--- a/Src/DasherCore/TwoBoxStartHandler.h
+++ b/Src/DasherCore/TwoBoxStartHandler.h
@@ -11,13 +11,16 @@ public:
   CTwoBoxStartHandler(Dasher::CEventHandler * pEventHandler, CSettingsStore * pSettingsStore, CDasherInterfaceBase *pInterface);
 
   virtual bool DecorateView(CDasherView *pView);
-  virtual void Timer(int iTime, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel);
+  virtual void Timer(int iTime, dasherint iX, dasherint iY, CDasherView *pView);
   virtual void HandleEvent(Dasher::CEvent * pEvent);
 
  private:
-  int m_iBoxEntered;
-  int m_iBoxStart;
-  bool m_bInBox;
+  ///Box currently being displayed, _iff_ BP_DASHER_PAUSED is set
+  bool m_bFirstBox;
+  ///Time at which mouse entered whichever box is current, or numeric_limits::max() if it hasn't
+  long m_iBoxEntered;
+  ///Time at which second box was first displayed
+  long m_iBoxStart;
 };
 }
 /// @}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]