Files
o3de/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/EntityIdNodePropertyDisplay.h
T
2021-06-23 10:55:22 -07:00

73 lines
2.1 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
class QEvent;
#if !defined(Q_MOC_RUN)
#include <AzCore/Component/EntityBus.h>
#include <AzToolsFramework/UI/PropertyEditor/PropertyEntityIdCtrl.hxx>
#include <GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.h>
#include <GraphCanvas/Components/NodePropertyDisplay/EntityIdDataInterface.h>
#include <GraphCanvas/Components/MimeDataHandlerBus.h>
#endif
namespace GraphCanvas
{
class GraphCanvasLabel;
class EntityIdNodePropertyDisplay
: public NodePropertyDisplay
, public AZ::EntityBus::Handler
{
friend class EntityIdGraphicsEventFilter;
public:
AZ_CLASS_ALLOCATOR(EntityIdNodePropertyDisplay, AZ::SystemAllocator, 0);
EntityIdNodePropertyDisplay(EntityIdDataInterface* dataInterface);
virtual ~EntityIdNodePropertyDisplay();
// NodePropertyDisplay
void RefreshStyle() override;
void UpdateDisplay() override;
QGraphicsLayoutItem* GetDisabledGraphicsLayoutItem() override;
QGraphicsLayoutItem* GetDisplayGraphicsLayoutItem() override;
QGraphicsLayoutItem* GetEditableGraphicsLayoutItem() override;
////
// AZ::EntityBus
void OnEntityNameChanged(const AZStd::string& name) override;
////
// DataSlotNotifications
void OnDragDropStateStateChanged(const DragDropState& dragState) override;
////
protected:
void ShowContextMenu(const QPoint&);
private:
void EditStart();
void EditFinished();
void SubmitValue();
void SetupProxyWidget();
void CleanupProxyWidget();
EntityIdDataInterface* m_dataInterface;
GraphCanvasLabel* m_disabledLabel;
AzToolsFramework::PropertyEntityIdCtrl* m_propertyEntityIdCtrl;
QGraphicsProxyWidget* m_proxyWidget;
GraphCanvasLabel* m_displayLabel;
};
}