- Main Page
- Classes
- Files

- File List

# woopsikey.h

    00001 #ifndef _WOOPSI_KEY_H_
    00002 #define _WOOPSI_KEY_H_
    00003
    00004 #include <nds.h>
    00005 #include "stickybutton.h"
    00006 #include "gadgetstyle.h"
    00007
    00008 namespace WoopsiUI {
    00009
    00013         class WoopsiKey : public StickyButton {
    00014         public:
    00015
    00019                 enum KeyType {
    00020                         KEY_NONE = 0,
    00021                         KEY_ALPHA_NUMERIC_SYMBOL = 1,
    00022                         KEY_RETURN = 3,
    00023                         KEY_CONTROL = 4,
    00024                         KEY_SHIFT = 5,
    00025                         KEY_CAPS_LOCK = 6,
    00026                         KEY_BACKSPACE = 7,
    00027                         KEY_SPACE = 8
    00028                 };
    00029
    00038                 enum KeyMode {
    00039                         KEY_MODE_NORMAL = 0,
    00040                         KEY_MODE_SHIFT = 1,
    00041                         KEY_MODE_CONTROL = 2,
    00042                         KEY_MODE_SHIFT_CONTROL = 3,
    00043                         KEY_MODE_CAPS_LOCK = 4,
    00044                         KEY_MODE_CONTROL_CAPS_LOCK = 5
    00045                 };
    00046
    00061                 WoopsiKey(s16 x, s16 y, u16 width, u16 height, const WoopsiString& text, const KeyType keyType = KEY_ALPHA_NUMERIC_SYMBOL, GadgetStyle* style = NULL);
    00062
    00082                 WoopsiKey(s16 x, s16 y, u16 width, u16 height, const WoopsiString& normalText, const WoopsiString& shiftText, const WoopsiString& controlText, const WoopsiString& shiftControlText, const WoopsiString& capsLockText, const WoopsiString& controlCapsLockText, const KeyType keyType = KEY_ALPHA_NUMERIC_SYMBOL, GadgetStyle* style = NULL);
    00083
    00088                 inline const KeyType getKeyType() const { return _keyType; };
    00089
    00094                 inline void setKeyType(KeyType keyType) { _keyType = keyType; };
    00095
    00101                 void setKeyMode(KeyMode keyMode);
    00102
    00109                 const char getValue() const;
    00110
    00111         protected:
    00112                 KeyType _keyType;
    00113                 WoopsiString _normalText;
    00114                 WoopsiString _shiftText;
    00115                 WoopsiString _controlText;
    00116                 WoopsiString _shiftControlText;
    00117                 WoopsiString _capsLockText;
    00118                 WoopsiString _controlCapsLockText;
    00119                 KeyMode _keyMode;
    00124                 virtual inline ~WoopsiKey() { };
    00125
    00129                 inline WoopsiKey(const WoopsiKey& key) : StickyButton(key) { };
    00130         };
    00131 }
    00132
    00133 #endif