#include "StdAfx.h" #include "T2DlgItemProgress.h" T2DlgItemProgress::T2DlgItemProgress(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalette* inPalette) : T2DlgItem(inDoc, inImageObj, inPalette) , mSubItem(NULL) { } /*virtual*/ T2DlgItemProgress::~T2DlgItemProgress() { delete mSubItem; } /*virtual*/ void T2DlgItemProgress::SetFont(HFONT inFont) { T2DlgItem::SetFont(inFont); if (mSubItem) mSubItem->SetFont(CFont::FromHandle(inFont)); } /*virtual*/ void T2DlgItemProgress::CreateSubItem() { mSubItem = new CProgressCtrl; CRect rect; GetClientRect(rect); mSubItem->Create(WS_VISIBLE | WS_CHILD, rect, this, 0); } /*virtual*/ void T2DlgItemProgress::SetRange(int inLower, int inUpper) { if (mSubItem) mSubItem->SetRange(inLower, inUpper); } /*virtual*/ int T2DlgItemProgress::SetPos(int inPos) { int result; if (mSubItem) result = mSubItem->SetPos(inPos); else result = 0; return result; } /*virtual*/ int T2DlgItemProgress::OffsetPos(int inOffset) { int result; if (mSubItem) result = mSubItem->OffsetPos(inOffset); else result = 0; return result; } /*virtual*/ int T2DlgItemProgress::SetStep(int inStep) { int result; if (mSubItem) result = mSubItem->SetStep(inStep); else result = 0; return result; } /*virtual*/ int T2DlgItemProgress::StepIt() { int result; if (mSubItem) result = mSubItem->StepIt(); else result = 0; return result; }