|
|
|
|
@ -81,10 +81,10 @@ void DrawGraph(HDC hdc, RECT* rc, struct etcpmon_app* app)
|
|
|
|
|
int sc = 0; |
|
|
|
|
GetSelectedChannels(app, sel, &sc); |
|
|
|
|
int pad = 5; |
|
|
|
|
int gl = pad + 45; /* левая граница графика */ |
|
|
|
|
int gl = pad + 5; /* левая граница графика */ |
|
|
|
|
int gr = w - pad; /* правая граница */ |
|
|
|
|
int gt = pad; /* верх */ |
|
|
|
|
int gb = h - 25; /* низ */ |
|
|
|
|
int gb = h - 5; /* низ */ |
|
|
|
|
int gh = gb - gt; |
|
|
|
|
/* === Сетка === */ |
|
|
|
|
HPEN grid = CreatePen(PS_DOT, 1, GetSysColor(COLOR_BTNSHADOW)); |
|
|
|
|
@ -141,6 +141,12 @@ void DrawGraph(HDC hdc, RECT* rc, struct etcpmon_app* app)
|
|
|
|
|
LineTo(memDC, app->graph_cursor_x, gb); |
|
|
|
|
SelectObject(memDC, old); |
|
|
|
|
DeleteObject(cp); |
|
|
|
|
|
|
|
|
|
int cursor_rel_x = app->graph_cursor_x - startx; |
|
|
|
|
if (cursor_rel_x >= 0 && cursor_rel_x < vis) { |
|
|
|
|
int cursor_idx = (oldest + cursor_rel_x) % GRAPH_HISTORY_SIZE; |
|
|
|
|
UpdateChannelValues(app, cursor_idx); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
end: |
|
|
|
|
/* Копируем на экран */ |
|
|
|
|
@ -225,6 +231,9 @@ LRESULT CALLBACK GraphWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
|
|
|
|
InvalidateRect(hWnd, NULL, FALSE); |
|
|
|
|
last_invalidate = now; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TRACKMOUSEEVENT tme = { sizeof(tme), TME_LEAVE, hWnd, 0 }; |
|
|
|
|
TrackMouseEvent(&tme); |
|
|
|
|
} else { |
|
|
|
|
app->graph_cursor_active = 0; |
|
|
|
|
InvalidateRect(hWnd, NULL, FALSE); |
|
|
|
|
|