CONTROL.H 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. ** Command & Conquer(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. /* $Header: F:\projects\c&c\vcs\code\control.h_v 2.18 16 Oct 1995 16:46:08 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : CONTROL.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : 01/15/95 *
  30. * *
  31. * Last Update : January 15, 1995 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef CONTROL_H
  37. #define CONTROL_H
  38. #include "gadget.h"
  39. /***************************************************************************
  40. * ControlClass -- Region tracking class *
  41. * *
  42. * INPUT: int x -- x position of gadget *
  43. * int y -- y position of gadget *
  44. * int w -- width of gadget *
  45. * int h -- height of gadget *
  46. * UWORD flags -- see enumeration choices *
  47. * *
  48. * OUTPUT: 0 = new scenario created, -1 = not *
  49. * WARNINGS: This class is Abstract (cannot make an instance of it) *
  50. * *
  51. * HISTORY: *
  52. * 01/03/1995 MML : Created. *
  53. *=========================================================================*/
  54. class ControlClass : public GadgetClass
  55. {
  56. public:
  57. ControlClass(unsigned id, int x, int y, int w, int h, unsigned flags=LEFTPRESS|RIGHTPRESS, int sticky=false);
  58. // static ControlClass * Create_One_Of(unsigned id, int x, int y, int w, int h, unsigned flags=LEFTPRESS|RIGHTPRESS, int sticky=false);
  59. virtual void Make_Peer(GadgetClass & gadget);
  60. /*
  61. ** Render support function.
  62. */
  63. virtual int Draw_Me(int forced=false);
  64. /*
  65. ** This is the ID number for this control gadget. This number is used to generate
  66. ** a special pseudo-key when the gadget detects valid input.
  67. */
  68. unsigned ID;
  69. protected:
  70. virtual unsigned Get_ID(void) const;
  71. virtual int Action(unsigned flags, KeyNumType & key);
  72. /*
  73. ** This points to the peer button to inform when something happens to this
  74. ** gadget.
  75. */
  76. GadgetClass * Peer;
  77. };
  78. #endif