CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

GAUGE.H (4202B)


      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 /* $Header: /CounterStrike/GAUGE.H 1     3/03/97 10:24a Joe_bostic $ */
     17 /***********************************************************************************************
     18  ***              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               ***
     19  ***********************************************************************************************
     20  *                                                                                             *
     21  *                 Project Name : Command & Conquer                                            *
     22  *                                                                                             *
     23  *                    File Name : GAUGE.H                                                      *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic, Maria del Mar McCready Legg                   *
     26  *                                                                                             *
     27  *                   Start Date : 01/15/95                                                     *
     28  *                                                                                             *
     29  *                  Last Update : January 15, 1995 [JLB]                                       *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef GAUGE_H
     36 #define GAUGE_H
     37 
     38 class GaugeClass : public ControlClass
     39 {
     40 	public:
     41 
     42 		GaugeClass(unsigned id, int x, int y, int w, int h);
     43 
     44 		virtual int Draw_Me(int forced=false);
     45 		virtual int Set_Maximum(int value);
     46 		virtual int Set_Value(int value);
     47 		virtual int Get_Value(void) const {return (CurValue);};
     48 		virtual void Use_Thumb(int value) { HasThumb = value ? true : false; };
     49 
     50 		virtual int Thumb_Pixels(void) { return (4);}
     51 
     52 		/*
     53 		**	If this gauge has a color to the left of the current setting, then this
     54 		**	flag will be true.
     55 		*/
     56 		unsigned IsColorized:1;
     57 
     58 	protected:
     59 
     60 		/*
     61 		**	If a thumb is desired, set to true.
     62 		*/
     63 		unsigned HasThumb:1;
     64 
     65 		/*
     66 		**	Is this a horizontal slider?
     67 		*/
     68 		unsigned IsHorizontal:1;
     69 
     70 		int MaxValue;				// maximum value (in application units)
     71 		int CurValue;				// index of 1st displayed string in box
     72 										//  (in application units)
     73 
     74 		/*
     75 		** This value records the difference between where the user clicked
     76 		** and the edge of the thumb, so that the thumb follows the mouse
     77 		** with the proper offset.
     78 		*/
     79 		int ClickDiff;
     80 
     81 	protected:
     82 		virtual void Draw_Thumb(void);
     83 		virtual int  Action(unsigned flags, KeyNumType &key);
     84 		virtual int  Pixel_To_Value(int pixel);
     85 		virtual int  Value_To_Pixel(int value);
     86 };
     87 
     88 
     89 
     90 class TriColorGaugeClass : public GaugeClass
     91 {
     92 	public:
     93 		TriColorGaugeClass(unsigned id, int x, int y, int w, int h);
     94 		virtual int Draw_Me(int forced);
     95 		virtual int Set_Red_Limit(int value);
     96 		virtual int Set_Yellow_Limit(int value);
     97 
     98 	protected:
     99 		int RedLimit;				// maximum value for red
    100 		int YellowLimit;			// maximum value for yellow
    101 };
    102 
    103 
    104 
    105 
    106 #endif