6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library 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 GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 WNDPROC OldGraphCtrlWndProc
;
34 static void GraphCtrl_Init(TGraphCtrl
* this)
39 this->m_hParentWnd
= 0;
42 this->m_bitmapOldGrid
= 0;
43 this->m_bitmapOldPlot
= 0;
44 this->m_bitmapGrid
= 0;
45 this->m_bitmapPlot
= 0;
46 this->m_brushBack
= 0;
48 this->m_penPlot
[0] = 0;
49 this->m_penPlot
[1] = 0;
50 this->m_penPlot
[2] = 0;
51 this->m_penPlot
[3] = 0;
53 /* since plotting is based on a LineTo for each new point
54 * we need a starting point (i.e. a "previous" point)
55 * use 0.0 as the default first point.
56 * these are public member variables, and can be changed outside
57 * (after construction). Therefore m_dPreviousPosition could be set to
58 * a more appropriate value prior to the first call to SetPosition.
60 this->m_dPreviousPosition
[0] = 0.0;
61 this->m_dPreviousPosition
[1] = 0.0;
62 this->m_dPreviousPosition
[2] = 0.0;
63 this->m_dPreviousPosition
[3] = 0.0;
65 /* public variable for the number of decimal places on the y axis */
66 this->m_nYDecimals
= 3;
68 /* set some initial values for the scaling until "SetRange" is called.
69 * these are protected variables and must be set with SetRange
70 * in order to ensure that m_dRange is updated accordingly
72 /* m_dLowerLimit = -10.0; */
73 /* m_dUpperLimit = 10.0; */
74 this->m_dLowerLimit
= 0.0;
75 this->m_dUpperLimit
= 100.0;
76 this->m_dRange
= this->m_dUpperLimit
- this->m_dLowerLimit
; /* protected member variable */
78 /* m_nShiftPixels determines how much the plot shifts (in terms of pixels) */
79 /* with the addition of a new data point */
80 this->m_nShiftPixels
= 4;
81 this->m_nHalfShiftPixels
= this->m_nShiftPixels
/2; /* protected */
82 this->m_nPlotShiftPixels
= this->m_nShiftPixels
+ this->m_nHalfShiftPixels
; /* protected */
84 /* background, grid and data colors */
85 /* these are public variables and can be set directly */
86 this->m_crBackColor
= RGB( 0, 0, 0); /* see also SetBackgroundColor */
87 this->m_crGridColor
= RGB( 0, 255, 255); /* see also SetGridColor */
88 this->m_crPlotColor
[0] = RGB(255, 255, 255); /* see also SetPlotColor */
89 this->m_crPlotColor
[1] = RGB(100, 255, 255); /* see also SetPlotColor */
90 this->m_crPlotColor
[2] = RGB(255, 100, 255); /* see also SetPlotColor */
91 this->m_crPlotColor
[3] = RGB(255, 255, 100); /* see also SetPlotColor */
93 /* protected variables */
94 for (i
= 0; i
< MAX_PLOTS
; i
++)
96 this->m_penPlot
[i
] = CreatePen(PS_SOLID
, 0, this->m_crPlotColor
[i
]);
98 this->m_brushBack
= CreateSolidBrush(this->m_crBackColor
);
100 /* public member variables, can be set directly */
101 strcpy(this->m_strXUnitsString
, "Samples"); /* can also be set with SetXUnits */
102 strcpy(this->m_strYUnitsString
, "Y units"); /* can also be set with SetYUnits */
104 /* protected bitmaps to restore the memory DC's */
105 this->m_bitmapOldGrid
= NULL
;
106 this->m_bitmapOldPlot
= NULL
;
110 TGraphCtrl::~TGraphCtrl(void)
112 /* just to be picky restore the bitmaps for the two memory dc's */
113 /* (these dc's are being destroyed so there shouldn't be any leaks) */
114 if (m_bitmapOldGrid
!= NULL
) SelectObject(m_dcGrid
, m_bitmapOldGrid
);
115 if (m_bitmapOldPlot
!= NULL
) SelectObject(m_dcPlot
, m_bitmapOldPlot
);
116 if (m_bitmapGrid
!= NULL
) DeleteObject(m_bitmapGrid
);
117 if (m_bitmapPlot
!= NULL
) DeleteObject(m_bitmapPlot
);
118 if (m_dcGrid
!= NULL
) DeleteDC(m_dcGrid
);
119 if (m_dcPlot
!= NULL
) DeleteDC(m_dcPlot
);
120 if (m_brushBack
!= NULL
) DeleteObject(m_brushBack
);
124 static void GraphCtrl_Resize(TGraphCtrl
* this)
126 /* NOTE: Resize automatically gets called during the setup of the control */
127 GetClientRect(this->m_hWnd
, &this->m_rectClient
);
129 /* set some member variables to avoid multiple function calls */
130 this->m_nClientHeight
= this->m_rectClient
.bottom
- this->m_rectClient
.top
;/* m_rectClient.Height(); */
131 this->m_nClientWidth
= this->m_rectClient
.right
- this->m_rectClient
.left
;/* m_rectClient.Width(); */
133 /* the "left" coordinate and "width" will be modified in */
134 /* InvalidateCtrl to be based on the width of the y axis scaling */
136 this->m_rectPlot
.left
= 20;
137 this->m_rectPlot
.top
= 10;
138 this->m_rectPlot
.right
= this->m_rectClient
.right
-10;
139 this->m_rectPlot
.bottom
= this->m_rectClient
.bottom
-25;
141 this->m_rectPlot
.left
= 0;
142 this->m_rectPlot
.top
= -1;
143 this->m_rectPlot
.right
= this->m_rectClient
.right
-0;
144 this->m_rectPlot
.bottom
= this->m_rectClient
.bottom
-0;
147 /* set some member variables to avoid multiple function calls */
148 this->m_nPlotHeight
= this->m_rectPlot
.bottom
- this->m_rectPlot
.top
;/* m_rectPlot.Height(); */
149 this->m_nPlotWidth
= this->m_rectPlot
.right
- this->m_rectPlot
.left
;/* m_rectPlot.Width(); */
151 /* set the scaling factor for now, this can be adjusted */
152 /* in the SetRange functions */
153 this->m_dVerticalFactor
= (double)this->m_nPlotHeight
/ this->m_dRange
;
156 void GraphCtrl_Create(TGraphCtrl
* this, HWND hWnd
, HWND hParentWnd
, UINT nID
)
158 GraphCtrl_Init(this);
159 this->m_hParentWnd
= hParentWnd
;
161 GraphCtrl_Resize(this);
164 static void GraphCtrl_InvalidateCtrl(TGraphCtrl
* this)
166 /* There is a lot of drawing going on here - particularly in terms of */
167 /* drawing the grid. Don't panic, this is all being drawn (only once) */
168 /* to a bitmap. The result is then BitBlt'd to the control whenever needed. */
171 int nTopGridPix
, nMidGridPix
, nBottomGridPix
;
174 HPEN solidPen
= CreatePen(PS_SOLID
, 0, this->m_crGridColor
);
175 /* HFONT axisFont, yUnitFont, oldFont; */
176 /* char strTemp[50]; */
178 /* in case we haven't established the memory dc's */
179 /* CClientDC dc(this); */
180 HDC dc
= GetDC(this->m_hParentWnd
);
182 /* if we don't have one yet, set up a memory dc for the grid */
183 if (this->m_dcGrid
== NULL
)
185 this->m_dcGrid
= CreateCompatibleDC(dc
);
186 this->m_bitmapGrid
= CreateCompatibleBitmap(dc
, this->m_nClientWidth
, this->m_nClientHeight
);
187 this->m_bitmapOldGrid
= SelectObject(this->m_dcGrid
, this->m_bitmapGrid
);
190 SetBkColor(this->m_dcGrid
, this->m_crBackColor
);
192 /* fill the grid background */
193 FillRect(this->m_dcGrid
, &this->m_rectClient
, this->m_brushBack
);
195 /* draw the plot rectangle: */
196 /* determine how wide the y axis scaling values are */
197 nCharacters
= abs((int)log10(fabs(this->m_dUpperLimit
)));
198 nCharacters
= max(nCharacters
, abs((int)log10(fabs(this->m_dLowerLimit
))));
200 /* add the units digit, decimal point and a minus sign, and an extra space */
201 /* as well as the number of decimal places to display */
202 nCharacters
= nCharacters
+ 4 + this->m_nYDecimals
;
204 /* adjust the plot rectangle dimensions */
205 /* assume 6 pixels per character (this may need to be adjusted) */
206 /* m_rectPlot.left = m_rectClient.left + 6*(nCharacters); */
207 this->m_rectPlot
.left
= this->m_rectClient
.left
;
208 this->m_nPlotWidth
= this->m_rectPlot
.right
- this->m_rectPlot
.left
;/* m_rectPlot.Width(); */
210 /* draw the plot rectangle */
211 oldPen
= SelectObject(this->m_dcGrid
, solidPen
);
212 MoveToEx(this->m_dcGrid
, this->m_rectPlot
.left
, this->m_rectPlot
.top
, NULL
);
213 LineTo(this->m_dcGrid
, this->m_rectPlot
.right
+1, this->m_rectPlot
.top
);
214 LineTo(this->m_dcGrid
, this->m_rectPlot
.right
+1, this->m_rectPlot
.bottom
+1);
215 LineTo(this->m_dcGrid
, this->m_rectPlot
.left
, this->m_rectPlot
.bottom
+1);
216 /* LineTo(m_dcGrid, m_rectPlot.left, m_rectPlot.top); */
217 SelectObject(this->m_dcGrid
, oldPen
);
218 DeleteObject(solidPen
);
220 /* draw the dotted lines,
221 * use SetPixel instead of a dotted pen - this allows for a
222 * finer dotted line and a more "technical" look
224 nMidGridPix
= (this->m_rectPlot
.top
+ this->m_rectPlot
.bottom
)/2;
225 nTopGridPix
= nMidGridPix
- this->m_nPlotHeight
/4;
226 nBottomGridPix
= nMidGridPix
+ this->m_nPlotHeight
/4;
228 for (i
=this->m_rectPlot
.left
; i
<this->m_rectPlot
.right
; i
+=2)
230 SetPixel(this->m_dcGrid
, i
, nTopGridPix
, this->m_crGridColor
);
231 SetPixel(this->m_dcGrid
, i
, nMidGridPix
, this->m_crGridColor
);
232 SetPixel(this->m_dcGrid
, i
, nBottomGridPix
, this->m_crGridColor
);
235 for (i
=this->m_rectPlot
.left
; i
<this->m_rectPlot
.right
; i
+=10)
237 for (j
=this->m_rectPlot
.top
; j
<this->m_rectPlot
.bottom
; j
+=2)
239 SetPixel(this->m_dcGrid
, i
, j
, this->m_crGridColor
);
240 /* SetPixel(m_dcGrid, i, j, m_crGridColor); */
241 /* SetPixel(m_dcGrid, i, j, m_crGridColor); */
246 /* create some fonts (horizontal and vertical) */
247 /* use a height of 14 pixels and 300 weight */
248 /* (these may need to be adjusted depending on the display) */
249 axisFont
= CreateFont (14, 0, 0, 0, 300,
250 FALSE
, FALSE
, 0, ANSI_CHARSET
,
254 DEFAULT_PITCH
|FF_SWISS
, "Arial");
255 yUnitFont
= CreateFont (14, 0, 900, 0, 300,
256 FALSE
, FALSE
, 0, ANSI_CHARSET
,
260 DEFAULT_PITCH
|FF_SWISS
, "Arial");
262 /* grab the horizontal font */
263 oldFont
= SelectObject(m_dcGrid
, axisFont
);
266 SetTextColor(m_dcGrid
, m_crGridColor
);
267 SetTextAlign(m_dcGrid
, TA_RIGHT
|TA_TOP
);
268 sprintf(strTemp
, "%.*lf", m_nYDecimals
, m_dUpperLimit
);
269 TextOut(m_dcGrid
, m_rectPlot
.left
-4, m_rectPlot
.top
, strTemp
, _tcslen(strTemp
));
272 SetTextAlign(m_dcGrid
, TA_RIGHT
|TA_BASELINE
);
273 sprintf(strTemp
, "%.*lf", m_nYDecimals
, m_dLowerLimit
);
274 TextOut(m_dcGrid
, m_rectPlot
.left
-4, m_rectPlot
.bottom
, strTemp
, _tcslen(strTemp
));
277 SetTextAlign(m_dcGrid
, TA_LEFT
|TA_TOP
);
278 TextOut(m_dcGrid
, m_rectPlot
.left
, m_rectPlot
.bottom
+4, "0", 1);
281 SetTextAlign(m_dcGrid
, TA_RIGHT
|TA_TOP
);
282 sprintf(strTemp
, "%d", m_nPlotWidth
/m_nShiftPixels
);
283 TextOut(m_dcGrid
, m_rectPlot
.right
, m_rectPlot
.bottom
+4, strTemp
, _tcslen(strTemp
));
286 SetTextAlign(m_dcGrid
, TA_CENTER
|TA_TOP
);
287 TextOut(m_dcGrid
, (m_rectPlot
.left
+m_rectPlot
.right
)/2,
288 m_rectPlot
.bottom
+4, m_strXUnitsString
, _tcslen(m_strXUnitsString
));
290 /* restore the font */
291 SelectObject(m_dcGrid
, oldFont
);
294 oldFont
= SelectObject(m_dcGrid
, yUnitFont
);
295 SetTextAlign(m_dcGrid
, TA_CENTER
|TA_BASELINE
);
296 TextOut(m_dcGrid
, (m_rectClient
.left
+m_rectPlot
.left
)/2,
297 (m_rectPlot
.bottom
+m_rectPlot
.top
)/2, m_strYUnitsString
, _tcslen(m_strYUnitsString
));
298 SelectObject(m_dcGrid
, oldFont
);
300 /* at this point we are done filling the grid bitmap, */
301 /* no more drawing to this bitmap is needed until the settings are changed */
303 /* if we don't have one yet, set up a memory dc for the plot */
304 if (this->m_dcPlot
== NULL
)
306 this->m_dcPlot
= CreateCompatibleDC(dc
);
307 this->m_bitmapPlot
= CreateCompatibleBitmap(dc
, this->m_nClientWidth
, this->m_nClientHeight
);
308 this->m_bitmapOldPlot
= SelectObject(this->m_dcPlot
, this->m_bitmapPlot
);
311 /* make sure the plot bitmap is cleared */
312 SetBkColor(this->m_dcPlot
, this->m_crBackColor
);
313 FillRect(this->m_dcPlot
, &this->m_rectClient
, this->m_brushBack
);
315 /* finally, force the plot area to redraw */
316 InvalidateRect(this->m_hParentWnd
, &this->m_rectClient
, TRUE
);
317 ReleaseDC(this->m_hParentWnd
, dc
);
320 void GraphCtrl_SetRange(TGraphCtrl
* this, double dLower
, double dUpper
, int nDecimalPlaces
)
322 /* ASSERT(dUpper > dLower); */
323 this->m_dLowerLimit
= dLower
;
324 this->m_dUpperLimit
= dUpper
;
325 this->m_nYDecimals
= nDecimalPlaces
;
326 this->m_dRange
= this->m_dUpperLimit
- this->m_dLowerLimit
;
327 this->m_dVerticalFactor
= (double)this->m_nPlotHeight
/ this->m_dRange
;
328 /* clear out the existing garbage, re-start with a clean plot */
329 GraphCtrl_InvalidateCtrl(this);
333 void TGraphCtrl::SetXUnits(const char* string
)
335 lstrcpynA(m_strXUnitsString
, string
, sizeof(m_strXUnitsString
));
336 /* clear out the existing garbage, re-start with a clean plot */
340 void TGraphCtrl::SetYUnits(const char* string
)
342 lstrcpynA(m_strYUnitsString
, string
, sizeof(m_strYUnitsString
));
343 /* clear out the existing garbage, re-start with a clean plot */
348 void GraphCtrl_SetGridColor(TGraphCtrl
* this, COLORREF color
)
350 this->m_crGridColor
= color
;
351 /* clear out the existing garbage, re-start with a clean plot */
352 GraphCtrl_InvalidateCtrl(this);
355 void GraphCtrl_SetPlotColor(TGraphCtrl
* this, int plot
, COLORREF color
)
357 this->m_crPlotColor
[plot
] = color
;
358 DeleteObject(this->m_penPlot
[plot
]);
359 this->m_penPlot
[plot
] = CreatePen(PS_SOLID
, 0, this->m_crPlotColor
[plot
]);
360 /* clear out the existing garbage, re-start with a clean plot */
361 GraphCtrl_InvalidateCtrl(this);
364 void GraphCtrl_SetBackgroundColor(TGraphCtrl
* this, COLORREF color
)
366 this->m_crBackColor
= color
;
367 DeleteObject(this->m_brushBack
);
368 this->m_brushBack
= CreateSolidBrush(this->m_crBackColor
);
369 /* clear out the existing garbage, re-start with a clean plot */
370 GraphCtrl_InvalidateCtrl(this);
373 static void GraphCtrl_DrawPoint(TGraphCtrl
* this)
375 /* this does the work of "scrolling" the plot to the left
376 * and appending a new data point all of the plotting is
377 * directed to the memory based bitmap associated with m_dcPlot
378 * the will subsequently be BitBlt'd to the client in Paint
380 int currX
, prevX
, currY
, prevY
;
385 if (this->m_dcPlot
!= NULL
)
387 /* shift the plot by BitBlt'ing it to itself
388 * note: the m_dcPlot covers the entire client
389 * but we only shift bitmap that is the size
390 * of the plot rectangle
391 * grab the right side of the plot (excluding m_nShiftPixels on the left)
392 * move this grabbed bitmap to the left by m_nShiftPixels
394 BitBlt(this->m_dcPlot
, this->m_rectPlot
.left
, this->m_rectPlot
.top
+1,
395 this->m_nPlotWidth
, this->m_nPlotHeight
, this->m_dcPlot
,
396 this->m_rectPlot
.left
+this->m_nShiftPixels
, this->m_rectPlot
.top
+1,
399 /* establish a rectangle over the right side of plot */
400 /* which now needs to be cleaned up prior to adding the new point */
401 rectCleanUp
= this->m_rectPlot
;
402 rectCleanUp
.left
= rectCleanUp
.right
- this->m_nShiftPixels
;
404 /* fill the cleanup area with the background */
405 FillRect(this->m_dcPlot
, &rectCleanUp
, this->m_brushBack
);
407 /* draw the next line segment */
408 for (i
= 0; i
< MAX_PLOTS
; i
++)
410 /* grab the plotting pen */
411 oldPen
= SelectObject(this->m_dcPlot
, this->m_penPlot
[i
]);
413 /* move to the previous point */
414 prevX
= this->m_rectPlot
.right
-this->m_nPlotShiftPixels
;
415 prevY
= this->m_rectPlot
.bottom
-
416 (int)((this->m_dPreviousPosition
[i
] - this->m_dLowerLimit
) * this->m_dVerticalFactor
);
417 MoveToEx(this->m_dcPlot
, prevX
, prevY
, NULL
);
419 /* draw to the current point */
420 currX
= this->m_rectPlot
.right
-this->m_nHalfShiftPixels
;
421 currY
= this->m_rectPlot
.bottom
-
422 (int)((this->m_dCurrentPosition
[i
] - this->m_dLowerLimit
) * this->m_dVerticalFactor
);
423 LineTo(this->m_dcPlot
, currX
, currY
);
425 /* Restore the pen */
426 SelectObject(this->m_dcPlot
, oldPen
);
428 /* if the data leaks over the upper or lower plot boundaries
429 * fill the upper and lower leakage with the background
430 * this will facilitate clipping on an as needed basis
431 * as opposed to always calling IntersectClipRect
433 if ((prevY
<= this->m_rectPlot
.top
) || (currY
<= this->m_rectPlot
.top
))
436 rc
.bottom
= this->m_rectPlot
.top
+1;
439 rc
.top
= this->m_rectClient
.top
;
440 FillRect(this->m_dcPlot
, &rc
, this->m_brushBack
);
442 if ((prevY
>= this->m_rectPlot
.bottom
) || (currY
>= this->m_rectPlot
.bottom
))
445 rc
.bottom
= this->m_rectClient
.bottom
+1;
448 rc
.top
= this->m_rectPlot
.bottom
+1;
449 /* RECT rc(prevX, m_rectPlot.bottom+1, currX+1, m_rectClient.bottom+1); */
450 FillRect(this->m_dcPlot
, &rc
, this->m_brushBack
);
453 /* store the current point for connection to the next point */
454 this->m_dPreviousPosition
[i
] = this->m_dCurrentPosition
[i
];
459 double GraphCtrl_AppendPoint(TGraphCtrl
* this,
460 double dNewPoint0
, double dNewPoint1
,
461 double dNewPoint2
, double dNewPoint3
)
463 /* append a data point to the plot & return the previous point */
466 dPrevious
= this->m_dCurrentPosition
[0];
467 this->m_dCurrentPosition
[0] = dNewPoint0
;
468 this->m_dCurrentPosition
[1] = dNewPoint1
;
469 this->m_dCurrentPosition
[2] = dNewPoint2
;
470 this->m_dCurrentPosition
[3] = dNewPoint3
;
471 GraphCtrl_DrawPoint(this);
476 static void GraphCtrl_Paint(TGraphCtrl
* this, HWND hWnd
, HDC dc
)
480 HBITMAP oldBitmap
; /* bitmap originally found in CMemDC */
483 /* GetClientRect(hWnd, &rcClient); */
484 /* FillSolidRect(dc, &rcClient, RGB(255, 0, 255)); */
485 /* m_nClientWidth = rcClient.right - rcClient.left; */
486 /* m_nClientHeight = rcClient.bottom - rcClient.top; */
488 /* no real plotting work is performed here, */
489 /* just putting the existing bitmaps on the client */
491 /* to avoid flicker, establish a memory dc, draw to it */
492 /* and then BitBlt it to the client */
493 memDC
= CreateCompatibleDC(dc
);
494 memBitmap
= CreateCompatibleBitmap(dc
, this->m_nClientWidth
, this->m_nClientHeight
);
495 oldBitmap
= SelectObject(memDC
, memBitmap
);
499 /* first drop the grid on the memory dc */
500 BitBlt(memDC
, 0, 0, this->m_nClientWidth
, this->m_nClientHeight
, this->m_dcGrid
, 0, 0, SRCCOPY
);
501 /* now add the plot on top as a "pattern" via SRCPAINT. */
502 /* works well with dark background and a light plot */
503 BitBlt(memDC
, 0, 0, this->m_nClientWidth
, this->m_nClientHeight
, this->m_dcPlot
, 0, 0, SRCPAINT
); /* SRCPAINT */
504 /* finally send the result to the display */
505 BitBlt(dc
, 0, 0, this->m_nClientWidth
, this->m_nClientHeight
, memDC
, 0, 0, SRCCOPY
);
507 SelectObject(memDC
, oldBitmap
);
508 DeleteObject(memBitmap
);
513 void TGraphCtrl::Reset(void)
515 /* to clear the existing data (in the form of a bitmap) */
516 /* simply invalidate the entire control */
521 extern TGraphCtrl PerformancePageCpuUsageHistoryGraph
;
522 extern TGraphCtrl PerformancePageMemUsageHistoryGraph
;
523 extern HWND hPerformancePageCpuUsageHistoryGraph
;
524 extern HWND hPerformancePageMemUsageHistoryGraph
;
527 GraphCtrl_WndProc(HWND hWnd
, UINT message
, WPARAM wParam
, LPARAM lParam
)
538 * Filter out mouse & keyboard messages
540 /* case WM_APPCOMMAND: */
541 case WM_CAPTURECHANGED
:
542 case WM_LBUTTONDBLCLK
:
545 case WM_MBUTTONDBLCLK
:
548 case WM_MOUSEACTIVATE
:
552 /* case WM_MOUSEWHEEL: */
554 case WM_NCLBUTTONDBLCLK
:
555 case WM_NCLBUTTONDOWN
:
557 case WM_NCMBUTTONDBLCLK
:
558 case WM_NCMBUTTONDOWN
:
560 /* case WM_NCMOUSEHOVER: */
561 /* case WM_NCMOUSELEAVE: */
563 case WM_NCRBUTTONDBLCLK
:
564 case WM_NCRBUTTONDOWN
:
566 /* case WM_NCXBUTTONDBLCLK: */
567 /* case WM_NCXBUTTONDOWN: */
568 /* case WM_NCXBUTTONUP: */
569 case WM_RBUTTONDBLCLK
:
572 /* case WM_XBUTTONDBLCLK: */
573 /* case WM_XBUTTONDOWN: */
574 /* case WM_XBUTTONUP: */
595 if (hWnd
== hPerformancePageMemUsageHistoryGraph
)
597 GraphCtrl_Resize(&PerformancePageMemUsageHistoryGraph
);
598 GraphCtrl_InvalidateCtrl(&PerformancePageMemUsageHistoryGraph
);
600 if (hWnd
== hPerformancePageCpuUsageHistoryGraph
)
602 GraphCtrl_Resize(&PerformancePageCpuUsageHistoryGraph
);
603 GraphCtrl_InvalidateCtrl(&PerformancePageCpuUsageHistoryGraph
);
608 hdc
= BeginPaint(hWnd
, &ps
);
609 GetClientRect(hWnd
, &rcClient
);
610 if (hWnd
== hPerformancePageMemUsageHistoryGraph
)
611 GraphCtrl_Paint(&PerformancePageMemUsageHistoryGraph
, hWnd
, hdc
);
612 if (hWnd
== hPerformancePageCpuUsageHistoryGraph
)
613 GraphCtrl_Paint(&PerformancePageCpuUsageHistoryGraph
, hWnd
, hdc
);
619 * We pass on all non-handled messages
621 return CallWindowProcW(OldGraphCtrlWndProc
, hWnd
, message
, wParam
, lParam
);