BooleanNodePropertyDisplay.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <GraphCanvas/Components/NodePropertyDisplay/BooleanDataInterface.h>
  10. #include <GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.h>
  11. #include <Widgets/GraphCanvasCheckBox.h>
  12. namespace GraphCanvas
  13. {
  14. class GraphCanvasLabel;
  15. class BooleanNodePropertyDisplay
  16. : public NodePropertyDisplay
  17. , public GraphCanvasCheckBoxNotificationBus::Handler
  18. {
  19. public:
  20. AZ_CLASS_ALLOCATOR(BooleanNodePropertyDisplay, AZ::SystemAllocator);
  21. BooleanNodePropertyDisplay(BooleanDataInterface* dataInterface);
  22. virtual ~BooleanNodePropertyDisplay();
  23. // NodePropertyDisplay
  24. void RefreshStyle() override;
  25. void UpdateDisplay() override;
  26. QGraphicsLayoutItem* GetDisabledGraphicsLayoutItem() override;
  27. QGraphicsLayoutItem* GetDisplayGraphicsLayoutItem() override;
  28. QGraphicsLayoutItem* GetEditableGraphicsLayoutItem() override;
  29. ////
  30. // GraphCanvsCheckBoxNotifications
  31. void OnValueChanged(bool value) override;
  32. void OnClicked() override;
  33. ////
  34. private:
  35. void InvertValue();
  36. BooleanDataInterface* m_dataInterface;
  37. GraphCanvasCheckBox* m_checkBox;
  38. GraphCanvasLabel* m_disabledLabel;
  39. };
  40. }