BsGUITextField.h 897 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIFieldBase.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT GUITextField : public TGUIField<GUITextField>
  7. {
  8. public:
  9. static const String& getGUITypeName();
  10. static const String& getInputStyleType();
  11. GUITextField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
  12. const String& style, const GUILayoutOptions& layoutOptions, bool withLabel);
  13. WString getValue() const { return mValue; }
  14. void setValue(const WString& value);
  15. bool hasInputFocus() const { return mHasInputFocus; }
  16. Event<void(const WString&)> onValueChanged;
  17. protected:
  18. virtual ~GUITextField();
  19. void styleUpdated();
  20. void valueChanged(const WString& newValue);
  21. void focusGained();
  22. void focusLost();
  23. GUIInputBox* mInputBox;
  24. bool mHasInputFocus;
  25. WString mValue;
  26. };
  27. }