6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 LONG OldGraphCtrlWndProc
;
27 static void GraphCtrl_Init(TGraphCtrl
* this)
32 this->m_hParentWnd
= 0;
35 this->m_bitmapOldGrid
= 0;
36 this->m_bitmapOldPlot
= 0;
37 this->m_bitmapGrid
= 0;
38 this->m_bitmapPlot
= 0;
39 this->m_brushBack
= 0;
41 this->m_penPlot
[0] = 0;
42 this->m_penPlot
[1] = 0;
43 this->m_penPlot
[2] = 0;
44 this->m_penPlot
[3] = 0;
46 /* since plotting is based on a LineTo for each new point
47 * we need a starting point (i.e. a "previous" point)
48 * use 0.0 as the default first point.
49 * these are public member variables, and can be changed outside
50 * (after construction). Therefore m_perviousPosition could be set to
51 * a more appropriate value prior to the first call to SetPosition.
53 this->m_dPreviousPosition
[0] = 0.0;
54 this->m_dPreviousPosition
[1] = 0.0;
55 this->m_dPreviousPosition
[2] = 0.0;
56 this->m_dPreviousPosition
[3] = 0.0;
58 /* public variable for the number of decimal places on the y axis */
59 this->m_nYDecimals
= 3;
61 /* set some initial values for the scaling until "SetRange" is called.
62 * these are protected varaibles and must be set with SetRange
63 * in order to ensure that m_dRange is updated accordingly
65 /* m_dLowerLimit = -10.0; */
66 /* m_dUpperLimit = 10.0; */
67 this->m_dLowerLimit
= 0.0;
68 this->m_dUpperLimit
= 100.0;
69 this->m_dRange
= this->m_dUpperLimit
- this->m_dLowerLimit
; /* protected member variable */
71 /* m_nShiftPixels determines how much the plot shifts (in terms of pixels) */
72 /* with the addition of a new data point */
73 this->m_nShiftPixels
= 4;
74 this->m_nHalfShiftPixels
= this->m_nShiftPixels
/2; /* protected */
75 this->m_nPlotShiftPixels
= this->m_nShiftPixels
+ this->m_nHalfShiftPixels
; /* protected */
77 /* background, grid and data colors */
78 /* these are public variables and can be set directly */
79 this->m_crBackColor
= RGB( 0, 0, 0); /* see also SetBackgroundColor */
80 this->m_crGridColor
= RGB( 0, 255, 255); /* see also SetGridColor */
81 this->m_crPlotColor
[0] = RGB(255, 255, 255); /* see also SetPlotColor */
82 this->m_crPlotColor
[1] = RGB(100, 255, 255); /* see also SetPlotColor */
83 this->m_crPlotColor
[2] = RGB(255, 100, 255); /* see also SetPlotColor */
84 this->m_crPlotColor
[3] = RGB(255, 255, 100); /* see also SetPlotColor */
86 /* protected variables */
87 for (i
= 0; i
< MAX_PLOTS
; i
++)
89 this->m_penPlot
[i
] = CreatePen(PS_SOLID
, 0, this->m_crPlotColor
[i
]);
91 this->m_brushBack
= CreateSolidBrush(this->m_crBackColor
);
93 /* public member variables, can be set directly */
94 strcpy(this->m_strXUnitsString
, "Samples"); /* can also be set with SetXUnits */
95 strcpy(this->m_strYUnitsString
, "Y units"); /* can also be set with SetYUnits */
97 /* protected bitmaps to restore the memory DC's */
98 this->m_bitmapOldGrid
= NULL
;
99 this->m_bitmapOldPlot
= NULL
;
103 TGraphCtrl::~TGraphCtrl()
105 /* just to be picky restore the bitmaps for the two memory dc's */
106 /* (these dc's are being destroyed so there shouldn't be any leaks) */
107 if (m_bitmapOldGrid
!= NULL
) SelectObject(m_dcGrid
, m_bitmapOldGrid
);
108 if (m_bitmapOldPlot
!= NULL
) SelectObject(m_dcPlot
, m_bitmapOldPlot
);
109 if (m_bitmapGrid
!= NULL
) DeleteObject(m_bitmapGrid
);
110 if (m_bitmapPlot
!= NULL
) DeleteObject(m_bitmapPlot
);
111 if (m_dcGrid
!= NULL
) DeleteDC(m_dcGrid
);
112 if (m_dcPlot
!= NULL
) DeleteDC(m_dcPlot
);
113 if (m_brushBack
!= NULL
) DeleteObject(m_brushBack
);
117 BOOL
GraphCtrl_Create(TGraphCtrl
* this, HWND hWnd
, HWND hParentWnd
, UINT nID
)
121 GraphCtrl_Init(this);
122 this->m_hParentWnd
= hParentWnd
;
124 GraphCtrl_Resize(this);
126 GraphCtrl_InvalidateCtrl(this);
130 void GraphCtrl_SetRange(TGraphCtrl
* this, double dLower
, double dUpper
, int nDecimalPlaces
)
132 /* ASSERT(dUpper > dLower); */
133 this->m_dLowerLimit
= dLower
;
134 this->m_dUpperLimit
= dUpper
;
135 this->m_nYDecimals
= nDecimalPlaces
;
136 this->m_dRange
= this->m_dUpperLimit
- this->m_dLowerLimit
;
137 this->m_dVerticalFactor
= (double)this->m_nPlotHeight
/ this->m_dRange
;
138 /* clear out the existing garbage, re-start with a clean plot */
139 GraphCtrl_InvalidateCtrl(this);
143 void TGraphCtrl::SetXUnits(const char* string
)
145 strncpy(m_strXUnitsString
, string
, sizeof(m_strXUnitsString
) - 1);
146 /* clear out the existing garbage, re-start with a clean plot */
150 void TGraphCtrl::SetYUnits(const char* string
)
152 strncpy(m_strYUnitsString
, string
, sizeof(m_strYUnitsString
) - 1);
153 /* clear out the existing garbage, re-start with a clean plot */
158 void GraphCtrl_SetGridColor(TGraphCtrl
* this, COLORREF color
)
160 this->m_crGridColor
= color
;
161 /* clear out the existing garbage, re-start with a clean plot */
162 GraphCtrl_InvalidateCtrl(this);
165 void GraphCtrl_SetPlotColor(TGraphCtrl
* this, int plot
, COLORREF color
)
167 this->m_crPlotColor
[plot
] = color
;
168 DeleteObject(this->m_penPlot
[plot
]);
169 this->m_penPlot
[plot
] = CreatePen(PS_SOLID
, 0, this->m_crPlotColor
[plot
]);
170 /* clear out the existing garbage, re-start with a clean plot */
171 GraphCtrl_InvalidateCtrl(this);
174 void GraphCtrl_SetBackgroundColor(TGraphCtrl
* this, COLORREF color
)
176 this->m_crBackColor
= color
;
177 DeleteObject(this->m_brushBack
);
178 this->m_brushBack
= CreateSolidBrush(this->m_crBackColor
);
179 /* clear out the existing garbage, re-start with a clean plot */
180 GraphCtrl_InvalidateCtrl(this);
183 void GraphCtrl_InvalidateCtrl(TGraphCtrl
* this)
185 /* There is a lot of drawing going on here - particularly in terms of */
186 /* drawing the grid. Don't panic, this is all being drawn (only once) */
187 /* to a bitmap. The result is then BitBlt'd to the control whenever needed. */
190 int nTopGridPix
, nMidGridPix
, nBottomGridPix
;
193 HPEN solidPen
= CreatePen(PS_SOLID
, 0, this->m_crGridColor
);
194 /* HFONT axisFont, yUnitFont, oldFont; */
195 /* char strTemp[50]; */
197 /* in case we haven't established the memory dc's */
198 /* CClientDC dc(this); */
199 HDC dc
= GetDC(this->m_hParentWnd
);
201 /* if we don't have one yet, set up a memory dc for the grid */
202 if (this->m_dcGrid
== NULL
)
204 this->m_dcGrid
= CreateCompatibleDC(dc
);
205 this->m_bitmapGrid
= CreateCompatibleBitmap(dc
, this->m_nClientWidth
, this->m_nClientHeight
);
206 this->m_bitmapOldGrid
= (HBITMAP
)SelectObject(this->m_dcGrid
, this->m_bitmapGrid
);
209 SetBkColor(this->m_dcGrid
, this->m_crBackColor
);
211 /* fill the grid background */
212 FillRect(this->m_dcGrid
, &this->m_rectClient
, this->m_brushBack
);
214 /* draw the plot rectangle: */
215 /* determine how wide the y axis scaling values are */
216 nCharacters
= abs((int)log10(fabs(this->m_dUpperLimit
)));
217 nCharacters
= max(nCharacters
, abs((int)log10(fabs(this->m_dLowerLimit
))));
219 /* add the units digit, decimal point and a minus sign, and an extra space */
220 /* as well as the number of decimal places to display */
221 nCharacters
= nCharacters
+ 4 + this->m_nYDecimals
;
223 /* adjust the plot rectangle dimensions */
224 /* assume 6 pixels per character (this may need to be adjusted) */
225 /* m_rectPlot.left = m_rectClient.left + 6*(nCharacters); */
226 this->m_rectPlot
.left
= this->m_rectClient
.left
;
227 this->m_nPlotWidth
= this->m_rectPlot
.right
- this->m_rectPlot
.left
;/* m_rectPlot.Width(); */
229 /* draw the plot rectangle */
230 oldPen
= (HPEN
)SelectObject(this->m_dcGrid
, solidPen
);
231 MoveToEx(this->m_dcGrid
, this->m_rectPlot
.left
, this->m_rectPlot
.top
, NULL
);
232 LineTo(this->m_dcGrid
, this->m_rectPlot
.right
+1, this->m_rectPlot
.top
);
233 LineTo(this->m_dcGrid
, this->m_rectPlot
.right
+1, this->m_rectPlot
.bottom
+1);
234 LineTo(this->m_dcGrid
, this->m_rectPlot
.left
, this->m_rectPlot
.bottom
+1);
235 /* LineTo(m_dcGrid, m_rectPlot.left, m_rectPlot.top); */
236 SelectObject(this->m_dcGrid
, oldPen
);
237 DeleteObject(solidPen
);
239 /* draw the dotted lines,
240 * use SetPixel instead of a dotted pen - this allows for a
241 * finer dotted line and a more "technical" look
243 nMidGridPix
= (this->m_rectPlot
.top
+ this->m_rectPlot
.bottom
)/2;
244 nTopGridPix
= nMidGridPix
- this->m_nPlotHeight
/4;
245 nBottomGridPix
= nMidGridPix
+ this->m_nPlotHeight
/4;
247 for (i
=this->m_rectPlot
.left
; i
<this->m_rectPlot
.right
; i
+=2)
249 SetPixel(this->m_dcGrid
, i
, nTopGridPix
, this->m_crGridColor
);
250 SetPixel(this->m_dcGrid
, i
, nMidGridPix
, this->m_crGridColor
);
251 SetPixel(this->m_dcGrid
, i
, nBottomGridPix
, this->m_crGridColor
);
254 for (i
=this->m_rectPlot
.left
; i
<this->m_rectPlot
.right
; i
+=10)
256 for (j
=this->m_rectPlot
.top
; j
<this->m_rectPlot
.bottom
; j
+=2)
258 SetPixel(this->m_dcGrid
, i
, j
, this->m_crGridColor
);
259 /* SetPixel(m_dcGrid, i, j, m_crGridColor); */
260 /* SetPixel(m_dcGrid, i, j, m_crGridColor); */
265 /* create some fonts (horizontal and vertical) */
266 /* use a height of 14 pixels and 300 weight */
267 /* (these may need to be adjusted depending on the display) */
268 axisFont
= CreateFont (14, 0, 0, 0, 300,
269 FALSE
, FALSE
, 0, ANSI_CHARSET
,
273 DEFAULT_PITCH
|FF_SWISS
, "Arial");
274 yUnitFont
= CreateFont (14, 0, 900, 0, 300,
275 FALSE
, FALSE
, 0, ANSI_CHARSET
,
279 DEFAULT_PITCH
|FF_SWISS
, "Arial");
281 /* grab the horizontal font */
282 oldFont
= (HFONT
)SelectObject(m_dcGrid
, axisFont
);
285 SetTextColor(m_dcGrid
, m_crGridColor
);
286 SetTextAlign(m_dcGrid
, TA_RIGHT
|TA_TOP
);
287 sprintf(strTemp
, "%.*lf", m_nYDecimals
, m_dUpperLimit
);
288 TextOut(m_dcGrid
, m_rectPlot
.left
-4, m_rectPlot
.top
, strTemp
, _tcslen(strTemp
));
291 SetTextAlign(m_dcGrid
, TA_RIGHT
|TA_BASELINE
);
292 sprintf(strTemp
, "%.*lf", m_nYDecimals
, m_dLowerLimit
);
293 TextOut(m_dcGrid
, m_rectPlot
.left
-4, m_rectPlot
.bottom
, strTemp
, _tcslen(strTemp
));
296 SetTextAlign(m_dcGrid
, TA_LEFT
|TA_TOP
);
297 TextOut(m_dcGrid
, m_rectPlot
.left
, m_rectPlot
.bottom
+4, "0", 1);
300 SetTextAlign(m_dcGrid
, TA_RIGHT
|TA_TOP
);
301 sprintf(strTemp
, "%d", m_nPlotWidth
/m_nShiftPixels
);
302 TextOut(m_dcGrid
, m_rectPlot
.right
, m_rectPlot
.bottom
+4, strTemp
, _tcslen(strTemp
));
305 SetTextAlign(m_dcGrid
, TA_CENTER
|TA_TOP
);
306 TextOut(m_dcGrid
, (m_rectPlot
.left
+m_rectPlot
.right
)/2,
307 m_rectPlot
.bottom
+4, m_strXUnitsString
, _tcslen(m_strXUnitsString
));
309 /* restore the font */
310 SelectObject(m_dcGrid
, oldFont
);
313 oldFont
= (HFONT
)SelectObject(m_dcGrid
, yUnitFont
);
314 SetTextAlign(m_dcGrid
, TA_CENTER
|TA_BASELINE
);
315 TextOut(m_dcGrid
, (m_rectClient
.left
+m_rectPlot
.left
)/2,
316 (m_rectPlot
.bottom
+m_rectPlot
.top
)/2, m_strYUnitsString
, _tcslen(m_strYUnitsString
));
317 SelectObject(m_dcGrid
, oldFont
);
319 /* at this point we are done filling the the grid bitmap, */
320 /* no more drawing to this bitmap is needed until the setting are changed */
322 /* if we don't have one yet, set up a memory dc for the plot */
323 if (this->m_dcPlot
== NULL
)
325 this->m_dcPlot
= CreateCompatibleDC(dc
);
326 this->m_bitmapPlot
= CreateCompatibleBitmap(dc
, this->m_nClientWidth
, this->m_nClientHeight
);
327 this->m_bitmapOldPlot
= (HBITMAP
)SelectObject(this->m_dcPlot
, this->m_bitmapPlot
);
330 /* make sure the plot bitmap is cleared */
331 SetBkColor(this->m_dcPlot
, this->m_crBackColor
);
332 FillRect(this->m_dcPlot
, &this->m_rectClient
, this->m_brushBack
);
334 /* finally, force the plot area to redraw */
335 InvalidateRect(this->m_hParentWnd
, &this->m_rectClient
, TRUE
);
336 ReleaseDC(this->m_hParentWnd
, dc
);
339 double GraphCtrl_AppendPoint(TGraphCtrl
* this,
340 double dNewPoint0
, double dNewPoint1
,
341 double dNewPoint2
, double dNewPoint3
)
343 /* append a data point to the plot & return the previous point */
346 dPrevious
= this->m_dCurrentPosition
[0];
347 this->m_dCurrentPosition
[0] = dNewPoint0
;
348 this->m_dCurrentPosition
[1] = dNewPoint1
;
349 this->m_dCurrentPosition
[2] = dNewPoint2
;
350 this->m_dCurrentPosition
[3] = dNewPoint3
;
351 GraphCtrl_DrawPoint(this);
356 void GraphCtrl_Paint(TGraphCtrl
* this, HWND hWnd
, HDC dc
)
360 HBITMAP oldBitmap
; /* bitmap originally found in CMemDC */
363 /* GetClientRect(hWnd, &rcClient); */
364 /* FillSolidRect(dc, &rcClient, RGB(255, 0, 255)); */
365 /* m_nClientWidth = rcClient.right - rcClient.left; */
366 /* m_nClientHeight = rcClient.bottom - rcClient.top; */
368 /* no real plotting work is performed here, */
369 /* just putting the existing bitmaps on the client */
371 /* to avoid flicker, establish a memory dc, draw to it */
372 /* and then BitBlt it to the client */
373 memDC
= CreateCompatibleDC(dc
);
374 memBitmap
= (HBITMAP
)CreateCompatibleBitmap(dc
, this->m_nClientWidth
, this->m_nClientHeight
);
375 oldBitmap
= (HBITMAP
)SelectObject(memDC
, memBitmap
);
379 /* first drop the grid on the memory dc */
380 BitBlt(memDC
, 0, 0, this->m_nClientWidth
, this->m_nClientHeight
, this->m_dcGrid
, 0, 0, SRCCOPY
);
381 /* now add the plot on top as a "pattern" via SRCPAINT. */
382 /* works well with dark background and a light plot */
383 BitBlt(memDC
, 0, 0, this->m_nClientWidth
, this->m_nClientHeight
, this->m_dcPlot
, 0, 0, SRCPAINT
); /* SRCPAINT */
384 /* finally send the result to the display */
385 BitBlt(dc
, 0, 0, this->m_nClientWidth
, this->m_nClientHeight
, memDC
, 0, 0, SRCCOPY
);
387 SelectObject(memDC
, oldBitmap
);
388 DeleteObject(memBitmap
);
392 void GraphCtrl_DrawPoint(TGraphCtrl
* this)
394 /* this does the work of "scrolling" the plot to the left
395 * and appending a new data point all of the plotting is
396 * directed to the memory based bitmap associated with m_dcPlot
397 * the will subsequently be BitBlt'd to the client in Paint
399 int currX
, prevX
, currY
, prevY
;
404 if (this->m_dcPlot
!= NULL
)
406 /* shift the plot by BitBlt'ing it to itself
407 * note: the m_dcPlot covers the entire client
408 * but we only shift bitmap that is the size
409 * of the plot rectangle
410 * grab the right side of the plot (exluding m_nShiftPixels on the left)
411 * move this grabbed bitmap to the left by m_nShiftPixels
413 BitBlt(this->m_dcPlot
, this->m_rectPlot
.left
, this->m_rectPlot
.top
+1,
414 this->m_nPlotWidth
, this->m_nPlotHeight
, this->m_dcPlot
,
415 this->m_rectPlot
.left
+this->m_nShiftPixels
, this->m_rectPlot
.top
+1,
418 /* establish a rectangle over the right side of plot */
419 /* which now needs to be cleaned up proir to adding the new point */
420 rectCleanUp
= this->m_rectPlot
;
421 rectCleanUp
.left
= rectCleanUp
.right
- this->m_nShiftPixels
;
423 /* fill the cleanup area with the background */
424 FillRect(this->m_dcPlot
, &rectCleanUp
, this->m_brushBack
);
426 /* draw the next line segement */
427 for (i
= 0; i
< MAX_PLOTS
; i
++)
429 /* grab the plotting pen */
430 oldPen
= (HPEN
)SelectObject(this->m_dcPlot
, this->m_penPlot
[i
]);
432 /* move to the previous point */
433 prevX
= this->m_rectPlot
.right
-this->m_nPlotShiftPixels
;
434 prevY
= this->m_rectPlot
.bottom
-
435 (long)((this->m_dPreviousPosition
[i
] - this->m_dLowerLimit
) * this->m_dVerticalFactor
);
436 MoveToEx(this->m_dcPlot
, prevX
, prevY
, NULL
);
438 /* draw to the current point */
439 currX
= this->m_rectPlot
.right
-this->m_nHalfShiftPixels
;
440 currY
= this->m_rectPlot
.bottom
-
441 (long)((this->m_dCurrentPosition
[i
] - this->m_dLowerLimit
) * this->m_dVerticalFactor
);
442 LineTo(this->m_dcPlot
, currX
, currY
);
444 /* Restore the pen */
445 SelectObject(this->m_dcPlot
, oldPen
);
447 /* if the data leaks over the upper or lower plot boundaries
448 * fill the upper and lower leakage with the background
449 * this will facilitate clipping on an as needed basis
450 * as opposed to always calling IntersectClipRect
452 if ((prevY
<= this->m_rectPlot
.top
) || (currY
<= this->m_rectPlot
.top
))
455 rc
.bottom
= this->m_rectPlot
.top
+1;
458 rc
.top
= this->m_rectClient
.top
;
459 FillRect(this->m_dcPlot
, &rc
, this->m_brushBack
);
461 if ((prevY
>= this->m_rectPlot
.bottom
) || (currY
>= this->m_rectPlot
.bottom
))
464 rc
.bottom
= this->m_rectClient
.bottom
+1;
467 rc
.top
= this->m_rectPlot
.bottom
+1;
468 /* RECT rc(prevX, m_rectPlot.bottom+1, currX+1, m_rectClient.bottom+1); */
469 FillRect(this->m_dcPlot
, &rc
, this->m_brushBack
);
472 /* store the current point for connection to the next point */
473 this->m_dPreviousPosition
[i
] = this->m_dCurrentPosition
[i
];
478 void GraphCtrl_Resize(TGraphCtrl
* this)
480 /* NOTE: Resize automatically gets called during the setup of the control */
481 GetClientRect(this->m_hWnd
, &this->m_rectClient
);
483 /* set some member variables to avoid multiple function calls */
484 this->m_nClientHeight
= this->m_rectClient
.bottom
- this->m_rectClient
.top
;/* m_rectClient.Height(); */
485 this->m_nClientWidth
= this->m_rectClient
.right
- this->m_rectClient
.left
;/* m_rectClient.Width(); */
487 /* the "left" coordinate and "width" will be modified in */
488 /* InvalidateCtrl to be based on the width of the y axis scaling */
490 this->m_rectPlot
.left
= 20;
491 this->m_rectPlot
.top
= 10;
492 this->m_rectPlot
.right
= this->m_rectClient
.right
-10;
493 this->m_rectPlot
.bottom
= this->m_rectClient
.bottom
-25;
495 this->m_rectPlot
.left
= 0;
496 this->m_rectPlot
.top
= -1;
497 this->m_rectPlot
.right
= this->m_rectClient
.right
-0;
498 this->m_rectPlot
.bottom
= this->m_rectClient
.bottom
-0;
501 /* set some member variables to avoid multiple function calls */
502 this->m_nPlotHeight
= this->m_rectPlot
.bottom
- this->m_rectPlot
.top
;/* m_rectPlot.Height(); */
503 this->m_nPlotWidth
= this->m_rectPlot
.right
- this->m_rectPlot
.left
;/* m_rectPlot.Width(); */
505 /* set the scaling factor for now, this can be adjusted */
506 /* in the SetRange functions */
507 this->m_dVerticalFactor
= (double)this->m_nPlotHeight
/ this->m_dRange
;
511 void TGraphCtrl::Reset()
513 /* to clear the existing data (in the form of a bitmap) */
514 /* simply invalidate the entire control */
519 extern TGraphCtrl PerformancePageCpuUsageHistoryGraph
;
520 extern TGraphCtrl PerformancePageMemUsageHistoryGraph
;
521 extern HWND hPerformancePageCpuUsageHistoryGraph
;
522 extern HWND hPerformancePageMemUsageHistoryGraph
;
525 GraphCtrl_WndProc(HWND hWnd
, UINT message
, WPARAM wParam
, LPARAM lParam
)
536 * Filter out mouse & keyboard messages
538 /* case WM_APPCOMMAND: */
539 case WM_CAPTURECHANGED
:
540 case WM_LBUTTONDBLCLK
:
543 case WM_MBUTTONDBLCLK
:
546 case WM_MOUSEACTIVATE
:
550 /* case WM_MOUSEWHEEL: */
552 case WM_NCLBUTTONDBLCLK
:
553 case WM_NCLBUTTONDOWN
:
555 case WM_NCMBUTTONDBLCLK
:
556 case WM_NCMBUTTONDOWN
:
558 /* case WM_NCMOUSEHOVER: */
559 /* case WM_NCMOUSELEAVE: */
561 case WM_NCRBUTTONDBLCLK
:
562 case WM_NCRBUTTONDOWN
:
564 /* case WM_NCXBUTTONDBLCLK: */
565 /* case WM_NCXBUTTONDOWN: */
566 /* case WM_NCXBUTTONUP: */
567 case WM_RBUTTONDBLCLK
:
570 /* case WM_XBUTTONDBLCLK: */
571 /* case WM_XBUTTONDOWN: */
572 /* case WM_XBUTTONUP: */
593 if (hWnd
== hPerformancePageMemUsageHistoryGraph
)
595 GraphCtrl_Resize(&PerformancePageMemUsageHistoryGraph
);
596 GraphCtrl_InvalidateCtrl(&PerformancePageMemUsageHistoryGraph
);
598 if (hWnd
== hPerformancePageCpuUsageHistoryGraph
)
600 GraphCtrl_Resize(&PerformancePageCpuUsageHistoryGraph
);
601 GraphCtrl_InvalidateCtrl(&PerformancePageCpuUsageHistoryGraph
);
606 hdc
= BeginPaint(hWnd
, &ps
);
607 GetClientRect(hWnd
, &rcClient
);
608 if (hWnd
== hPerformancePageMemUsageHistoryGraph
)
609 GraphCtrl_Paint(&PerformancePageMemUsageHistoryGraph
, hWnd
, hdc
);
610 if (hWnd
== hPerformancePageCpuUsageHistoryGraph
)
611 GraphCtrl_Paint(&PerformancePageCpuUsageHistoryGraph
, hWnd
, hdc
);
617 * We pass on all non-handled messages
619 return CallWindowProc((WNDPROC
)OldGraphCtrlWndProc
, hWnd
, message
, wParam
, lParam
);