Counter Strike : Global Offensive Source Code
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.

41 lines
1.1 KiB

  1. //
  2. // mxToolKit (c) 1999 by Mete Ciragan
  3. //
  4. // file: mxToolTip.cpp
  5. // implementation: Win32 API
  6. // last modified: Mar 14 1999, Mete Ciragan
  7. // copyright: The programs and associated files contained in this
  8. // distribution were developed by Mete Ciragan. The programs
  9. // are not in the public domain, but they are freely
  10. // distributable without licensing fees. These programs are
  11. // provided without guarantee or warrantee expressed or
  12. // implied.
  13. //
  14. #include "mxtk/mxToolTip.h"
  15. #include "mxtk/mxWidget.h"
  16. #include <windows.h>
  17. #include <commctrl.h>
  18. HWND mx_CreateToolTipControl (void);
  19. void
  20. mxToolTip::add (mxWidget *widget, const char *text)
  21. {
  22. if (!widget)
  23. return;
  24. TOOLINFO ti;
  25. memset (&ti, 0, sizeof (TOOLINFO));
  26. ti.cbSize = sizeof (TOOLINFO);
  27. ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
  28. ti.uId = (UINT) (HWND) widget->getHandle ();
  29. ti.lpszText = (LPTSTR) text;
  30. HWND ctrl = mx_CreateToolTipControl ();
  31. SendMessage (ctrl, TTM_ADDTOOL, 0, (LPARAM) &ti);
  32. }