Woopsi 1.0 GUI Framework for Nintendo DS Homebrew

- Main Page
- Classes
- Files

- File List

# gadgeteventargs.h

    00001 #ifndef _GADGETEVENTARGS_H_
    00002 #define _GADGETEVENTARGS_H_
    00003
    00004 #include "eventargs.h"
    00005
    00006 namespace WoopsiUI {
    00007
    00008         class Gadget;
    00009
    00013         enum KeyCode {
    00014                 KEY_CODE_NONE = 0,
    00015                 KEY_CODE_UP = 1,
    00016                 KEY_CODE_DOWN = 2,
    00017                 KEY_CODE_LEFT = 3,
    00018                 KEY_CODE_RIGHT = 4,
    00019                 KEY_CODE_A = 5,
    00020                 KEY_CODE_B = 6,
    00021                 KEY_CODE_X = 7,
    00022                 KEY_CODE_Y = 8,
    00023                 KEY_CODE_L = 9,
    00024                 KEY_CODE_R = 10,
    00025                 KEY_CODE_START = 11,
    00026                 KEY_CODE_SELECT = 12
    00027         };
    00028
    00032         class GadgetEventArgs : public EventArgs<Gadget*> {
    00033         public:
    00034
    00044                 GadgetEventArgs(Gadget* source, const s16 x, const s16 y, const s16 vX, const s16 vY, const KeyCode keyCode) : EventArgs<Gadget*>(source) {
    00045                         _x = x;
    00046                         _y = y;
    00047                         _vX = vX;
    00048                         _vY = vY;
    00049                         _keyCode = keyCode;
    00050                 }
    00051
    00056                 inline const s16 getX() const { return _x; }
    00057
    00062                 inline const s16 getY() const { return _y; }
    00063
    00068                 inline const s16 getVX() const { return _vX; }
    00069
    00074                 inline const s16 getVY() const { return _vY; }
    00075
    00080                 inline const KeyCode getKeyCode() const { return _keyCode; }
    00081
    00082         private:
    00083                 s16 _x;
    00084                 s16 _y;
    00085                 s16 _vX;
    00086                 s16 _vY;
    00087                 KeyCode _keyCode;
    00088         };
    00089 }
    00090
    00091 #endif