2020-08-04 12:31:33 +08:00
|
|
|
#ifndef __GRICHTEXTFIELD_H__
|
|
|
|
#define __GRICHTEXTFIELD_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "FairyGUIMacros.h"
|
|
|
|
#include "GTextField.h"
|
|
|
|
#include "display/FUIRichText.h"
|
|
|
|
|
|
|
|
NS_FGUI_BEGIN
|
|
|
|
|
|
|
|
class GRichTextField : public GTextField
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GRichTextField();
|
|
|
|
virtual ~GRichTextField();
|
|
|
|
|
|
|
|
CREATE_FUNC(GRichTextField);
|
|
|
|
|
|
|
|
virtual void setAutoSize(AutoSizeType value) override;
|
|
|
|
|
|
|
|
virtual bool isSingleLine() const override { return false; }
|
|
|
|
virtual void setSingleLine(bool value) override;
|
|
|
|
|
|
|
|
virtual TextFormat* getTextFormat() const override { return _richText->getTextFormat(); }
|
|
|
|
virtual void applyTextFormat() override;
|
|
|
|
|
2020-09-08 19:15:28 +08:00
|
|
|
HtmlObject* getControl(const std::string& name) const;
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
virtual GObject* hitTest(const axis::Vec2& worldPoint, const axis::Camera* camera) override;
|
2020-08-04 12:31:33 +08:00
|
|
|
protected:
|
|
|
|
virtual void handleInit() override;
|
|
|
|
virtual void handleSizeChanged() override;
|
|
|
|
|
|
|
|
virtual void setTextFieldText() override;
|
|
|
|
virtual void updateSize() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FUIRichText* _richText;
|
|
|
|
bool _updatingSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_FGUI_END
|
|
|
|
|
|
|
|
#endif
|