mirror of
https://github.com/electronicarts/CnC_Tiberian_Dawn.git
synced 2025-12-14 14:41:39 -05:00
Initial commit of Command & Conquer source code.
This commit is contained in:
82
TOGGLE.H
Normal file
82
TOGGLE.H
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
** Command & Conquer(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Header: F:\projects\c&c\vcs\code\toggle.h_v 2.16 16 Oct 1995 16:47:34 JOE_BOSTIC $ */
|
||||
/***********************************************************************************************
|
||||
*** 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 ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : Command & Conquer *
|
||||
* *
|
||||
* File Name : TOGGLE.H *
|
||||
* *
|
||||
* Programmer : Joe L. Bostic *
|
||||
* *
|
||||
* Start Date : 01/15/95 *
|
||||
* *
|
||||
* Last Update : January 15, 1995 [JLB] *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#ifndef TOGGLE_H
|
||||
#define TOGGLE_H
|
||||
|
||||
#include "control.h"
|
||||
|
||||
/*
|
||||
** This class handles gadgets that behave like the Windows buttons. That is, once the mouse
|
||||
** button is clicked over them, they capture the focus until the mouse button is released.
|
||||
** They have a different imagery for the pressed and released states. They only recognize
|
||||
** a valid selection when the mouse button is release while over the button.
|
||||
*/
|
||||
class ToggleClass : public ControlClass
|
||||
{
|
||||
public:
|
||||
ToggleClass(unsigned id, int x, int y, int w, int h);
|
||||
virtual void Turn_On(void);
|
||||
virtual void Turn_Off(void);
|
||||
|
||||
/*
|
||||
** Is this button in a pressed down state? This occurs when the mouse is clicked on the
|
||||
** button and the mouse is still being held down.
|
||||
*/
|
||||
unsigned IsPressed:1;
|
||||
|
||||
/*
|
||||
** This is the button on/off state. Sometimes a button that is "on" has a different
|
||||
** imagery than one that is "off". If the on/off state is not necessary, then just
|
||||
** ignore this flag.
|
||||
*/
|
||||
unsigned IsOn:1;
|
||||
|
||||
/*
|
||||
** If this button can be turned "on" or "off", then this flag should be set to
|
||||
** true. Sometimes a button needs to display its on/off state. In the render routine,
|
||||
** examine the IsOn flag and display accordingly. If this flag is false, then the
|
||||
** IsOn flag will not be changed, regardless of button clicking.
|
||||
*/
|
||||
unsigned IsToggleType:1;
|
||||
|
||||
protected:
|
||||
|
||||
virtual int Action(unsigned flags, KeyNumType &key);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user