axmol/extensions/fairygui/display/FUIInput.h

49 lines
963 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
2022-08-08 18:02:17 +08:00
class FUIInput : public ax::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-08-08 18:02:17 +08:00
void _touchDownAction(ax::Ref *sender, ax::ui::Widget::TouchEventType controlEvent);
2020-08-04 12:31:33 +08:00
TextFormat* _textFormat;
bool _password;
int _keyboardType;
};
NS_FGUI_END
#endif