Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.2 KiB

  1. <PUBLIC:COMPONENT lightweight >
  2. <PUBLIC:PROPERTY name=ttText />
  3. <PUBLIC:PROPERTY name=ttWidth />
  4. <PUBLIC:PROPERTY name=ttDelay />
  5. <PUBLIC:METHOD name=ShowPopup />
  6. <PUBLIC:ATTACH event=onfocus onevent="onFocus();" />
  7. <PUBLIC:ATTACH event=onblur onevent="onBlur();" />
  8. <PUBLIC:ATTACH event=onmousemove onevent="onMouseMove();" />
  9. <PUBLIC:ATTACH event=onmouseout onevent="onMouseOut();" />
  10. <PUBLIC:ATTACH event=onclick onevent="onClick();" />
  11. </PUBLIC:COMPONENT lightweight >
  12. <SCRIPT language="JavaScript">
  13. if (!ttDelay) ttDelay = 250;
  14. var _tidDelay = null;
  15. function onFocus()
  16. {
  17. KillDelay();
  18. _tidDelay = window.setTimeout(uniqueID+".ShowPopup();", ttDelay);
  19. }
  20. function onBlur()
  21. {
  22. KillDelay();
  23. top.window.HidePopup();
  24. }
  25. function onMouseMove()
  26. {
  27. if (window.document.hasFocus())
  28. onFocus();
  29. }
  30. function onMouseOut()
  31. {
  32. if (!this.contains(event.toElement))
  33. onBlur();
  34. }
  35. function onClick()
  36. {
  37. ShowPopup();
  38. event.returnValue = false;
  39. }
  40. function ShowPopup()
  41. {
  42. KillDelay();
  43. top.window.ShowPopup(ttText, element, ttWidth);
  44. }
  45. function KillDelay()
  46. {
  47. if (_tidDelay)
  48. {
  49. window.clearInterval(_tidDelay);
  50. _tidDelay = null;
  51. }
  52. }
  53. </SCRIPT>