2020-08-04 12:31:33 +08:00
|
|
|
#ifndef __FUIINPUT_H__
|
|
|
|
#define __FUIINPUT_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "FairyGUIMacros.h"
|
|
|
|
#include "ui/UIEditBox/UIEditBox.h"
|
|
|
|
#include "TextFormat.h"
|
|
|
|
|
|
|
|
NS_FGUI_BEGIN
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
class FUIInput : public axis::ui::EditBox
|
2020-08-04 12:31:33 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static FUIInput* create();
|
|
|
|
|
|
|
|
FUIInput();
|
|
|
|
virtual ~FUIInput();
|
|
|
|
|
|
|
|
std::string getText() const;
|
|
|
|
void setText(const std::string& value);
|
|
|
|
|
|
|
|
TextFormat* getTextFormat() const { return _textFormat; }
|
|
|
|
void applyTextFormat();
|
|
|
|
|
|
|
|
bool isSingleLine() const;
|
|
|
|
void setSingleLine(bool value);
|
|
|
|
|
|
|
|
bool isPassword() const { return _password; }
|
|
|
|
void setPassword(bool value);
|
|
|
|
|
|
|
|
int keyboardType() const { return _keyboardType; }
|
|
|
|
void setKeyboardType(int value);
|
|
|
|
|
|
|
|
void openKeyboard();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void continueInit();
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
void _touchDownAction(axis::Ref *sender, axis::ui::Widget::TouchEventType controlEvent);
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
TextFormat* _textFormat;
|
|
|
|
bool _password;
|
|
|
|
int _keyboardType;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_FGUI_END
|
|
|
|
|
|
|
|
#endif
|