X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/d722c4ce7801988cec69aad84a3fe1386d80cd97..48f8a3d60d58245978cb4bef48f0af093776015b:/winsrc/gui.cpp diff --git a/winsrc/gui.cpp b/winsrc/gui.cpp index cc8e17f9..da83c865 100644 --- a/winsrc/gui.cpp +++ b/winsrc/gui.cpp @@ -33,7 +33,6 @@ void dbp(char *str, ...) int GraphBuffer[MAX_GRAPH_TRACE_LEN]; int GraphTraceLen; -int offline; // Whether the GUI operates in Offline mode. HPEN GreyPen, GreenPen, WhitePen, YellowPen; HBRUSH GreenBrush, YellowBrush; @@ -248,10 +247,12 @@ static void PaintGraph(HDC hdc) yMean /= n; } - char str[100]; - sprintf(str, "@%d max=%d min=%d mean=%d n=%d/%d dt=%d [%.3f] zoom=%.3f", + char str[200]; + + sprintf(str, "@%d max=%d min=%d mean=%d n=%d/%d dt=%d [%.3f] zoom=%.3f CursorA=%d [%d] CursorB=%d [%d]", GraphStart, yMax, yMin, yMean, n, GraphTraceLen, - CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor, GraphPixelsPerPoint); + CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor, GraphPixelsPerPoint, + CursorAPos, GraphBuffer[CursorAPos], CursorBPos, GraphBuffer[CursorBPos]); TextOut(hdc, 50, r.bottom - 20, str, strlen(str)); } @@ -322,6 +323,7 @@ nopaint: x -= offset; x = (int)(x / GraphPixelsPerPoint); x += GraphStart; + if(msg == WM_LBUTTONDOWN) { CursorAPos = x; } else { @@ -384,7 +386,7 @@ static void SetCommandEditTo(char *str) SendMessage(CommandEdit, EM_SETSEL, strlen(str), strlen(str)); } -void ShowGui(void) +void ShowGui() { WNDCLASSEX wc; memset(&wc, 0, sizeof(wc)); @@ -505,9 +507,11 @@ void ShowGui(void) } } - UsbCommand c; - if(ReceiveCommandPoll(&c)) { - UsbCommandReceived(&c); + if (!offline) + { + UsbCommand c; + if(ReceiveCommandPoll(&c)) + UsbCommandReceived(&c); } Sleep(10);