00001 /* *********************************************************************************** 00002 Writer: Sebastien Bloc 00003 Copyright: 2004 00004 eMail: sebastien.bloc@free.fr 00005 URL: http://mignonsoft.free.fr 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 http://www.gnu.org/copyleft/gpl.html 00017 *********************************************************************************** */ 00018 00023 #ifndef INCLUDE_BUTTON_H 00024 #define INCLUDE_BUTTON_H 00025 00026 #include "control.h" 00027 00028 [event_source(native)] 00029 class EventButton 00030 { 00031 public: 00032 __event void Click(); 00033 }; 00034 00039 [event_receiver(native)] 00040 class Button : public Control 00041 { 00042 public: 00043 // varaible membre 00044 MyString caption; 00045 double deltaZ_max,deltaZ_min; 00046 double timeOut; 00047 BOOL isPushed; 00048 Texture *texture; 00049 Material materialOnUp; 00050 Material materialOnDown; 00051 00052 // evenements 00053 EventButton onButton; 00054 Timer timerPushDown; 00055 00056 Button(); 00057 ~Button(); 00058 00059 virtual void Create() { Create(DEFAULT_DELTAZ_MAX_BUTTON); } // Createur pour container 00060 void Create(double deltaZ); 00061 void operator=(char *newCaption); 00062 void SetText(char *newCaption); 00063 void ToString(MyString &str); 00064 void PushUp(); 00065 void MajTexture(); 00066 00067 void OnPushDown(StateMouse *mouse,int face); 00068 void OnPushUp(StateMouse *mouse,int face); 00069 void OnTimerPushDown(Timer *timer); 00070 void OnOverOut(Control *newControl,int face); 00071 }; 00072 00073 #endif