Exemplo n.º 1
0
void CMySlider::OnInitialUpdate()
{
	// Called automatically via AttachDlgItem

	// Set a tic mark every ten units for the slider control
	SetTicFreq(10);
}
Exemplo n.º 2
0
void CSkinSliderCtrl::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue )
{
	ISkinControl::SetAttribute(pstrName,pstrValue);

	if( _tcscmp(pstrName, _T("bkimage")) == 0 ) 
	{
		SetBackImage(pstrValue);
	}
	else if( _tcscmp(pstrName, _T("thumimage")) == 0 ) 
	{
		SetThumImage(pstrValue);
	}
	else if( _tcscmp(pstrName, _T("buttonimage")) == 0 ) 
	{
		SetButtonImage(pstrValue);
	}
	else if( _tcscmp(pstrName, _T("traceimage")) == 0 ) 
	{
		SetTraceImage(pstrValue);
	}
	else if( _tcscmp(pstrName, _T("disimage")) == 0 ) 
	{
		SetDisImage(pstrValue);
	}
	else if( _tcscmp(pstrName, _T("arrowAimage")) == 0 ) 
	{
		SetArrowAImage(pstrValue);
	}	
	else if( _tcscmp(pstrName, _T("arrowBimage")) == 0 ) 
	{
		SetArrowBImage(pstrValue);
	}	
	else if( _tcscmp(pstrName, _T("range")) == 0 ) 
	{
		LPTSTR pstr = NULL;
		int cx = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
		int cy = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr); 

		SetRange(cx,cy);
	}
	else if( _tcscmp(pstrName, _T("vertical")) == 0 ) 
	{
		if( _tcscmp(pstrValue, _T("true")) == 0 ) ModifyStyle(0,TBS_VERT);
	}
	else if( _tcscmp(pstrName, _T("value")) == 0 ) 
	{
		SetPos(_ttoi(pstrValue));
	}
	else if( _tcscmp(pstrName, _T("tic")) == 0 ) 
	{
		SetTic(_ttoi(pstrValue));
	}
	else if( _tcscmp(pstrName, _T("ticfreq")) == 0 ) 
	{
		SetTicFreq(_ttoi(pstrValue));
	}
}