Esempio n. 1
0
void TBEditField::SetAdaptToContentSize(bool adapt)
{
	if (m_adapt_to_content_size == adapt)
		return;
	m_adapt_to_content_size = adapt;
	UpdateScrollbarVisibility(GetMultiline());
}
Esempio n. 2
0
bool TBEditField::GetCustomSkinCondition(const TBSkinCondition::CONDITION_INFO &info)
{
    if (info.custom_prop == TBIDC("edit-type"))
    {
        switch (m_edit_type)
        {
        case EDIT_TYPE_TEXT:
            return info.value == TBIDC("text");
        case EDIT_TYPE_SEARCH:
            return info.value == TBIDC("search");
        case EDIT_TYPE_PASSWORD:
            return info.value == TBIDC("password");
        case EDIT_TYPE_EMAIL:
            return info.value == TBIDC("email");
        case EDIT_TYPE_PHONE:
            return info.value == TBIDC("phone");
        case EDIT_TYPE_URL:
            return info.value == TBIDC("url");
        case EDIT_TYPE_NUMBER:
            return info.value == TBIDC("number");
        };
    }
    else if (info.custom_prop == TBIDC("multiline"))
        return !((uint32)info.value) == !GetMultiline();
    else if (info.custom_prop == TBIDC("readonly"))
        return !((uint32)info.value) == !GetReadOnly();
    return false;
}
Esempio n. 3
0
void TBEditField::SetMultiline(bool multiline)
{
	if (multiline == GetMultiline())
		return;
	UpdateScrollbarVisibility(multiline);
	m_style_edit.SetMultiline(multiline);
	SetWrapping(multiline);
	InvalidateSkinStates();
	TBWidget::Invalidate();
}
Esempio n. 4
0
TextBlock * TextBlock::Clone()
{
    TextBlock *block = new TextBlock();

    block->SetRectSize(rectSize);
    block->SetMultiline(GetMultiline(), GetMultilineBySymbol());
    block->SetAlign(GetAlign());
    block->SetFittingOption(fittingType);
    
    if (GetFont())
    {
        block->SetFont(GetFont());
    }
    block->SetText(GetText(), requestedSize);
    
    return block;
}