Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Button Class Reference

Class de parametre et d'evenement d'un "Bouton". More...

#include <button.h>

Inheritance diagram for Button:

Control List of all members.

Public Member Functions

 Button ()
 ~Button ()
virtual void Create ()
void Create (double depth)
void operator= (char *newCaption)
void SetText (char *newCaption)
void ToString (MyString &str)
 Pour le debugage.

void PushUp ()
 Si on quit le control avec le boutton appuyé ==> arret.

void SetPush (BOOL enable)
void SetPushToogle ()
BOOL GetPush ()
 determine si le button est appuillé ou pas (vaut aussi en mode pushLike)

void ModePushLike (BOOL enable)
 gestion du mode pushLike (toogle appuis relaché a chaque click)

void ModeAllButtons (BOOL enable)
 Tout les bouttons peuvent activé le click.

int OnPushDown (StateMouse *mouse, int face)
int OnPushUp (StateMouse *mouse, int face)
int OnOverOut (Control *newControl, int face)
int OnOverIn (Control *oldControl, int face)

Public Attributes

MyString caption
double depth_max
double depth_min
double depth_cur
double timeOut
BOOL isPushed
Material materialOnUp
Material materialOnDown
MaterialmaterialCurrent
Text3D text
EventButton onButton
Timer timerPushDown

Detailed Description

Class de parametre et d'evenement d'un "Bouton".

Definition at line 40 of file button.h.


Constructor & Destructor Documentation

Button::Button  ) 
 

Definition at line 29 of file button.cpp.

References align_center, ce, DEFAULT_DEPTH_MAX_BUTTON, DEFAULT_DEPTH_MIN_BUTTON, depth_cur, depth_max, depth_min, EventMouseButton::down, f, ControlEngine::fontTexture, ft_texture, EventOver::in, isPushed, EventMouse::left, BasicText3D::material, materialCurrent, materialOnDown, materialOnUp, EventControl::mouse, OnOverIn(), OnOverOut(), OnPushDown(), OnPushUp(), EventOver::out, EventControl::over, Text3D::SetAlign(), Material::SetDS(), Text3D::Setup(), TIME_OUT_PUSH_DOWN_BUTTON, timeOut, and EventMouseButton::up.

Button::~Button  ) 
 

Definition at line 60 of file button.cpp.


Member Function Documentation

void Button::Create double  depth  ) 
 

Definition at line 66 of file button.cpp.

References Primitive::AddBox(), ce, depth_cur, depth_max, MyTreeNode< T >::elem, MyTreeNode< T >::Elems(), FACE_FRONT, materialCurrent, ControlEngine::primitive, and Control::SetParent().

virtual void Button::Create  )  [inline, virtual]
 

Reimplemented from Control.

Definition at line 67 of file button.h.

References DEFAULT_DEPTH_MAX_BUTTON.

Referenced by TaskWindow::Add(), Tutorial::BaseDemo::BaseDemo(), Tutorial::LayoutDemo::ConfigTreeButton(), Title::Create(), Slider::Create(), MsgBox::Create(), Calculator::Create(), Tutorial::Create(), Tutorial::LayoutDemo::LayoutDemo(), and Tutorial::UniversDemo::SetFace().

BOOL Button::GetPush  ) 
 

determine si le button est appuillé ou pas (vaut aussi en mode pushLike)

Definition at line 132 of file button.cpp.

References BOOL(), and isPushed.

void Button::ModeAllButtons BOOL  enable  ) 
 

Tout les bouttons peuvent activé le click.

Definition at line 154 of file button.cpp.

References EventMouseButton::down, EventMouse::mid, EventControl::mouse, OnPushDown(), OnPushUp(), EventMouse::right, and EventMouseButton::up.

Referenced by Tutorial::LayoutDemo::ConfigTreeButton(), and Tutorial::LayoutDemo::LayoutDemo().

void Button::ModePushLike BOOL  enable  ) 
 

gestion du mode pushLike (toogle appuis relaché a chaque click)

Definition at line 148 of file button.cpp.

Referenced by Tutorial::LayoutDemo::ConfigTreeButton(), and Tutorial::LayoutDemo::LayoutDemo().

int Button::OnOverIn Control oldControl,
int  face
 

Definition at line 192 of file button.cpp.

References Cursor::ApplyTypes(), ce, ControlEngine::cursor, cursorNothing, Debug2Param, and Control::name.

Referenced by Button().

int Button::OnOverOut Control newControl,
int  face
 

Definition at line 199 of file button.cpp.

References Debug2Param, Control::name, and PushUp().

Referenced by Button().

int Button::OnPushDown StateMouse mouse,
int  face
 

Definition at line 79 of file button.cpp.

References Cursor::ApplyTypes(), BindTimer, ce, EventButton::checked, ControlEngine::cursor, DebugMouse2, MyTreeNode< T >::elem, Timer::GetDeltaTime(), isPushed, materialCurrent, materialOnDown, onButton, SetPushToogle(), and timerPushDown.

Referenced by Button(), and ModeAllButtons().

int Button::OnPushUp StateMouse mouse,
int  face
 

Definition at line 137 of file button.cpp.

References Cursor::ApplyTypes(), BOOL(), ce, EventButton::click, ControlEngine::cursor, DebugMouse2, isPushed, onButton, and PushUp().

Referenced by Button(), and ModeAllButtons().

void Button::operator= char *  newCaption  ) 
 

Definition at line 208 of file button.cpp.

References Text3D::SetText().

void Button::PushUp  ) 
 

Si on quit le control avec le boutton appuyé ==> arret.

Definition at line 178 of file button.cpp.

References depth_cur, depth_max, MyTreeNode< T >::elem, isPushed, materialCurrent, materialOnUp, Timer::Stop(), and timerPushDown.

Referenced by OnOverOut(), and OnPushUp().

void Button::SetPush BOOL  enable  ) 
 

Definition at line 120 of file button.cpp.

References depth_cur, depth_max, depth_min, and isPushed.

Referenced by Tutorial::LayoutDemo::OnReset(), Tutorial::LayoutDemo::OnResetAll(), Tutorial::LayoutDemo::OnSet(), Tutorial::LayoutDemo::OnSetAll(), and SetPushToogle().

void Button::SetPushToogle  ) 
 

Definition at line 126 of file button.cpp.

References isPushed, and SetPush().

Referenced by OnPushDown(), Tutorial::LayoutDemo::OnToogle(), and Tutorial::LayoutDemo::OnToogleAll().

void Button::SetText char *  newCaption  ) 
 

Definition at line 213 of file button.cpp.

References Text3D::SetText().

Referenced by TaskWindow::Add(), Tutorial::BaseDemo::BaseDemo(), Tutorial::Create(), and Univers::ExitQuestion().

void Button::ToString MyString str  ) 
 

Pour le debugage.

Reimplemented from Control.

Definition at line 220 of file button.cpp.

References MyString::AddFormat(), and caption.


Member Data Documentation

MyString Button::caption
 

Definition at line 51 of file button.h.

Referenced by ToString().

double Button::depth_cur
 

Definition at line 52 of file button.h.

Referenced by Button(), Create(), PushUp(), and SetPush().

double Button::depth_max
 

Definition at line 52 of file button.h.

Referenced by Button(), Slider::Create(), Create(), Tutorial::LayoutDemo::LayoutDemo(), PushUp(), and SetPush().

double Button::depth_min
 

Definition at line 52 of file button.h.

Referenced by Button(), Slider::Create(), Tutorial::LayoutDemo::LayoutDemo(), and SetPush().

BOOL Button::isPushed
 

Definition at line 54 of file button.h.

Referenced by Button(), GetPush(), OnPushDown(), OnPushUp(), PushUp(), SetPush(), and SetPushToogle().

Material* Button::materialCurrent
 

Definition at line 57 of file button.h.

Referenced by Button(), Create(), OnPushDown(), and PushUp().

Material Button::materialOnDown
 

Definition at line 56 of file button.h.

Referenced by Button(), OnPushDown(), and Tutorial::UniversDemo::SetFace().

Material Button::materialOnUp
 

Definition at line 55 of file button.h.

Referenced by Button(), PushUp(), and Tutorial::UniversDemo::SetFace().

EventButton Button::onButton
 

Definition at line 61 of file button.h.

Referenced by TaskWindow::Add(), Tutorial::ApplicationDemo::ApplicationDemo(), Tutorial::BaseDemo::BaseDemo(), Calculator::Calculator(), Tutorial::Create(), Tutorial::Demo::Demo(), Tutorial::Demo::Ending(), Univers::ExitQuestion(), Tutorial::FaceDemo::FaceDemo(), Tutorial::LayoutDemo::LayoutDemo(), MsgBox::MsgBox(), OnPushDown(), OnPushUp(), Tutorial::UniversDemo::SetFace(), Title::Title(), Tutorial::Tutorial(), Tutorial::UniversDemo::UniversDemo(), and Tutorial::WindowDemo::WindowDemo().

Text3D Button::text
 

Definition at line 58 of file button.h.

Referenced by TaskWindow::Add(), Tutorial::BaseDemo::BaseDemo(), Tutorial::LayoutDemo::ConfigTreeButton(), Tutorial::LayoutDemo::LayoutDemo(), and Tutorial::Tutorial().

double Button::timeOut
 

Definition at line 53 of file button.h.

Referenced by Button().

Timer Button::timerPushDown
 

Definition at line 62 of file button.h.

Referenced by OnPushDown(), and PushUp().


The documentation for this class was generated from the following files:
Generated on Fri Aug 20 19:21:00 2004 for 3d Controls by doxygen 1.3.6