2013-05-24 11:42:27 +08:00
|
|
|
enum KeyboardReturnType {
|
|
|
|
kKeyboardReturnTypeDefault = 0,
|
|
|
|
kKeyboardReturnTypeDone,
|
|
|
|
kKeyboardReturnTypeSend,
|
|
|
|
kKeyboardReturnTypeSearch,
|
|
|
|
kKeyboardReturnTypeGo
|
|
|
|
};
|
|
|
|
|
|
|
|
enum EditBoxInputMode
|
|
|
|
{
|
|
|
|
kEditBoxInputModeAny = 0,
|
|
|
|
|
|
|
|
kEditBoxInputModeEmailAddr,
|
|
|
|
|
|
|
|
kEditBoxInputModeNumeric,
|
|
|
|
|
|
|
|
kEditBoxInputModePhoneNumber,
|
|
|
|
|
|
|
|
kEditBoxInputModeUrl,
|
|
|
|
|
|
|
|
kEditBoxInputModeDecimal,
|
|
|
|
|
|
|
|
kEditBoxInputModeSingleLine
|
|
|
|
};
|
|
|
|
|
|
|
|
enum EditBoxInputFlag
|
|
|
|
{
|
|
|
|
|
|
|
|
kEditBoxInputFlagPassword = 0,
|
|
|
|
|
|
|
|
kEditBoxInputFlagSensitive,
|
|
|
|
|
|
|
|
kEditBoxInputFlagInitialCapsWord,
|
|
|
|
|
|
|
|
kEditBoxInputFlagInitialCapsSentence,
|
|
|
|
|
|
|
|
kEditBoxInputFlagInitialCapsAllCharacters
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCEditBox: public CCControlButton
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CCEditBox(void);
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~CCEditBox(void);
|
|
|
|
|
|
|
|
|
|
|
|
static CCEditBox* create(const CCSize& size, CCScale9Sprite* pNormal9SpriteBg, CCScale9Sprite* pPressed9SpriteBg = NULL, CCScale9Sprite* pDisabled9SpriteBg = NULL);
|
|
|
|
|
|
|
|
bool initWithSizeAndBackgroundSprite(const CCSize& size, CCScale9Sprite* pNormal9SpriteBg);
|
|
|
|
|
|
|
|
void registerScriptEditBoxHandler(LUA_FUNCTION handler);
|
|
|
|
|
|
|
|
void unregisterScriptEditBoxHandler(void);
|
|
|
|
|
|
|
|
int getScriptEditBoxHandler(void);
|
|
|
|
|
|
|
|
void setText(const char* pText);
|
|
|
|
|
|
|
|
const char* getText(void);
|
|
|
|
|
|
|
|
void setFont(const char* pFontName, int fontSize);
|
|
|
|
|
|
|
|
void setFontName(const char* pFontName);
|
|
|
|
|
|
|
|
void setFontSize(int fontSize);
|
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
void setFontColor(const Color3B& color);
|
2013-05-24 11:42:27 +08:00
|
|
|
|
|
|
|
void setPlaceholderFont(const char* pFontName, int fontSize);
|
|
|
|
|
|
|
|
void setPlaceholderFontName(const char* pFontName);
|
|
|
|
|
|
|
|
void setPlaceholderFontSize(int fontSize);
|
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
void setPlaceholderFontColor(const Color3B& color);
|
2013-05-24 11:42:27 +08:00
|
|
|
|
|
|
|
void setPlaceHolder(const char* pText);
|
|
|
|
|
|
|
|
const char* getPlaceHolder(void);
|
|
|
|
|
|
|
|
void setInputMode(EditBoxInputMode inputMode);
|
|
|
|
|
|
|
|
void setMaxLength(int maxLength);
|
|
|
|
|
|
|
|
int getMaxLength();
|
|
|
|
|
|
|
|
void setInputFlag(EditBoxInputFlag inputFlag);
|
|
|
|
|
|
|
|
void setReturnType(KeyboardReturnType returnType);
|
|
|
|
|
|
|
|
virtual void setPosition(const CCPoint& pos);
|
|
|
|
virtual void setVisible(bool visible);
|
|
|
|
virtual void setContentSize(const CCSize& size);
|
|
|
|
virtual void setAnchorPoint(const CCPoint& anchorPoint);
|
|
|
|
virtual void visit(void);
|
|
|
|
virtual void onEnter(void);
|
|
|
|
virtual void onExit(void);
|
|
|
|
|
|
|
|
void touchDownAction(CCObject *sender, CCControlEvent controlEvent);
|
2013-05-24 11:46:07 +08:00
|
|
|
};
|