Changeset 285 for trunk/src/3rdparty/os2/xsystray/xsystray.c
- Timestamp:
- Nov 3, 2009, 3:58:20 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/3rdparty/os2/xsystray/xsystray.c
r282 r285 735 735 * to left. 736 736 * 737 * NOTE: This function must be keept in sync with FindIconDataAtPt() in738 * terms of system tray geometry.737 * NOTE: This function must be keept in sync with FindIconDataAtPt() and 738 * SYSTRAYCMD_QUERYRECT in terms of system tray geometry. 739 739 */ 740 740 /* … … 1311 1311 } 1312 1312 1313 ++pSysTrayData->cIcons; 1314 1313 1315 WgtXSysTrayUpdateAfterIconAddRemove(pWidget); 1314 1315 ++pSysTrayData->cIcons;1316 1316 1317 1317 xrc = XST_OK; … … 1439 1439 } 1440 1440 1441 xrc = XST_OK; 1442 } 1443 else 1444 LOGF((" Icon not found!\n")); 1445 } 1446 break; 1447 1448 case SYSTRAYCMD_QUERYRECT: 1449 { 1450 size_t i; 1451 PICONDATA pData; 1452 1453 LOGF(("SYSTRAYCMD_QUERYRECT\n")); 1454 LOGF((" hwnd %x\n", pCtlData->hwndSender)); 1455 LOGF((" usId %d\n", pCtlData->u.icon.usId)); 1456 1457 pCtlData->bAcknowledged = TRUE; 1458 1459 pData = FindIconData(pSysTrayData, pCtlData->hwndSender, 1460 pCtlData->u.icon.usId, &i); 1461 if (pData) 1462 { 1463 // Refer to FindIconDataAtPt() for details 1464 1465 SWP swp; 1466 RECTL rcl; 1467 BOOL bLeftToRight; 1468 LONG y, lIconStep; 1469 1470 WinQueryWindowPos(pWidget->hwndWidget, &swp); 1471 WinQueryWindowRect(pWidget->pGlobals->hwndClient, &rcl); 1472 1473 y = (swp.cy - pSysTrayData->lIconHeight) / 2; 1474 1475 // detect the direction 1476 bLeftToRight = swp.x + swp.cx / 2 < (rcl.xRight / 2); 1477 1478 lIconStep = pSysTrayData->lIconWidth + pSysTrayData->lIconPad; 1479 1480 pCtlData->u.rect.rclIcon.yBottom = y; 1481 pCtlData->u.rect.rclIcon.yTop = y + pSysTrayData->lIconHeight; 1482 1483 if (bLeftToRight) 1484 { 1485 pCtlData->u.rect.rclIcon.xLeft = 1486 pSysTrayData->lIconPad + (lIconStep) * i; 1487 pCtlData->u.rect.rclIcon.xRight = 1488 pCtlData->u.rect.rclIcon.xLeft + 1489 pSysTrayData->lIconWidth; 1490 } 1491 else 1492 { 1493 pCtlData->u.rect.rclIcon.xLeft = 1494 swp.cx - (lIconStep) * (i + 1); 1495 pCtlData->u.rect.rclIcon.xRight = 1496 pCtlData->u.rect.rclIcon.xLeft + 1497 pSysTrayData->lIconWidth; 1498 } 1499 1500 // convert to screen coordinates 1501 WinMapWindowPoints(pWidget->hwndWidget, HWND_DESKTOP, 1502 (PPOINTL)&pCtlData->u.rect.rclIcon, 2); 1441 1503 xrc = XST_OK; 1442 1504 }
Note:
See TracChangeset
for help on using the changeset viewer.