CDuiSlider::CDuiSlider(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, int nProgress/* = 0*/, 
					 BOOL bIsVisible/* = TRUE*/, BOOL bIsDisable/* = FALSE*/)
	: CControlBaseFont(hWnd, pDuiObject, uControlID, rc, TEXT(""), bIsVisible, bIsDisable)
{
	m_bHover = false;
	m_enButtonState = enBSNormal;

	m_bRunTime = false;
	m_nMaxProgress = 100;

	SetBitmapCount(2);

	m_pImageBackGround = NULL;
	m_sizeBackGround = CSize(0, 0);
	m_pImageForeGround = NULL;
	m_sizeForeGround = CSize(0, 0);
	m_pImageThumb = NULL;
	m_sizeThumb = CSize(0, 0);
	m_nSliderHeight = 0;
	m_nThumbWidth = 0;
	m_nThumbHeight = 0;
	m_nThumbTop = 0;
	m_nHeadLength = 0;
	m_rcThumb = CRect(0, 0, 0, 0);

	m_clrText = Color(254, 128, 128, 128);
	m_uAlignment = Align_Center;
	m_uVAlignment = VAlign_Middle;
	m_bShowText = FALSE;

	m_nProgress = 0;
	SetProgress(nProgress);
}
Exemple #2
0
CDuiTabCtrl::CDuiTabCtrl(HWND hWnd, CDuiObject* pDuiObject)
	: CControlBaseFont(hWnd, pDuiObject)
{
	m_pImageSeperator = NULL;
	m_pImageHover = NULL;
	m_pImageTabBtn = NULL;
	m_nHoverItem = 0;
	m_nDownItem = 0;
	m_nOldItem = -1;
	m_nTabItemWidth = 0;
	m_nTabItemMaxWidth = 0;
	m_nTabItemMinWidth = 0;
	m_nTabCtrlHeight = 0;
	m_uAlignment = Align_Center;
	m_uVAlignment = VAlign_Middle;
	m_clrText = Color(225, 255, 255, 255);
	m_clrTextHover = Color(0, 0, 0, 0);
	m_clrTextDown = Color(0, 0, 0, 0);
	m_bAnimateChangeTab = FALSE;
	m_nAnimateCount = 10;
	m_nCurXPos = 0;
	m_nTabLeftPading = 0;
	m_nTabRightPading = 0;
	m_posTabBtn.nCount = 0;
	m_enTabImageMode = enTIMNormal;
	SetBitmapCount(3);	// tab页签图片默认是3种状态的图片
	m_nWLT = 0;
	m_nHLT = 0;
	m_nWRB = 0;
	m_nHRB = 0;
	m_bTabTooltip = TRUE;
	m_nTipItem = -1;
	m_bInit = FALSE;
}
CDuiSlider::CDuiSlider(HWND hWnd, CDuiObject* pDuiObject)
	: CControlBaseFont(hWnd, pDuiObject)
{
	m_bHover = false;
	m_enButtonState = enBSNormal;

	m_bRunTime = false;
	m_nMaxProgress = 100;

	SetBitmapCount(2);

	m_pImageBackGround = NULL;
	m_sizeBackGround = CSize(0, 0);
	m_pImageForeGround = NULL;
	m_sizeForeGround = CSize(0, 0);
	m_pImageThumb = NULL;
	m_sizeThumb = CSize(0, 0);
	m_nSliderHeight = 0;
	m_nThumbWidth = 0;
	m_nThumbHeight = 0;
	m_nThumbTop = 0;
	m_nHeadLength = 0;
	m_rcThumb = CRect(0, 0, 0, 0);

	m_clrText = Color(254, 128, 128, 128);
	m_uAlignment = Align_Center;
	m_uVAlignment = VAlign_Middle;
	m_bShowText = FALSE;

	m_nProgress = 0;
	SetProgress(0);
}
Exemple #4
0
CDuiTabCtrl::CDuiTabCtrl(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, CString strTitle/*= TEXT("")*/, BOOL bIsVisible/* = TRUE*/, 
						   BOOL bIsDisable/* = FALSE*/ ,BOOL bIsPressDown/* = FALSE*/)
	: CControlBaseFont(hWnd, pDuiObject, uControlID, rc, strTitle, bIsVisible, bIsDisable)
{
	m_pImageSeperator = NULL;
	m_pImageHover = NULL;
	m_pImageTabBtn = NULL;
	m_nHoverItem = 0;
	m_nDownItem = 0;
	m_nOldItem = -1;
	m_nTabItemWidth = 0;
	m_nTabItemMaxWidth = 0;
	m_nTabItemMinWidth = 0;
	m_nTabCtrlHeight = 0;
	m_uAlignment = Align_Center;
	m_uVAlignment = VAlign_Middle;
	m_clrText = Color(225, 255, 255, 255);
	m_clrTextHover = Color(0, 0, 0, 0);
	m_clrTextDown = Color(0, 0, 0, 0);
	m_bAnimateChangeTab = FALSE;
	m_nAnimateCount = 10;
	m_nCurXPos = 0;
	m_nTabLeftPading = 0;
	m_nTabRightPading = 0;
	m_posTabBtn.nCount = 0;
	m_enTabImageMode = enTIMNormal;
	SetBitmapCount(3);	// tab页签图片默认是3种状态的图片
	m_nWLT = 0;
	m_nHLT = 0;
	m_nWRB = 0;
	m_nHRB = 0;
	m_bTabTooltip = TRUE;
	m_nTipItem = -1;
	m_bInit = FALSE;
}
Exemple #5
0
CDuiAnimateImage::CDuiAnimateImage(HWND hWnd, CDuiObject* pDuiObject)
	: CControlBaseFont(hWnd, pDuiObject)
{
	m_bRunTime = false;
	m_nIndex = 0;
	m_nMaxIndex = 10;
	m_nCount = 0;
	m_nTimerCount = 5;
	SetBitmapCount(m_nMaxIndex);
}
Exemple #6
0
CDuiAnimateImage::CDuiAnimateImage(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, 
				 UINT uAlignment/* = DT_CENTER*/, UINT uVAlignment/* = DT_VCENTER*/, BOOL bIsVisible/* = TRUE*/, BOOL bIsDisable/* = FALSE*/)
	: CControlBaseFont(hWnd, pDuiObject, uControlID, rc, TEXT(""), bIsVisible, bIsDisable)
{
	m_bRunTime = false;
	m_nIndex = 0;
	m_nMaxIndex = 10;
	m_nCount = 0;
	m_nTimerCount = 5;
	SetBitmapCount(m_nMaxIndex);
}
Exemple #7
0
// ´ÓXMLÉèÖÃͼƬÑÚÂëÐÅÏ¢ÊôÐÔ
HRESULT CImageString::OnAttributeMask(const CString& strValue, BOOL bLoading)
{
	if (strValue.IsEmpty()) return E_FAIL;

	m_strMask = strValue;
	SetBitmapCount(m_strMask.GetLength());

	m_sizeImage.SetSize(m_pImage->GetWidth() / m_nImagePicCount, m_pImage->GetHeight());
	UpdateControl(true);

	return bLoading?S_FALSE:S_OK;
}
Exemple #8
0
// 从XML设置图片个数属性
HRESULT CDuiAnimateImage::OnAttributeMaxIndex(const CString& strValue, BOOL bLoading)
{
	if (strValue.IsEmpty() || (m_pImage == NULL)) return E_FAIL;

	m_nMaxIndex = _ttoi(strValue);
	SetBitmapCount(m_nMaxIndex);

	m_sizeImage.SetSize(m_pImage->GetWidth() / m_nImagePicCount, m_pImage->GetHeight());
	UpdateControl(true);

	return bLoading?S_FALSE:S_OK;
}
Exemple #9
0
CCheckButton::CCheckButton(HWND hWnd, CDuiObject* pDuiObject)
						   : CControlBaseFont(hWnd, pDuiObject)
{
	m_bTabStop = TRUE;	// 可以响应tab键
	m_bIsFocus = FALSE;
	m_enButtonState = enBSNormal;
	m_pImage = NULL;
	m_bDown = false;
	m_bMouseDown = false;
	m_uVAlignment = DT_VCENTER;
	m_clrText = Color(254, 0, 0, 0);
	SetBitmapCount(6);
}
Exemple #10
0
CCheckButton::CCheckButton(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, CString strTitle/*= TEXT("")*/, BOOL bIsVisible/* = TRUE*/, 
						   BOOL bIsDisable/* = FALSE*/ ,BOOL bIsPressDown/* = FALSE*/)
						   : CControlBaseFont(hWnd, pDuiObject, uControlID, rc, strTitle, bIsVisible, bIsDisable)
{
	m_bTabStop = TRUE;	// 可以响应tab键
	m_bIsFocus = FALSE;
	m_enButtonState = enBSNormal;
	m_pImage = NULL;
	m_bDown = false;
	m_bMouseDown = false;
	m_uVAlignment = DT_VCENTER;
	m_clrText = Color(254, 0, 0, 0);
	SetBitmapCount(6);
}
Exemple #11
0
CDuiRadioButton::CDuiRadioButton(HWND hWnd, CDuiObject* pDuiObject)
						   : CControlBaseFont(hWnd, pDuiObject)
{
	m_bTabStop = TRUE;	// 可以响应tab键
	m_bIsFocus = FALSE;
	m_bShowFocus = TRUE;
	m_enButtonState = enBSNormal;
	m_pImage = NULL;
	m_bDown = false;
	m_bMouseDown = false;
	m_uVAlignment = VAlign_Middle;
	m_clrText = Color(254, 0, 0, 0);
	m_strGroupName = _T("");
	m_strValue = _T("");
	SetBitmapCount(6);
}
Exemple #12
0
CDuiEdit::CDuiEdit(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, CString strTitle/* = ""*/,
			BOOL bPassWord/* = FALSE*/, BOOL bIsVisible/* = TRUE*/, BOOL bIsDisable/* = FALSE*/ ,BOOL bIsPressDown/* = FALSE*/)
		: CControlBaseFont(hWnd, pDuiObject, uControlID, rc, strTitle, bIsVisible, bIsDisable)
{
	m_bTabStop = TRUE;	// 可以响应tab键
	m_bDown = false;
	m_bDownTemp = false;
	m_buttonState = enBSNormal;
	m_EditState = enBSNormal;
	m_pLeftImage = NULL;
	m_pSmallImage = NULL;
	m_pEdit = NULL;
	m_bPassWord = bPassWord;
	m_strTitle = strTitle;

	m_sizeLeftImage.SetSize(0,0);
	m_sizeSmallImage.SetSize(0,0);

	SetRect(rc);
	SetBitmapCount(4);

	m_bMultiLine = false;
	m_bAutoHScroll = false;
	m_bAutoVScroll = false;
	m_bNumber = false;
	m_bReadOnly = false;
	m_nMaxChar = -1;

	m_bIsSmallButton = FALSE;

	VERIFY(m_fontTemp.CreateFont(
		18,							// 字体的高度  
		0,							// 字体的宽度  
		0,							// 字体显示的角度
		0,							// 字体的角度
		FW_DONTCARE,				// 字体的磅数
		FALSE,						// 斜体字体
		FALSE,						// 带下划线的字体
		0,							// 带删除线的字体
		GB2312_CHARSET,				// 所需的字符集
		OUT_DEFAULT_PRECIS,			// 输出的精度
		CLIP_DEFAULT_PRECIS,		// 裁减的精度
		DEFAULT_QUALITY,			// 逻辑字体与输出设备的实际
		DEFAULT_PITCH | FF_SWISS,	// 字体间距和字体集
		DuiSystem::GetDefaultFont()));					// 字体名称
}
Exemple #13
0
CDuiLayout::CDuiLayout(HWND hWnd, CDuiObject* pDuiObject)
	: CControlBaseFont(hWnd, pDuiObject)
{
	m_nLayoutType = LAYOUT_TYPE_HORIZONTAL;
	m_bInit = FALSE;
	m_bHover = false;
	m_nHoverSplit = -1;
	m_enButtonState = enBSNormal;

	m_bRunTime = false;

	SetBitmapCount(2);

	m_pImageSplit = NULL;
	m_sizeSplit = CSize(0, 0);
	m_pImageThumb = NULL;
	m_sizeThumb = CSize(0, 0);
	m_nSplitWidth = 0;
	m_bSplitImm = TRUE;
}
Exemple #14
0
CDuiLayout::CDuiLayout(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, int nProgress/* = 0*/, 
					 BOOL bIsVisible/* = TRUE*/, BOOL bIsDisable/* = FALSE*/)
	: CControlBaseFont(hWnd, pDuiObject, uControlID, rc, TEXT(""), bIsVisible, bIsDisable)
{
	m_nLayoutType = LAYOUT_TYPE_HORIZONTAL;
	m_bInit = FALSE;
	m_bHover = false;
	m_nHoverSplit = -1;
	m_enButtonState = enBSNormal;

	m_bRunTime = false;

	SetBitmapCount(2);

	m_pImageSplit = NULL;
	m_sizeSplit = CSize(0, 0);
	m_pImageThumb = NULL;
	m_sizeThumb = CSize(0, 0);
	m_nSplitWidth = 0;
	m_bSplitImm = TRUE;
}
Exemple #15
0
CDuiText::CDuiText(HWND hWnd, CDuiObject* pDuiObject)
		: CControlBaseFont(hWnd, pDuiObject)
{
	m_nScrollWidth = 8;

	CRect rcScroll = CRect(0,0,0,0);
	rcScroll.top;
	rcScroll.left = rcScroll.right - m_nScrollWidth;

 	CControlBase * pControlBase = NULL;
 	pControlBase = new CDuiScrollVertical(hWnd, this, SCROLL_V, rcScroll);
 	m_vecControl.push_back(pControlBase);
	m_pControScrollV = (CControlBaseFont*)pControlBase;
	m_bScrollV = FALSE;

	CRect rcBk = CRect(0,0,0,0);
	pControlBase = new CArea(hWnd, this, LISTBK_AREA, rcBk, 100, 100);
 	m_vecControl.push_back(pControlBase);
	m_pControBkArea = (CControlBase*)pControlBase;

	m_nBkTransparent = 0;

	m_enButtonState = enBSNormal;
	m_bEnableHover = FALSE;
	m_bEnableShadow = FALSE;
	m_bBack = false;
	m_clrBack = Color(0, 128, 0);
	m_clrText = Color(254, 0, 0, 0);
	m_clrTextHover = Color(128, 80, 80);
	m_clrTextShadow = Color(80, 80, 80);
	m_nStart = 0;
	m_clrMark = Color(237, 128, 27);

	m_nVirtualHeight = 0;

	SetBitmapCount(1);
}
Exemple #16
0
CDuiText::CDuiText(HWND hWnd, CDuiObject* pDuiObject, UINT uControlID, CRect rc, CString m_strTitle, Color clr/* = Color(0, 0, 0)*/,
				CString strFont, int nFontWidth/* = 12*/, FontStyle fontStyle/* = FontStyleRegular*/, BOOL bIsVisible/* = TRUE*/)
	: CControlBaseFont(hWnd, pDuiObject, uControlID, rc, m_strTitle, bIsVisible, FALSE, FALSE, strFont, nFontWidth, fontStyle)
{
	m_nScrollWidth = 8;

	CRect rcScroll = CRect(0,0,0,0);
	rcScroll.top;
	rcScroll.left = rcScroll.right - m_nScrollWidth;

 	CControlBase * pControlBase = NULL;
 	pControlBase = new CDuiScrollVertical(hWnd, this, SCROLL_V, rcScroll);
 	m_vecControl.push_back(pControlBase);
	m_pControScrollV = (CControlBaseFont*)pControlBase;
	m_bScrollV = FALSE;

	CRect rcBk = CRect(0,0,0,0);
	pControlBase = new CArea(hWnd, this, LISTBK_AREA, rcBk, 100, 100);
 	m_vecControl.push_back(pControlBase);
	m_pControBkArea = (CControlBase*)pControlBase;

	m_nBkTransparent = 0;

	m_enButtonState = enBSNormal;
	m_bEnableHover = FALSE;
	m_bEnableShadow = FALSE;
	m_bBack = false;
	m_clrBack = Color(0, 128, 0);
	m_clrText = clr;
	m_clrTextHover = Color(128, 80, 80);
	m_clrTextShadow = Color(80, 80, 80);
	m_nStart = 0;
	m_clrMark = Color(237, 128, 27);

	SetBitmapCount(1);
}