CnC_Remastered_Collection

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

SLIDER.H (4888B)


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