SIZE CUIComboBox::EstimateSize(SIZE /*szAvailable*/) { SIZE sz = { 0, 12 + m_pManager->GetThemeFontInfo(UIFONT_NORMAL).tmHeight }; // Once there is an element in the list, we'll use the first one to // determine the size of the dropdown base control. if( m_cxyFixed.cx > 0 && !m_items.IsEmpty() ) { RECT rcText = m_rcItem; ::InflateRect(&rcText, -4, -2); sz = static_cast<CUIControl*>(m_items[0])->EstimateSize(CUISize(rcText.right - rcText.left, 0)); } return sz; }
CUIComboBox::CUIComboBox() : m_iCurSel(-1), m_uButtonState(0) { m_szDropBox = CUISize(0, 150); m_pWindow = NULL; ::ZeroMemory(&m_rcButton, sizeof(RECT)); m_pImageOwner = NULL; m_nItemHeight = 10; m_bIsHasVScroll = false; m_nDropBoxHeight = 150; }
CUILabel::CUILabel() : m_nLinks(0), m_cxWidth(0), m_uTextStyle(DT_SINGLELINE | DT_VCENTER), m_TextColor(RGB(0, 0, 0)), m_TextColor_Disable(RGB(0xA7, 0xA6, 0xAA)), m_BackColor(INVALID__UICOLOR), m_BorderColorInside(INVALID__UICOLOR), m_BorderColorOutside(INVALID__UICOLOR), m_nImageWidth(0), m_nIndex(0), m_nImageCount(1), m_nInterval(100), m_bImageAsLinker(false), m_fAlpha(1.0), m_nDelayTime(0), m_nCurLink(-1) { m_pImageOwner = NULL; m_sizeAnimate = CUISize(0, 0); ::ZeroMemory(m_rcLinks, sizeof(m_rcLinks)); }
SIZE CUILabel::EstimateSize(SIZE /*szAvailable*/) { return CUISize(m_cxWidth, m_pManager->GetThemeFontInfo(UIFONT_NORMAL).tmHeight + 4); }
SIZE CUILabelLine::EstimateSize(SIZE /*szAvailable*/) { return CUISize(m_rcItem.right - m_rcItem.left, 2); }
SIZE CUIButton::EstimateSize(SIZE szAvailable) { if(m_cxyFixed.cy == 0) return CUISize(m_cxyFixed.cx, CResourceMgr::GetInstance().GetFontHeight(m_strFontName) + 8); return CUIControl::EstimateSize(szAvailable); }