Пример #1
0
void CSkinComboBox::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue )
{
	ISkinControl::SetAttribute(pstrName,pstrValue);
	LPTSTR pstr = NULL;

	if( _tcscmp(pstrName, _T("droplist")) == 0 ) 
	{
		if( _tcscmp(pstrValue, _T("true")) == 0 )
		{
			ModifyStyle(0,CBS_OWNERDRAWVARIABLE|CBS_HASSTRINGS);
			SetDropList();
		}
	}
	else if( _tcscmp(pstrName, _T("defaulttext")) == 0 )  SetDefaultText(pstrValue);
	else if( _tcscmp(pstrName, _T("arrownormalimg")) == 0 )  SetArrowNormalPic(pstrValue);	
	else if( _tcscmp(pstrName, _T("arrowhotimg")) == 0 )  SetArrowHotPic(pstrValue);	
	else if( _tcscmp(pstrName, _T("arrowpushimg")) == 0 )  SetArrowPushedPic(pstrValue);
	else if( _tcscmp(pstrName, _T("arrowwidth")) == 0 )  SetArrowWidth(_ttoi(pstrValue));	
	else if( _tcscmp(pstrName, _T("boxheight")) == 0 )  SetEditItemHeight(_ttoi(pstrValue)); 
	else if( _tcscmp(pstrName, _T("itemheight")) == 0 )  SetAllItemHeight(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, _T("textcolor")) == 0 ) 
	{
		if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
		SetEditTextColor( _tcstoul(pstrValue, &pstr, 16));
	}
	else if( _tcscmp(pstrName, _T("bkcolor")) == 0 ) 
	{
		if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
		m_SkinComboBoxEdit.m_colBack = _tcstoul(pstrValue, &pstr, 16);
	}
	else if( _tcscmp(pstrName, _T("format")) == 0 ) 
	{
		m_SkinComboBoxEdit.ModifyStyle(0,_ttoi(pstrValue));
	}
}
Пример #2
0
void CSkinEdit::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue )
{
	ISkinControl::SetAttribute(pstrName,pstrValue);

	if( _tcscmp(pstrName, _T("defaulttext")) == 0 )  
	{
		SetDefaultText(pstrValue);
		SetDefaultTextMode(TRUE);
	}
	else if( _tcscmp(pstrName, _T("iconimage")) == 0 )  
	{
		SetIconImage(pstrValue);
	}
	else if( _tcscmp(pstrName, _T("passwordchar")) == 0 )  
	{
		SetPasswordChar(pstrValue[0]);
	}
	else if( _tcscmp(pstrName, _T("clientpos")) == 0 )  
	{
		LPTSTR pstr = NULL;
		CPoint pt;
		pt.x = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
		pt.y = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr); 

		SetClientPoint(pt);
	}
	else if( _tcscmp(pstrName, _T("handcur")) == 0 )  
	{
		m_bHandCursor = _tcscmp(pstrValue, _T("true")) == 0;
	}
	else if( _tcscmp(pstrName, _T("scrollimage")) == 0 )  
	{
		SetScrollImage(this,pstrValue);
	}
	//else if( _tcscmp(pstrName, _T("multiline")) == 0 )  
	//{
	//	if( _tcscmp(pstrValue, _T("true")) == 0 )  
	//	//	//SetWindowLong(GetSafeHwnd(),GWL_STYLE,GetWindowLong(GetSafeHwnd(),GWL_STYLE)| ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL| WS_VSCROLL);
	//		ModifyStyle(ES_AUTOHSCROLL,ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL| WS_VSCROLL );
	//	//ModifyStyle(ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL| WS_VSCROLL,0);
	//}
}
Пример #3
0
//virtual 
void ON_Annotation::SetTextToDefault() { SetDefaultText( L""); }