axmol/extensions/fairygui/display/FUIInput.h

49 lines
969 B
C
Raw Normal View History

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
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();
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