TOOLTIP.H (1999B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 // ToolTip.h 17 18 #ifdef WOLAPI_INTEGRATION 19 20 #ifndef TOOLTIP_H 21 #define TOOLTIP_H 22 23 #include "Gadget.h" 24 25 #define TOOLTIPTEXT_MAX_LEN 100 26 27 #define TOOLTIPDELAY 400 // Milliseconds 28 29 class ToolTipClass 30 { 31 public: 32 ToolTipClass( GadgetClass* pGadget, const char* szText, int xShow, int yShow, bool bRightAlign = false, bool bIconList = false ); 33 ~ToolTipClass() 34 { 35 delete [] pSaveRect; 36 } 37 38 ToolTipClass* GetToolTipHit(); 39 void Show(); 40 void Unshow(); 41 void Move( int xShow, int yShow ); 42 bool bOverDifferentLine() const; 43 44 ToolTipClass* next; // Next tooltip in list of which *this is a part. 45 46 GadgetClass* pGadget; // Gadget to which this tooltip is bound. 47 48 bool bRightAlign; 49 50 bool bShowing; 51 bool bIconList; // True if gadget is iconlist and line-specific tooltips are to be used. 52 53 protected: 54 bool bGadgetHit() const; 55 56 int xShow; 57 int yShow; 58 int wShow; 59 int hShow; 60 char szTip[ TOOLTIPTEXT_MAX_LEN + 1 ]; // Text to show as tip. 61 62 char* pSaveRect; 63 64 // Used only if bIconList. 65 int iLastIconListIndex; 66 bool bLastShowNoText; 67 int xLastShow; 68 int yLastShow; 69 int wLastShow; 70 }; 71 72 #endif 73 74 #endif