Skip to content

Commit

Permalink
[#57] Support for KryoFlux and associated images (Part 14: Scrolling …
Browse files Browse the repository at this point in the history
…the TrackEditor content by dragging)
  • Loading branch information
tomas-nestorovic committed Nov 15, 2020
1 parent c634035 commit 089c603
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Main/src/Image_TrackEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
CImage::CTrackReader tr;
TLogTime scrollTime;
PCLogTime iwEndTimes; // inspection window end Times (aka. at which Time they end; the end determines the beginning of the immediately next inspection window)
TLogTime draggedTime; // Time at which left mouse button has been pressed

void OnUpdate(CView *pSender,LPARAM lHint,CObject *pHint) override{
// request to refresh the display of content
Expand All @@ -30,6 +31,26 @@
case WM_MOUSEACTIVATE:
// preventing the focus from being stolen by the parent
return MA_ACTIVATE;
case WM_LBUTTONDOWN:
// left mouse button pressed
SetFocus();
draggedTime=scrollTime+timeline.GetTime( GET_X_LPARAM(lParam)/Utils::LogicalUnitScaleFactor );
break;
case WM_LBUTTONUP:
// left mouse button released
draggedTime=-1;
break;
case WM_MOUSEMOVE:
// mouse moved
if (draggedTime>0) // left mouse button pressed
SetScrollTime(
scrollTime
+
draggedTime
-
( scrollTime+timeline.GetTime( GET_X_LPARAM(lParam)/Utils::LogicalUnitScaleFactor ) )
);
break;
}
return __super::WindowProc( msg, wParam, lParam );
}
Expand Down Expand Up @@ -130,6 +151,7 @@
: penIndex( 2, 0xff0000 )
, timeline( tr.GetTotalTime(), 1, 10 )
, tr(tr)
, draggedTime(-1)
, scrollTime(0) , iwEndTimes(nullptr) {
}

Expand Down

0 comments on commit 089c603

Please sign in to comment.