本文整理汇总了C++中TextObject::GetUnicode方法的典型用法代码示例。如果您正苦于以下问题:C++ TextObject::GetUnicode方法的具体用法?C++ TextObject::GetUnicode怎么用?C++ TextObject::GetUnicode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextObject
的用法示例。
在下文中一共展示了TextObject::GetUnicode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool Gwen::Utility::Strings::Wildcard( const TextObject& strWildcard, const TextObject& strHaystack )
{
const UnicodeString& W = strWildcard.GetUnicode();
const UnicodeString& H = strHaystack.GetUnicode();
if ( strWildcard == "*" ) return true;
int iPos = W.find( L"*", 0 );
if ( iPos == UnicodeString::npos ) return strWildcard == strHaystack;
// First half matches
if ( iPos > 0 && W.substr( 0, iPos ) != H.substr( 0, iPos ) )
return false;
// Second half matches
if ( iPos != W.length()-1 )
{
UnicodeString strEnd = W.substr( iPos+1, W.length() );
if ( strEnd != H.substr( H.length() - strEnd.length(), H.length() ) )
return false;
}
return true;
}
示例2: SetImage
void Button::SetImage( const TextObject & strName, bool bCenter )
{
if ( strName.GetUnicode() == L"" )
{
if ( m_Image )
{
delete m_Image;
m_Image = NULL;
}
return;
}
if ( !m_Image )
{
m_Image = new ImagePanel( this );
}
m_Image->SetImage( strName );
m_Image->SizeToContents();
m_Image->SetMargin( Margin( 2, 0, 2, 0 ) );
m_bCenterImage = bCenter;
// Ugh.
Padding padding = GetTextPadding();
padding.left = m_Image->Right() + 2;
SetTextPadding( padding );
}
示例3: SetString
void Text::SetString( const TextObject& str )
{
if ( m_String == str ) return;
m_String = str.GetUnicode();
m_bTextChanged = true;
Invalidate();
}
示例4: SetAccelerator
void MenuItem::SetAccelerator( const TextObject& strAccelerator )
{
if ( m_Accelerator )
{
m_Accelerator->DelayedDelete();
m_Accelerator = NULL;
}
#ifndef GWEN_NO_UNICODE
if ( strAccelerator.GetUnicode() == L"" )
return;
#else
if ( strAccelerator.Get() == "" )
return;
#endif
m_Accelerator = new Controls::Label( this );
m_Accelerator->Dock( Pos::Right );
m_Accelerator->SetAlignment( Pos::Right | Pos::CenterV );
m_Accelerator->SetText( strAccelerator );
m_Accelerator->SetMargin( Margin( 0, 0, 16, 0 ) );
// TODO.
}