Ejemplo n.º 1
0
	void CSliderUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
	{
		if( _tcscmp(pstrName, _T("thumbimage")) == 0 ) SetThumbImage(pstrValue);
		else if( _tcscmp(pstrName, _T("thumbhotimage")) == 0 ) SetThumbHotImage(pstrValue);
		else if( _tcscmp(pstrName, _T("thumbpushedimage")) == 0 ) SetThumbPushedImage(pstrValue);
		else if( _tcscmp(pstrName, _T("thumbsize")) == 0 ) {
			SIZE szXY = {0};
			LPTSTR pstr = NULL;
			szXY.cx = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
			szXY.cy = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr); 
			SetThumbSize(szXY);
		}
		else if( _tcscmp(pstrName, _T("step")) == 0 )
		{
			SetChangeStep(_ttoi(pstrValue));
		}
		else if ( _tcscmp(pstrName, _T("frontimage")) == 0 )
		{
			SetFrontImage(pstrValue);
		}
		else if ( _tcscmp(pstrName, _T("spectrumimage")) == 0 )
		{
			SetSpectrumImage(pstrValue);
		}
		else CProgressUI::SetAttribute(pstrName, pstrValue);
	}
Ejemplo n.º 2
0
void ZSlider::SetAttribute(const char* pstrName, const char* pstrValue)
{
    if( strcmp(pstrName, "thumbimage") == 0 ) SetThumbImage(pstrValue);
    else if( strcmp(pstrName, "thumbhotimage") == 0 ) SetThumbHotImage(pstrValue);
    else if( strcmp(pstrName, "thumbpushedimage") == 0 ) SetThumbPushedImage(pstrValue);
    else if( strcmp(pstrName, "thumbsize") == 0 ) {
        SIZE szXY = {0};
        char* pstr = NULL;
        szXY.cx = strtol(pstrValue, &pstr, 10);   assert(pstr);    
        szXY.cy = strtol(pstr + 1, &pstr, 10);    assert(pstr); 
        SetThumbSize(szXY);
    }
    else if( strcmp(pstrName, "step") == 0 ) {
        SetChangeStep(atoi(pstrValue));
    }
    else ZProgress::SetAttribute(pstrName, pstrValue);
}