2024-12-21 10:04:04 +08:00
|
|
|
|
// MainDialogBar.cpp : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "ServiceMonitor.h"
|
|
|
|
|
|
#include "MainDialogBar.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CMainDialogBar
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CMainDialogBar, CDialogBar)
|
|
|
|
|
|
|
|
|
|
|
|
CMainDialogBar::CMainDialogBar()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CMainDialogBar::~CMainDialogBar()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CMainDialogBar, CDialogBar)
|
|
|
|
|
|
ON_WM_PAINT()
|
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CMainDialogBar <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CMainDialogBar::OnPaint()
|
|
|
|
|
|
{
|
|
|
|
|
|
CPaintDC dc(this); // device context for painting
|
|
|
|
|
|
// TODO: <20><><EFBFBD> <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
|
|
|
|
|
// <20><EFBFBD><D7B8><EFBFBD> <20><EFBFBD><DEBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD> CDialogBar::OnPaint()<29><>(<28><>) ȣ<><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ʽÿ<CABD>.
|
|
|
|
|
|
|
|
|
|
|
|
Graphics aGraphics(dc);
|
|
|
|
|
|
aGraphics.SetSmoothingMode(SmoothingModeHighQuality);
|
|
|
|
|
|
|
|
|
|
|
|
CRect aRect;
|
|
|
|
|
|
GetClientRect(&aRect);
|
|
|
|
|
|
|
|
|
|
|
|
// Draw Title
|
|
|
|
|
|
{
|
|
|
|
|
|
// Gradient Line
|
|
|
|
|
|
{
|
|
|
|
|
|
LinearGradientBrush aBrush(
|
|
|
|
|
|
Rect(
|
|
|
|
|
|
EV_UIS_TITLELINE_PAD_X,
|
|
|
|
|
|
EV_UIS_TITLELINE_PAD_Y,
|
|
|
|
|
|
aRect.right - (EV_UIS_TITLELINE_PAD_X * 2),
|
|
|
|
|
|
EV_UIS_TITLELINE_HGT
|
|
|
|
|
|
),
|
|
|
|
|
|
Color(100, 221, 221, 221),
|
|
|
|
|
|
Color(255, 120, 120, 120),
|
|
|
|
|
|
180.0f,
|
|
|
|
|
|
FALSE
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
aGraphics.FillRectangle(
|
|
|
|
|
|
&aBrush,
|
|
|
|
|
|
EV_UIS_TITLELINE_PAD_X,
|
|
|
|
|
|
EV_UIS_TITLELINE_PAD_Y,
|
|
|
|
|
|
aRect.right - (EV_UIS_TITLELINE_PAD_X * 2 + 1),
|
|
|
|
|
|
EV_UIS_TITLELINE_HGT
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Draw Text
|
|
|
|
|
|
{
|
|
|
|
|
|
LOGFONT aLogFont;
|
|
|
|
|
|
::memset(&aLogFont, 0x00, sizeof(aLogFont));
|
|
|
|
|
|
_tcsncpy_s(aLogFont.lfFaceName, _T("Arial"), LF_FACESIZE);
|
|
|
|
|
|
aLogFont.lfCharSet = DEFAULT_CHARSET;
|
|
|
|
|
|
aLogFont.lfHeight = 20;
|
|
|
|
|
|
aLogFont.lfWeight = FW_EXTRABOLD;
|
|
|
|
|
|
|
|
|
|
|
|
CFont aNewFont;
|
|
|
|
|
|
VERIFY(aNewFont.CreateFontIndirect(&aLogFont));
|
|
|
|
|
|
CFont* aOldFont = dc.SelectObject(&aNewFont);
|
|
|
|
|
|
|
|
|
|
|
|
COLORREF aOldTxColor = dc.SetTextColor(RGB(255, 255, 255));
|
|
|
|
|
|
int aOldBkMode = dc.SetBkMode(TRANSPARENT);
|
|
|
|
|
|
|
|
|
|
|
|
CRect aRect(
|
|
|
|
|
|
EV_UIS_TITLELINE_PAD_X + EV_UIS_TITLETEXT_PAD_X,
|
|
|
|
|
|
EV_UIS_TITLELINE_PAD_Y,
|
|
|
|
|
|
aRect.right - EV_UIS_TITLELINE_PAD_X - EV_UIS_TITLETEXT_PAD_X,
|
|
|
|
|
|
aRect.top + EV_UIS_TITLELINE_HGT + EV_UIS_TITLELINE_PAD_Y
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
dc.DrawText(_T("Total Service Status"), &aRect, DT_LEFT | DT_VCENTER);
|
|
|
|
|
|
|
|
|
|
|
|
dc.SetTextColor(aOldTxColor);
|
|
|
|
|
|
dc.SetBkMode(aOldBkMode);
|
|
|
|
|
|
|
|
|
|
|
|
dc.SelectObject(aOldFont);
|
|
|
|
|
|
aNewFont.DeleteObject();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|