SBSPSS/source/gui/gbutton.h

132 lines
2.4 KiB
C
Raw Normal View History

2000-11-02 18:19:06 +01:00
/*=========================================================================
gbutton.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
#ifndef __GUI_GBUTTON_H__
#define __GUI_GBUTTON_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __GUI_GUI_H__
#include "gui\gui.h"
#endif
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
2000-11-22 23:52:08 +01:00
// Toggles a target int between true/false
2000-11-03 17:41:57 +01:00
class CGUIToggleButton : public CGUIObject
2000-11-02 18:19:06 +01:00
{
public:
2000-11-03 22:22:27 +01:00
virtual void init(CGUIObject *_parent,GUIId _id=noId);
2000-11-07 23:05:42 +01:00
void setButtonTarget(int *_target);
2000-11-03 17:41:57 +01:00
virtual void think(int _frames);
protected:
int *getTarget() {return m_target;}
virtual int isSelectable() {return true;}
private:
int *m_target;
};
2000-11-22 23:52:08 +01:00
// Sets target to a specified value
class CGUIValueButton : public CGUIToggleButton
{
public:
virtual void init(CGUIObject *_parent,GUIId _id=noId);
void setButtonValue(int _value);
virtual void think(int _frames);
2000-11-03 17:41:57 +01:00
2000-11-22 23:52:08 +01:00
private:
int m_value;
};
// Cycles target between a specified range of values
2000-11-03 17:41:57 +01:00
class CGUICycleButton : public CGUIToggleButton
{
public:
2000-11-03 22:22:27 +01:00
virtual void init(CGUIObject *_parent,GUIId _id=noId);
2000-11-07 23:05:42 +01:00
void setButtonData(int *_data);
2000-11-02 18:19:06 +01:00
virtual void think(int _frames);
2000-11-02 18:35:44 +01:00
protected:
2000-11-03 17:41:57 +01:00
int *getData() {return m_data;}
2000-11-02 18:35:44 +01:00
2000-11-02 18:19:06 +01:00
private:
int *m_data;
2000-11-03 17:41:57 +01:00
2000-11-02 18:19:06 +01:00
};
2000-11-22 23:52:08 +01:00
// Scrolls target between set limits
2000-11-03 22:22:27 +01:00
class CGUISliderButton : public CGUIToggleButton
{
public:
enum
{
DEFAULT_SCROLL_SPEED=10,
};
virtual void init(CGUIObject *_parent,GUIId _id=noId);
2000-11-07 23:05:42 +01:00
void setButtonRange(int _min,int _max);
void setScrollSpeed(int _scrollSpeed);
2000-11-03 22:22:27 +01:00
virtual void think(int _frames);
private:
int m_min,m_max;
int m_scrollSpeed;
};
2000-11-02 18:19:06 +01:00
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __GUI_GBUTTON_H__ */
/*===========================================================================
end */