1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
//---------------------------------------------------------------------------
#ifndef JoystickH
#define JoystickH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <ComCtrls.hpp>
#include <Controls.hpp>
//---------------------------------------------------------------------------
class PACKAGE TJoystick : public TTrackBar
{
private:
TNotifyEvent doChangeJS;
TNotifyEvent doStart;
TNotifyEvent doStop;
int m_position;
int m_delayChange;
TTimer *m_timer;
int m_min;
int m_max;
protected:
DYNAMIC void __fastcall MouseUp(TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseDown(TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
void __fastcall doTimer(TObject *Sender);
void __fastcall setMax(int Valeur);
public:
__fastcall TJoystick(TComponent* Owner);
__fastcall ~TJoystick(void);
void __fastcall reset(void);
__published:
__property TNotifyEvent OnChangeJS = { read = doChangeJS, write = doChangeJS };
__property int DelayChange = { read = m_delayChange, write = m_delayChange };
__property int Min = { read = m_min };
__property int Max = { read = m_max, write = setMax };
__property TNotifyEvent OnStart = { read = doStart, write = doStart };
__property TNotifyEvent OnStop = { read = doStop, write = doStop };
};
//---------------------------------------------------------------------------
#endif |
Partager