本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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();
}
示例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;
}
示例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);
}
}