diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2DlgItemGageBase.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/T2DLL/T2DlgItemGageBase.cpp b/src/T2DLL/T2DlgItemGageBase.cpp index fd39101..02ff085 100644 --- a/src/T2DLL/T2DlgItemGageBase.cpp +++ b/src/T2DLL/T2DlgItemGageBase.cpp @@ -12,18 +12,18 @@ T2DlgItemGageBase::T2DlgItemGageBase(T2TowerDoc* towerDoc, T2ImageObj* imageObj, } /*virtual*/ BOOL T2DlgItemGageBase::OnT2DlgItemEraseBkgnd(CDC* dc) { - CRect clientRect; - GetClientRect(clientRect); + CRect rect; + GetClientRect(rect); - int save = dc->SaveDC(); + int saved = dc->SaveDC(); dc->SelectPalette(mPalette, false); dc->RealizePalette(); - CRect interior = clientRect; + CRect theInterior = rect; if (IsDrawInterior()) - DrawInterior(dc, interior); + DrawInterior(dc, theInterior); - dc->RestoreDC(save); + dc->RestoreDC(saved); return true; } @@ -41,15 +41,15 @@ void T2DlgItemGageBase::DrawBorderLines(CDC* dc, const CRect& rect) { CPen pen; pen.CreatePen(PS_SOLID, 0, PALETTEINDEX(255)); - HPEN prevPen = *dc->SelectObject(&pen); + HPEN oldPenH = *dc->SelectObject(&pen); - int bluePos = CalcPos(rect, GetMinValue(), GetMaxValue(), GetBlueValue()); - dc->MoveTo(bluePos, rect.top); - dc->LineTo(bluePos, rect.bottom - 1); + int theBlue = CalcPos(rect, GetMinValue(), GetMaxValue(), GetBlueValue()); + dc->MoveTo(theBlue, rect.top); + dc->LineTo(theBlue, rect.bottom - 1); - int yellowPos = CalcPos(rect, GetMinValue(), GetMaxValue(), GetYellowValue()); - dc->MoveTo(yellowPos, rect.top); - dc->LineTo(yellowPos, rect.bottom - 1); + int theYellow = CalcPos(rect, GetMinValue(), GetMaxValue(), GetYellowValue()); + dc->MoveTo(theYellow, rect.top); + dc->LineTo(theYellow, rect.bottom - 1); dc->MoveTo(rect.left, rect.top); dc->LineTo(rect.left, rect.bottom - 1); @@ -57,19 +57,19 @@ void T2DlgItemGageBase::DrawBorderLines(CDC* dc, const CRect& rect) { dc->LineTo(rect.right - 1, rect.top); dc->LineTo(rect.left, rect.top); - dc->SelectObject(prevPen); + dc->SelectObject(oldPenH); } -void T2DlgItemGageBase::DrawValueByText(CDC* dc, const CRect& rect) { - CRect smallerRect = rect; - smallerRect.DeflateRect(2, 0); +void T2DlgItemGageBase::DrawValueByText(CDC* dc, const CRect& inRect) { + CRect theFrameRect = inRect; + theFrameRect.DeflateRect(2, 0); - CString text; - text.Format("%d", GetValue()); + CString theString; + theString.Format("%d", GetValue()); - CFont font; - font.CreateFont( - -(rect.Height() - 4), + CFont theFont; + theFont.CreateFont( + -(inRect.Height() - 4), 0, 0, 0, @@ -85,22 +85,22 @@ void T2DlgItemGageBase::DrawValueByText(CDC* dc, const CRect& rect) { "Arial" ); - HFONT prevFont = *dc->SelectObject(&font); + HFONT theOldFont = *dc->SelectObject(&theFont); dc->SetBkMode(TRANSPARENT); dc->SetTextColor(PALETTERGB(255, 255, 255)); for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { - CRect shadowRect = smallerRect; + CRect shadowRect = theFrameRect; shadowRect.OffsetRect(x, y); - dc->DrawText(text, shadowRect, DT_RIGHT | DT_VCENTER | DT_SINGLELINE); + dc->DrawText(theString, shadowRect, DT_RIGHT | DT_VCENTER | DT_SINGLELINE); } } - CRect textRect = smallerRect; + CRect textRect = theFrameRect; dc->SetTextColor(PALETTEINDEX(255)); - dc->DrawText(text, textRect, DT_RIGHT | DT_VCENTER | DT_SINGLELINE); + dc->DrawText(theString, textRect, DT_RIGHT | DT_VCENTER | DT_SINGLELINE); - dc->SelectObject(prevFont); + dc->SelectObject(theOldFont); } int T2DlgItemGageBase::CalcPos(const CRect& rect, int minValue, int maxValue, int value) { |