UnrealImGui/Source/ImGui/Private/Widgets/SImGuiLayout.h
Sebastian c144658f37 Refactored ImGui widget and removed dependency on ImGui internal cursor data:
- Added SImGuiLayout to resets layout and house SImGuiWidget.
- Module manager creates SImGuiLayout instead of SImGuiWidget (eventually it should be replaced with a higher level object, like AHUD).
- Reworked ImGui canvas dragging and scaling and moved to SImGuiCanvasControl.
- Removed dependency on ImGui internal cursor data. New presentation is cleaner and doesn't use cursor data.
- Rendering code could be simplified after layout reset provided by SImGuiLayout.
- SImGuiWidget still handles input, rendering of ImGui draw data and activation of SImGuiCanvasControl.
- All widgets are in own subfolder.
2019-03-13 20:40:13 +00:00

33 lines
706 B
C++

// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
#pragma once
#include <Widgets/SCompoundWidget.h>
class FImGuiModuleManager;
class UGameViewportClient;
// Layout preset for ImGui Widget.
class SImGuiLayout : public SCompoundWidget
{
typedef SCompoundWidget Super;
public:
SLATE_BEGIN_ARGS(SImGuiLayout)
{}
SLATE_ARGUMENT(FImGuiModuleManager*, ModuleManager)
SLATE_ARGUMENT(UGameViewportClient*, GameViewport)
SLATE_ARGUMENT(int32, ContextIndex)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
const TWeakObjectPtr<UGameViewportClient>& GetGameViewport() const { return GameViewport; }
private:
TWeakObjectPtr<UGameViewportClient> GameViewport;
};