UIInspectorDataBinding.h 835 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <TurboBadger/tb_widgets.h>
  3. #include <Atomic/Scene/Scene.h>
  4. namespace tb
  5. {
  6. class TBWidget;
  7. class TBMenuWindow;
  8. class TBInlineSelect;
  9. }
  10. using namespace Atomic;
  11. using namespace tb;
  12. namespace AtomicEditor
  13. {
  14. class InspectorDataBinding
  15. {
  16. public:
  17. static InspectorDataBinding* Create(Serializable* object, const AttributeInfo* attrInfo);
  18. void SetWidgetValueFromObject();
  19. void SetObjectValueFromWidget(TBWidget* srcWidget = NULL);
  20. TBWidget* GetWidget() { return widget_; }
  21. bool OnEvent(const TBWidgetEvent &ev);
  22. private:
  23. InspectorDataBinding() : widget_(0), object_(0), attrInfo_(0), objectLocked_(false), widgetLocked_(false) {}
  24. TBWidget* widget_;
  25. Serializable* object_;
  26. const AttributeInfo* attrInfo_;
  27. bool objectLocked_;
  28. bool widgetLocked_;
  29. };
  30. }