예제 #1
0
int CSkinProgress::SetStart(
	int nStart,
	BOOL bDisplay)
{
	if (IsWindow())
	{
		if (nStart > mnUpper)
		{
			nStart = mnUpper;
		}

		if (nStart < mnLower)
		{
			nStart = mnLower;
		}

		if (nStart > mnRight)
		{
			nStart = mnRight;
		}

		mnPrevLeft = mnLeft;
		mnLeft = nStart;

		if (bDisplay != false)
		{
			OnCalcPos();
		}

		return mnPrevLeft;
	}else
	{
		return 0;
	}
}
예제 #2
0
int CSkinProgress::StepIt(
	BOOL bDisplay) 
{ 
	if (IsWindow())
	{
		m_nPrevRight = mnRight;
		mnRight += mnStep;

		if (mnRight > mnUpper)
		{
			mnRight = mnUpper;
		}

		if (mnRight < mnLower)
		{
			mnRight = mnLower;
		}

		if (mnRight < mnLeft)
		{
			mnRight = mnLeft;
		}

		if (bDisplay != false)
		{
			OnCalcPos();
		}

		return m_nPrevRight;
	}else
	{
		return 0;
	}
}
예제 #3
0
int CSkinProgress::SetPos(
	int nPos,
	BOOL bDisplay)
{
	if (IsWindow())
	{
		if (nPos > mnUpper)
		{
			nPos = mnUpper;
		}

		if (nPos < mnLower)
		{
			nPos = mnLower;
		}

		if (nPos < mnLeft)
		{
			nPos = mnLeft;
		}

		m_nPrevRight = mnRight;
		mnRight = nPos;

		if (bDisplay != false)
		{
			OnCalcPos();
		}

		return m_nPrevRight;
	}else
	{
		return 0;
	}
}
예제 #4
0
BOOL CSkinProgress::SetRange(
	int nLower,
	int nUpper,
	int nStep,
	BOOL bResamble,
	BOOL bDisplay)
{
	if (IsWindow())
	{
		if(bResamble != false)
		{
			mnLeft = (int)((((LONGLONG)(mnLeft  - mnLower) * (nUpper - nLower)) / (mnUpper - mnLower) ) + nLower);
			mnPrevLeft  = mnLeft;
	
			mnRight = (int)((((LONGLONG)(mnRight - mnLower) * (nUpper - nLower)) / (mnUpper - mnLower)) + nLower);
			m_nPrevRight = mnRight;
		}

		mnLower = nLower;
		mnUpper = nUpper;
		mnStep = nStep;

		if(bDisplay != false)
		{
			OnCalcPos();
		}

		return true;
	}else
	{
		return false;
	}
}
예제 #5
0
int CSkinProgress::OffsetPos(
    int nOffset,
    BOOL bDisplay)
{
    if (IsWindow(m_hWnd))
    {
        m_nPrevRight = mnRight;
        mnRight += nOffset;

        if (mnRight > mnUpper)
        {
            mnRight = mnUpper;
        }

        if (mnRight < mnLower)
        {
            mnRight = mnLower;
        }

        if (mnRight < mnLeft)
        {
            mnRight = mnLeft;
        }

        if (bDisplay != false)
        {
            OnCalcPos();
        }

        return m_nPrevRight;
    } else
    {
        return 0;
    }
}
예제 #6
0
BOOL CSkinProgress::SetProgress(
	int nProgress,
	BOOL bDisplay)
{
	mnType = nProgress;

	if(bDisplay != false)
	{
		OnCalcPos();
	}

	return true;
}
예제 #7
0
BOOL CSkinProgress::SetSize(
	int i_nSize,
	BOOL i_bDisplay)
{
	if (i_nSize > 0)
	{
		i_nSize += 5;
	}else if(i_nSize < 0)
	{
		i_nSize -= 2;
	}

	mnSize = i_nSize;

	if(i_bDisplay != false)
	{
		OnCalcPos();
	}

	return true;
}
예제 #8
0
BOOL CSkinProgress::Init(
	CBitmap *pBmp,
	int nUpper,
	int nType,
	BOOL bReverse)
{
	mpBaseBmp = NULL;
	mpCompatibleBmp = NULL;
	mpStretchBmp = NULL;
	mpProgressBmp = NULL;
	mPaneRect.SetRect(0, 0, 0, 0);

	if (!SetBitmap(pBmp, false))
	{
		return false;
	}else
	{
		mnType = nType;

		mnLower = 0;
		mnUpper = nUpper;
		mnLeft = 0;
		mnRight = 0;

		SetRange(0, nUpper, 1, false ,false);

		mbReverse = bReverse;

		Reset(false);

		SetTimer((UINT)(ULONG_PTR) this, 500, NULL);

		OnCalcPos();

		return true;
	}
}
예제 #9
0
BOOL CSkinProgress::SetBitmap(
	CBitmap *pTempBitmap,
	BOOL bDisplay)
{ 
	BITMAP sBmpSrc;
	HBITMAP hOldBitmap;
	HBITMAP hOldStretch;
	CRect WndRect;
	CDC BmpDC;
	CDC StretchDC;

	mPaintRect.SetRect(0, 0, 0, 0);

	GetClientRect(&WndRect);

	CPaintDC PaintDC(m_hWnd);

	if (mpBaseBmp != NULL)
		delete mpBaseBmp;

	mpBaseBmp = new CBitmap;

	if (mpCompatibleBmp != NULL)
		delete mpCompatibleBmp;

	mpCompatibleBmp = new CBitmap;

	if (pTempBitmap == NULL)
		return FALSE;

	CopyBitmap(mpBaseBmp, pTempBitmap);

	ConvertBitmap(mpCompatibleBmp, mpBaseBmp, &PaintDC);

	mpCompatibleBmp->GetBitmap(&sBmpSrc);
	mnBmpWidth  = sBmpSrc.bmWidth / SKIN_PROGRESS_BITMAP_COUNT;
	mnBmpHeight = sBmpSrc.bmHeight;

	if (mpStretchBmp != NULL)
		delete mpStretchBmp;

	mpStretchBmp = new CBitmap;

	mpStretchBmp->CreateCompatibleBitmap(PaintDC, sBmpSrc.bmWidth, WndRect.Height() - 2);

	BmpDC.CreateCompatibleDC(PaintDC);
	hOldBitmap = BmpDC.SelectBitmap(*mpCompatibleBmp);

	StretchDC.CreateCompatibleDC(PaintDC);
	hOldStretch = StretchDC.SelectBitmap(*mpStretchBmp);

	StretchDC.SetStretchBltMode(HALFTONE);

	StretchDC.StretchBlt(0, 0, sBmpSrc.bmWidth, WndRect.Height() - 2, BmpDC, 0, 0, sBmpSrc.bmWidth, sBmpSrc.bmHeight, SRCCOPY);

	StretchDC.SelectBitmap(hOldStretch);
	StretchDC.DeleteDC();

	BmpDC.SelectBitmap(hOldBitmap);
	BmpDC.DeleteDC();

	mpStretchBmp->GetBitmap(&sBmpSrc);

	mnBmpWidth  = sBmpSrc.bmWidth / SKIN_PROGRESS_BITMAP_COUNT;
	mnBmpHeight = sBmpSrc.bmHeight;

	mBarImageList.Destroy();

	if(!mBarImageList.Create(mnBmpWidth, mnBmpHeight, ILC_COLOR32, 0, 0))
	{
		return false;
	}else
	{
		mBarImageList.Add(*mpStretchBmp, RGB(0, 255, 255));

		if (bDisplay != false)
		{
			OnCalcPos();
		}

		return true;
	}
}