SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Begin() [1/2]

void Spices::ImguiSlate::Begin ( const std::string & panelName,
float alpha = 1.0f,
ImGuiWindowFlags flags = 0 )
protectedinherited

Begin a common slate with name.

Parameters
[in]panelNameThe name of Slate.
[in]alphaOpacity.
[in]flagsSlate flags.

Query Resize Event Condition.

Query Slate State, maybe implementate in parent.

Query Resize Event Condition.

Query Slate State, maybe implementate in parent.

Definition at line 19 of file ImguiUtils.cpp.

20 {
22
23 m_WindowFlags |= flags;
24 m_WindowFlags |= ImGuiWindowFlags_NoCollapse;
25
26 // The panel
27 if (alpha < 1)
28 {
29 ImGui::SetNextWindowBgAlpha(alpha); // For when the panel becomes a floating window
30 }
31
32 ImGui::Begin(panelName.c_str(), &m_IsSlateOn, m_WindowFlags);
33
34 if (ImGui::BeginPopupContextItem())
35 {
36 if (ImGui::MenuItem("Close"))
37 m_IsSlateOn = false;
38 ImGui::EndPopup();
39 }
40
44 QueryIsResizedThisFrame(ImGui::GetContentRegionAvail());
45
49 {
50 SPICES_PROFILE_ZONEN("Query Slate State");
51
52 m_PanelPos = ImGui::GetWindowPos();
53 m_IsFocused = ImGui::IsWindowFocused();
54 m_IsHovered = ImGui::IsWindowHovered();
55 }
56 }
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
bool m_IsHovered
True if Hovered.
Definition ImguiUtils.h:176
ImVec2 m_PanelPos
This slate's position in desktop.
Definition ImguiUtils.h:156
ImGuiWindowFlags m_WindowFlags
Flags of this window slate.
Definition ImguiUtils.h:191
virtual void QueryIsResizedThisFrame(const ImVec2 &thisFrameSize)
Query whether viewport is resized this frame.
bool m_IsFocused
True if Focus.
Definition ImguiUtils.h:171

References Spices::ImguiSlate::m_IsSlateOn.