mirror of
https://github.com/Drezil/imgui.git
synced 2025-02-16 22:42:44 +00:00
Misc: added GetItemID() in public API.
This commit is contained in:
parent
48215231f9
commit
1dae7df26f
@ -56,6 +56,9 @@ Other changes:
|
|||||||
We expect this behavior to be further improved/tweaked. (#3795, #4559) [@ocornut, @folays]
|
We expect this behavior to be further improved/tweaked. (#3795, #4559) [@ocornut, @folays]
|
||||||
- Text: fixed layouting of wrapped-text block when the last source line is above the
|
- Text: fixed layouting of wrapped-text block when the last source line is above the
|
||||||
clipping region. Regression added in 1.89. (#5720, #5919)
|
clipping region. Regression added in 1.89. (#5720, #5919)
|
||||||
|
- Misc: added GetItemID() in public API. It is not often expected that you would use this,
|
||||||
|
but it is useful for Shortcut() and upcoming owner-aware input functions which wants to
|
||||||
|
be implemented with public API.
|
||||||
- Fonts: added a 'void* UserData' field in ImFontAtlas, as a convenience for use by
|
- Fonts: added a 'void* UserData' field in ImFontAtlas, as a convenience for use by
|
||||||
applications using multiple font atlases.
|
applications using multiple font atlases.
|
||||||
- Demo: simplified "Inputs" section, moved contents to Metrics->Inputs.
|
- Demo: simplified "Inputs" section, moved contents to Metrics->Inputs.
|
||||||
|
@ -5148,6 +5148,12 @@ void ImGui::SetActiveIdUsingAllKeyboardKeys()
|
|||||||
NavMoveRequestCancel();
|
NavMoveRequestCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGuiID ImGui::GetItemID()
|
||||||
|
{
|
||||||
|
ImGuiContext& g = *GImGui;
|
||||||
|
return g.LastItemData.ID;
|
||||||
|
}
|
||||||
|
|
||||||
ImVec2 ImGui::GetItemRectMin()
|
ImVec2 ImGui::GetItemRectMin()
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
|
1
imgui.h
1
imgui.h
@ -845,6 +845,7 @@ namespace ImGui
|
|||||||
IMGUI_API bool IsAnyItemHovered(); // is any item hovered?
|
IMGUI_API bool IsAnyItemHovered(); // is any item hovered?
|
||||||
IMGUI_API bool IsAnyItemActive(); // is any item active?
|
IMGUI_API bool IsAnyItemActive(); // is any item active?
|
||||||
IMGUI_API bool IsAnyItemFocused(); // is any item focused?
|
IMGUI_API bool IsAnyItemFocused(); // is any item focused?
|
||||||
|
IMGUI_API ImGuiID GetItemID(); // get ID of last item (~~ often same ImGui::GetID(label) beforehand)
|
||||||
IMGUI_API ImVec2 GetItemRectMin(); // get upper-left bounding rectangle of the last item (screen space)
|
IMGUI_API ImVec2 GetItemRectMin(); // get upper-left bounding rectangle of the last item (screen space)
|
||||||
IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space)
|
IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space)
|
||||||
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item
|
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item
|
||||||
|
@ -2794,7 +2794,6 @@ namespace ImGui
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
// Basic Accessors
|
// Basic Accessors
|
||||||
inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.LastItemData.ID; } // Get ID of last item (~~ often same ImGui::GetID(label) beforehand)
|
|
||||||
inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
|
inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
|
||||||
inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; }
|
inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; }
|
||||||
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
|
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user