TOOLTIP.H 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // ToolTip.h
  19. #ifdef WOLAPI_INTEGRATION
  20. #ifndef TOOLTIP_H
  21. #define TOOLTIP_H
  22. #include "Gadget.h"
  23. #define TOOLTIPTEXT_MAX_LEN 100
  24. #define TOOLTIPDELAY 400 // Milliseconds
  25. class ToolTipClass
  26. {
  27. public:
  28. ToolTipClass( GadgetClass* pGadget, const char* szText, int xShow, int yShow, bool bRightAlign = false, bool bIconList = false );
  29. ~ToolTipClass()
  30. {
  31. delete [] pSaveRect;
  32. }
  33. ToolTipClass* GetToolTipHit();
  34. void Show();
  35. void Unshow();
  36. void Move( int xShow, int yShow );
  37. bool bOverDifferentLine() const;
  38. ToolTipClass* next; // Next tooltip in list of which *this is a part.
  39. GadgetClass* pGadget; // Gadget to which this tooltip is bound.
  40. bool bRightAlign;
  41. bool bShowing;
  42. bool bIconList; // True if gadget is iconlist and line-specific tooltips are to be used.
  43. protected:
  44. bool bGadgetHit() const;
  45. int xShow;
  46. int yShow;
  47. int wShow;
  48. int hShow;
  49. char szTip[ TOOLTIPTEXT_MAX_LEN + 1 ]; // Text to show as tip.
  50. char* pSaveRect;
  51. // Used only if bIconList.
  52. int iLastIconListIndex;
  53. bool bLastShowNoText;
  54. int xLastShow;
  55. int yLastShow;
  56. int wLastShow;
  57. };
  58. #endif
  59. #endif