Woopsi 1.0 GUI Framework for Nintendo DS Homebrew

- 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
    00062                 WoopsiKey(s16 x, s16 y, u16 width, u16 height, const WoopsiString& text, const KeyType keyType = KEY_ALPHA_NUMERIC_SYMBOL, GadgetStyle* style = NULL);
    00063
    00088                 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);
    00089
    00094                 inline const KeyType getKeyType() const { return _keyType; };
    00095
    00100                 inline void setKeyType(KeyType keyType) { _keyType = keyType; };
    00101
    00107                 void setKeyMode(KeyMode keyMode);
    00108
    00115                 const char getValue() const;
    00116
    00117         protected:
    00118                 KeyType _keyType;
    00119                 WoopsiString _normalText;
    00120                 WoopsiString _shiftText;
    00121                 WoopsiString _controlText;
    00122                 WoopsiString _shiftControlText;
    00123                 WoopsiString _capsLockText;
    00124                 WoopsiString _controlCapsLockText;
    00125                 KeyMode _keyMode;
    00130                 virtual inline ~WoopsiKey() { };
    00131
    00135                 inline WoopsiKey(const WoopsiKey& key) : StickyButton(key) { };
    00136         };
    00137 }
    00138
    00139 #endif