CnC_Remastered_Collection

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

CHECKBOX.CPP (4551B)


      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:   F:\projects\c&c\vcs\code\checkbox.cpv   1.6   16 Oct 1995 16:49:36   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 : CHECKBOX.CPP                                                 * 
     24  *                                                                                             * 
     25  *                   Programmer : Joe L. Bostic                                                * 
     26  *                                                                                             * 
     27  *                   Start Date : 05/26/95                                                     * 
     28  *                                                                                             * 
     29  *                  Last Update : July 1, 1995 [JLB]                                           * 
     30  *                                                                                             * 
     31  *---------------------------------------------------------------------------------------------* 
     32  * Functions:                                                                                  * 
     33  *   CheckBoxClass::Draw_Me -- Draws the checkbox imagery.                                     * 
     34  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     35 
     36 #include	"function.h"
     37 #include	"checkbox.h"
     38 
     39 
     40 /*********************************************************************************************** 
     41  * CheckBoxClass::Draw_Me -- Draws the checkbox imagery.                                       * 
     42  *                                                                                             * 
     43  *    This routine will draw the checkbox either filled or empty as necessary.                 * 
     44  *                                                                                             * 
     45  * INPUT:   forced   -- Should the check box be drawn even if it doesn't think it needs to?    * 
     46  *                                                                                             * 
     47  * OUTPUT:  Was the check box rendered?                                                        * 
     48  *                                                                                             * 
     49  * WARNINGS:   none                                                                            * 
     50  *                                                                                             * 
     51  * HISTORY:                                                                                    * 
     52  *   07/01/1995 JLB : Created.                                                                 * 
     53  *=============================================================================================*/
     54 int CheckBoxClass::Draw_Me(int forced)
     55 {
     56 	if (ToggleClass::Draw_Me(forced)) {
     57 
     58 		Hide_Mouse();
     59 		Draw_Box(X, Y, Width, Height, BOXSTYLE_GREEN_DOWN, false);
     60 		LogicPage->Fill_Rect(X+1, Y+1, X+Width-2, Y+Height-2, DKGREY);
     61 		if (IsOn) {
     62 			LogicPage->Draw_Line(X+1, Y+1, X+Width-2, Y+Height-2, BLACK);
     63 			LogicPage->Draw_Line(X+Width-2, Y+1, X+1, Y+Height-2, BLACK);
     64 		}
     65 		Show_Mouse();
     66 		return(true);
     67 	}
     68 	return(false);
     69 }