当前位置: 首页>>代码示例>>C++>>正文


C++ ThumbInfo::PositionThumb方法代码示例

本文整理汇总了C++中ThumbInfo::PositionThumb方法的典型用法代码示例。如果您正苦于以下问题:C++ ThumbInfo::PositionThumb方法的具体用法?C++ ThumbInfo::PositionThumb怎么用?C++ ThumbInfo::PositionThumb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ThumbInfo的用法示例。


在下文中一共展示了ThumbInfo::PositionThumb方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadContact

static void LoadContact(MCONTACT hContact)
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (hContact == NULL)
		return;

	DWORD	dwPos = db_get_dw(hContact, MODULE, "ThumbsPos", (DWORD)-1);
	if (dwPos != -1) {
		TCHAR	*ptName = pcli->pfnGetContactDisplayName(hContact, 0);
		if (ptName != NULL) {
			int nX = DB_POS_GETX(dwPos);
			int nY = DB_POS_GETY(dwPos);

			CreateThumbWnd(ptName, hContact, nX, nY);
			pThumb->PositionThumb(nX, nY);
		}
	}
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:18,代码来源:main.cpp

示例2: LoadContact

static void LoadContact( HANDLE hContact )
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (hContact == NULL)
		return;

	DWORD	dwPos = db_get_dw( hContact, MODULE, "ThumbsPos", (DWORD)-1);
	if ( dwPos != -1) {
		TCHAR	*ptName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, (LPARAM)GCDNF_TCHAR);
		if ( ptName != NULL ) {
			int nX = DB_POS_GETX( dwPos );
			int nY = DB_POS_GETY( dwPos );

			CreateThumbWnd(ptName, hContact, nX, nY);
			pThumb->PositionThumb(nX, nY);
		}
	}
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:18,代码来源:main.cpp

示例3: CreateThumbWnd

static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY)
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb != NULL)
		return;

	// Prepare for window creation
	HWND hwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, WND_CLASS, ptszName, WS_POPUP, nX, nY, 50, 20, NULL, NULL, hInst, NULL);
	if (hwnd == NULL)
		return;

	pThumb = thumbList.AddThumb(hwnd, ptszName, hContact);
	SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pThumb);
	pThumb->ResizeThumb();

	pThumb->SetThumbOpacity(fcOpt.thumbAlpha);
	ShowWindow(hwnd, (fcOpt.bHideAll || HideOnFullScreen() || fcOpt.bHideOffline || (fcOpt.bHideWhenCListShow && bIsCListShow)) ? SW_HIDE : SW_SHOWNA);
	pThumb->PositionThumb(nX, nY);

	// force repaint
	pThumb->UpdateContent();
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:22,代码来源:main.cpp

示例4: OnContactDrag

static int OnContactDrag(WPARAM hContact, LPARAM)
{
	POINT pt;
	GetCursorPos(&pt);

	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb == NULL) {
		int idStatus = GetContactStatus(hContact);

		if (!fcOpt.bHideAll && !HideOnFullScreen() && (!fcOpt.bHideOffline || IsStatusVisible(idStatus)) && (!fcOpt.bHideWhenCListShow || !bIsCListShow)) {
			CreateThumbWnd(pcli->pfnGetContactDisplayName(hContact, 0), hContact, pt.x, pt.y);
			ThumbInfo *pNewThumb = thumbList.FindThumbByContact(hContact);
			ShowWindow(pNewThumb->hwnd, SW_SHOWNA);
			hNewContact = hContact;

			OnStatusChanged();
		}
	}
	else if (hContact == hNewContact)
		pThumb->PositionThumb(pt.x - 5, pt.y - 5);

	return hNewContact != NULL;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:23,代码来源:main.cpp

示例5: ResizeThumb

void ThumbInfo::ResizeThumb()
{
	int index = FLT_FONTID_NOTONLIST;

	himlMiranda = Clist_GetImageList();
	if (himlMiranda == nullptr)
		return;

	SIZEL sizeIcon;
	ImageList_GetIconSize_my(himlMiranda, sizeIcon);

	HDC hdc = GetWindowDC(hwnd);
	if (!db_get_b(hContact, "CList", "NotOnList", 0)) {
		char *szProto = GetContactProto(hContact);
		if (nullptr != szProto) {
			int nStatus = Proto_GetStatus(szProto);
			int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
			int nApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0);

			if ((nStatus == ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_ONLINE) ||
				(nStatus != ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_OFFLINE)) {
				if (ID_STATUS_OFFLINE == nContactStatus)
					index = FLT_FONTID_OFFINVIS;
				else
					index = FLT_FONTID_INVIS;
			}
			else if (ID_STATUS_OFFLINE == nContactStatus)
				index = FLT_FONTID_OFFLINE;
			else
				index = FLT_FONTID_CONTACTS;
		}
	}
	else index = FLT_FONTID_NOTONLIST;

	HFONT hOldFont = (HFONT)SelectObject(hdc, hFont[index]);

	// Get text and icon sizes
	SIZEL sizeText;
	GetTextExtentPoint32(hdc, ptszName, (int)mir_wstrlen(ptszName), &sizeText);

	SelectObject(hdc, hOldFont);

	// Transform text size
	POINT ptText;
	ptText.x = sizeText.cx;
	ptText.y = sizeText.cy;
	LPtoDP(hdc, &ptText, 1);

	szSize.cx = fcOpt.bFixedWidth ? fcOpt.nThumbWidth : sizeIcon.cx + ptText.x + 10;
	szSize.cy = ((sizeIcon.cy > ptText.y) ? sizeIcon.cy : ptText.y) + 4;

	SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, szSize.cx, szSize.cy, SWP_NOMOVE | SWP_NOACTIVATE);

	RefreshContactIcon(0xFFFFFFFF);

	ReleaseDC(hwnd, hdc);

	// Move the docked widnow if needed
	ThumbInfo *pNextThumb = thumbList.FindThumb(dockOpt.hwndRight);
	if (pNextThumb) {
		RECT rcThumb;
		GetThumbRect(&rcThumb);
		pNextThumb->PositionThumb(rcThumb.right, rcThumb.top);
	}
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:65,代码来源:thumbs.cpp


注:本文中的ThumbInfo::PositionThumb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。