LkEngine 0.1.2
 
Loading...
Searching...
No Matches
UI Core

Namespaces

namespace  LkEngine::UI::Slider
 

Classes

struct  LkEngine::UI::FMessageBox
 Data container for a message box instance. More...
 
struct  LkEngine::UI::SizeConstraint< T >
 
struct  LkEngine::UI::SizeConstraint< ImVec2 >
 
struct  LkEngine::UI::LUIContext
 

Typedefs

template<typename T >
using LkEngine::UI::TPropertyMapping = std::pair<const char*, T>
 

Enumerations

enum class  EMessageBoxFlag : uint32_t { OkButton = LK_BIT(0) , CancelButton = LK_BIT(1) , UserFunction = LK_BIT(2) , AutoSize = LK_BIT(3) }
 
enum class  EBorder { None = 0 , Horizontal = LK_BIT(1) , Vertical = LK_BIT(2) , All = LK_BIT(3) }
 
enum class  LkEngine::UI::EFindType { ID , Name }
 

Functions

 LkEngine::LK_ENUM_CLASS (EMessageBoxFlag)
 
 LkEngine::LK_ENUM_RANGE_FLAGS_BY_FIRST_AND_LAST (EMessageBoxFlag, EMessageBoxFlag::OkButton, EMessageBoxFlag::AutoSize)
 
 LkEngine::LK_DECLARE_MULTICAST_DELEGATE (FOnSetPanelOpen, const char *, const bool)
 
 LkEngine::LK_DECLARE_DELEGATE_RET (FIsPanelOpen, bool, const char *)
 
 LkEngine::UI::LK_DECLARE_MULTICAST_DELEGATE (FOnMessageBoxCancelled, const char *)
 
 LkEngine::UI::LK_ENUM_CLASS (EBorder)
 
FORCEINLINE void LkEngine::UI::PushStyle (const EStyle Style, const float Value)
 
FORCEINLINE void LkEngine::UI::PopStyle (const int StylesToPop=1)
 
FORCEINLINE void LkEngine::UI::SetNextComboFlags (const ImGuiComboFlags Flags)
 
FORCEINLINE bool LkEngine::UI::InTable ()
 
void LkEngine::UI::ShowMessageBox (const char *Title, const std::function< void()> &RenderFunction, uint32_t Flags, const uint32_t Width, const uint32_t Height, const uint32_t MinWidth, const uint32_t MinHeight, const uint32_t MaxWidth, const uint32_t MaxHeight)
 
void LkEngine::UI::RenderMessageBoxes ()
 
const char * LkEngine::UI::GenerateID ()
 
void LkEngine::UI::PushID ()
 
void LkEngine::UI::PopID ()
 
void LkEngine::UI::Separator (const ImVec2 &Size, const ImVec4 &Color)
 
bool LkEngine::UI::IsInputEnabled ()
 
bool LkEngine::UI::IsMouseEnabled ()
 
bool LkEngine::UI::IsKeyboardEnabled ()
 
void LkEngine::UI::SetInputEnabled (const bool Enabled)
 
void LkEngine::UI::SetMouseEnabled (const bool Enabled)
 
bool LkEngine::UI::Begin (const char *WindowTitle, bool *Open, ImGuiWindowFlags WindowFlags)
 
void LkEngine::UI::End ()
 
void LkEngine::UI::BeginViewport (TObjectPtr< LWindow > Window)
 
ImTextureID LkEngine::UI::GetTextureID (TObjectPtr< LTexture2D > Texture)
 
ImGuiDockNode * LkEngine::UI::FindCentralNode (const ImGuiID DockspaceID)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE bool LkEngine::UI::IsWindowFocused (T Identifier, const bool CheckRootWindow=true)
 Check if a window is focused, defaults to use the window name.
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowFocused (const char *WindowName, const bool CheckRootWindow)
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowFocused (const ImGuiID ID, const bool CheckRootWindow)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE bool LkEngine::UI::IsWindowDocked (T Identifier)
 Check if a window is docked, defaults to use the window name.
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowDocked< EFindType::ID > (const ImGuiID ID)
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowDocked< EFindType::Name > (const char *WindowName)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE bool LkEngine::UI::IsWindowHovered (T Identifier)
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowHovered< EFindType::Name > (const char *WindowName)
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowHovered< EFindType::ID > (const ImGuiID ID)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE bool LkEngine::UI::IsWindowAbove (T Window1, T Window2)
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowAbove< EFindType::Name > (const char *Window1Name, const char *Window2Name)
 
template<>
FORCEINLINE bool LkEngine::UI::IsWindowAbove< EFindType::ID > (const ImGuiID Window1ID, const ImGuiID Window2ID)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE bool LkEngine::UI::IsAnyWindowAbove (T Window)
 
template<>
FORCEINLINE bool LkEngine::UI::IsAnyWindowAbove< EFindType::Name > (const char *WindowName)
 
template<>
FORCEINLINE bool LkEngine::UI::IsAnyWindowAbove< EFindType::ID > (const ImGuiID WindowID)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE ImGuiWindow * LkEngine::UI::GetWindowAbove (T Window1, T Window2)
 
template<>
FORCEINLINE ImGuiWindow * LkEngine::UI::GetWindowAbove< EFindType::Name > (const char *Window1Name, const char *Window2Name)
 
template<>
FORCEINLINE ImGuiWindow * LkEngine::UI::GetWindowAbove< EFindType::ID > (const ImGuiID Window1ID, const ImGuiID Window2ID)
 
template<EFindType FindType = EFindType::Name, typename T = const char*>
FORCEINLINE ImVec2 LkEngine::UI::GetWindowSize (T Identifier)
 Check if a window is docked, defaults to use the window name.
 
template<>
FORCEINLINE ImVec2 LkEngine::UI::GetWindowSize< EFindType::ID > (const ImGuiID ID)
 
template<>
FORCEINLINE ImVec2 LkEngine::UI::GetWindowSize< EFindType::Name > (const char *WindowName)
 
FORCEINLINE ImGuiID LkEngine::UI::GetWindowID (const char *WindowName)
 
FORCEINLINE const char * LkEngine::UI::GetWindowName (const ImGuiID ID)
 
FORCEINLINE bool LkEngine::UI::IsItemDisabled ()
 
FORCEINLINE bool LkEngine::UI::IsItemHovered (const float DelayInSeconds=0.10f, ImGuiHoveredFlags Flags=ImGuiHoveredFlags_None)
 
FORCEINLINE ImRect LkEngine::UI::GetItemRect ()
 
FORCEINLINE ImRect LkEngine::UI::RectExpanded (const ImRect &Rect, const float x, const float y)
 
FORCEINLINE ImRect LkEngine::UI::RectOffset (const ImRect &Rect, const float x, const float y)
 
FORCEINLINE void LkEngine::UI::ShiftCursorX (const float Distance)
 
FORCEINLINE void LkEngine::UI::ShiftCursorY (const float Distance)
 
FORCEINLINE void LkEngine::UI::ShiftCursor (const float InX, const float InY)
 
FORCEINLINE void LkEngine::UI::DrawItemActivityOutline ()
 
FORCEINLINE void LkEngine::UI::HelpMarker (const char *HelpDesc, const char *HelpSymbol="(?)")
 
FORCEINLINE void LkEngine::UI::SetTooltip (std::string_view Text, const float DelayInSeconds=0.10f, const bool AllowWhenDisabled=true, const ImVec2 Padding=ImVec2(5, 5))
 
FORCEINLINE void LkEngine::UI::PopupMenuHeader (const std::string &Text, const bool IndentAfter=true, const bool UnindentBefore=false)
 
FORCEINLINE void LkEngine::UI::VSeparator (const float Height=10.0f)
 
void LkEngine::UI::Image (const TObjectPtr< LTexture2D > &texture, const ImVec2 &Size, const ImVec2 &UV0=ImVec2(0, 0), const ImVec2 &UV1=ImVec2(1, 1), const ImVec4 &TintColor=ImVec4(1, 1, 1, 1), const ImVec4 &BorderColor=ImVec4(0, 0, 0, 0))
 
void LkEngine::UI::Image (const TObjectPtr< LTexture2D > &Image, const glm::vec2 &Size, const glm::vec2 &UV0=glm::vec2(0, 0), const glm::vec2 &UV1=glm::vec2(1, 1), const glm::vec4 &TintColor=glm::vec4(1, 1, 1, 1), const glm::vec4 &BorderColor=glm::vec4(0, 0, 0, 0))
 
void LkEngine::UI::Image (const TObjectPtr< LImage2D > &Image, const ImVec2 &Size, const ImVec2 &UV0=ImVec2(0, 0), const ImVec2 &UV1=ImVec2(1, 1), const ImVec4 &TintColor=ImVec4(1, 1, 1, 1), const ImVec4 &BorderColor=ImVec4(0, 0, 0, 0))
 
void LkEngine::UI::Image (const TObjectPtr< LImage2D > &Image, const glm::vec2 &Size, const glm::vec2 &UV0=glm::vec2(0, 0), const glm::vec2 &UV1=glm::vec2(1, 1), const glm::vec4 &TintColor=glm::vec4(1, 1, 1, 1), const glm::vec4 &BorderColor=glm::vec4(0, 0, 0, 0))
 
FORCEINLINE void LkEngine::UI::Spring (const float Weight=1.0f)
 
FORCEINLINE void LkEngine::UI::AlignHorizontalCenter (const float ItemWidth)
 
FORCEINLINE bool LkEngine::UI::ColoredButton (const char *Label, const ImVec4 &BgColor, const ImVec2 &ButtonSize)
 
FORCEINLINE bool LkEngine::UI::ColoredButton (const char *Label, const ImVec4 &BgColor, const ImVec4 &FgColor, const ImVec2 &ButtonSize)
 
FORCEINLINE void LkEngine::UI::DrawButtonImage (const TObjectPtr< LTexture2D > &ImageNormal, const TObjectPtr< LTexture2D > &ImageHovered, const TObjectPtr< LTexture2D > &ImagePressed, const ImU32 TintNormal, const ImU32 TintHovered, const ImU32 TintPressed, const ImVec2 &RectMin, const ImVec2 &RectMax)
 
FORCEINLINE void LkEngine::UI::DrawButtonImage (const TObjectPtr< LTexture2D > &Image, const ImU32 TintNormal, const ImU32 TintHovered, const ImU32 TintPressed, const ImRect &Rectangle)
 

Variables

FOnSetPanelOpen LkEngine::OnSetPanelOpen
 
FIsPanelOpen LkEngine::IsPanelOpen
 
FOnMessageBoxCancelled LkEngine::UI::OnMessageBoxCancelled
 

Detailed Description

Typedef Documentation

◆ TPropertyMapping

template<typename T >
using LkEngine::UI::TPropertyMapping = std::pair<const char*, T>

Map a property to a type T.

Useful in dropdown menues.


Example (uint32_t):

constexpr std::array<UI::TPropertyMapping<uint32_t>, 2> Options = { std::pair("White", RGBA32::White), std::pair("Black", RGBA32::Black), };

Enumeration Type Documentation

◆ EFindType

enum class LkEngine::UI::EFindType
strong

Identifier type to use when attempting to find an object.

Function Documentation

◆ BeginViewport()

void LkEngine::UI::BeginViewport ( TObjectPtr< LWindow > Window)

The sidebar nodes do not get the same sizes even though the size ratios for the dock splitting is the same. A 0.04 increment in the right sidebar is needed to make the sizes the same.

◆ LK_DECLARE_DELEGATE_RET()

LkEngine::LK_DECLARE_DELEGATE_RET ( FIsPanelOpen ,
bool ,
const char *  )

Delegate: IsPanelOpen Defined in LPanelManager.

◆ LK_DECLARE_MULTICAST_DELEGATE()

LkEngine::LK_DECLARE_MULTICAST_DELEGATE ( FOnSetPanelOpen ,
const char * ,
const bool  )

Delegate: OnSetPanelOpen Defined in LPanelManager.