SLIDER.H 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. /* $Header: /CounterStrike/SLIDER.H 1 3/03/97 10:25a 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 : SLIDER.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 SLIDER_H
  37. #define SLIDER_H
  38. #include "gauge.h"
  39. #include "shapebtn.h"
  40. /***************************************************************************
  41. * SliderClass -- Like a Windows ListBox structure *
  42. * *
  43. * INPUT: int id-- id of gadget *
  44. * int x -- x position of gadget *
  45. * int y -- y position of gadget *
  46. * int w -- width of gadget *
  47. * int h -- height of gadget *
  48. * int belong_to_list -- does this slider go with a listclass? *
  49. * *
  50. * OUTPUT: none. *
  51. * WARNINGS: *
  52. * HISTORY: 01/03/1995 MML : Created. *
  53. *=========================================================================*/
  54. class SliderClass : public GaugeClass
  55. {
  56. public:
  57. SliderClass(unsigned id, int x, int y, int w, int h, int belong_to_list=false);
  58. virtual ~SliderClass(void);
  59. virtual void Set_Thumb_Size(int value);
  60. virtual int Set_Maximum(int value);
  61. virtual int Set_Value(int);
  62. virtual int Bump(int up);
  63. virtual int Step(int up);
  64. virtual int Draw_Me(int forced);
  65. virtual void Peer_To_Peer(unsigned flags, KeyNumType & key, ControlClass & whom);
  66. virtual int Thumb_Pixels(void) { return (ThumbSize);}
  67. protected:
  68. /*
  69. ** If the slider bar has been created, these point to the respective gadgets
  70. ** that it is composed of.
  71. */
  72. ShapeButtonClass * PlusGadget;
  73. ShapeButtonClass * MinusGadget;
  74. /*
  75. ** If I belong to a listbox, I have to draw myself differently...
  76. **/
  77. unsigned BelongToList:1;
  78. /*
  79. ** This is the logical size of the thumb. This value is used when drawing
  80. ** the thumb imagery. It is also the amount that is bumped when the
  81. ** Bump() function is called. (This value is in application units.)
  82. */
  83. int Thumb;
  84. /*
  85. ** This is the current thumb pixel size and starting offset from beginning
  86. ** of slider region. (These values are in pixels.)
  87. */
  88. int ThumbSize;
  89. int ThumbStart; // x or y position for the thumb
  90. virtual int Action(unsigned flags, KeyNumType &key);
  91. virtual void Draw_Thumb(void);
  92. private:
  93. void Recalc_Thumb(void);
  94. };
  95. #endif