2
0

BsGUIIntField.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIFieldBase.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT GUIIntField : public TGUIField<GUIIntField>
  7. {
  8. public:
  9. static const String& getGUITypeName();
  10. GUIIntField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
  11. const String& labelStyle, const String& inputBoxStyle, const GUILayoutOptions& layoutOptions, bool withLabel);
  12. INT32 getValue() const { return mValue; }
  13. void setValue(INT32 value);
  14. Event<void(INT32)> onValueChanged;
  15. protected:
  16. virtual ~GUIIntField();
  17. void updateClippedBounds();
  18. protected:
  19. static const INT32 DRAG_SPEED;
  20. GUIInputBox* mInputBox;
  21. INT32 mValue;
  22. INT32 mLastDragPos;
  23. bool mIsDragging;
  24. bool mIsDragCursorSet;
  25. bool _hasCustomCursor(const Vector2I position, CursorType& type) const;
  26. virtual bool mouseEvent(const GUIMouseEvent& ev);
  27. void valueChanged(const WString& newValue);
  28. void focusGained();
  29. void focusLost();
  30. static bool intFilter(const WString& str);
  31. };
  32. }