mirror of
https://github.com/Drezil/imgui.git
synced 2025-09-17 00:23:13 +02:00
Tooltips: Added SetItemTooltip(), BeginItemTooltip(). Improved Demo section.
This commit is contained in:
9
imgui.h
9
imgui.h
@ -667,10 +667,17 @@ namespace ImGui
|
||||
// Tooltips
|
||||
// - Tooltips are windows following the mouse. They do not take focus away.
|
||||
IMGUI_API bool BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
|
||||
IMGUI_API void EndTooltip(); // only call EndTooltip() if BeginTooltip() returns true!
|
||||
IMGUI_API void EndTooltip(); // only call EndTooltip() if BeginTooltip()/BeginItemTooltip() returns true!
|
||||
IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().
|
||||
IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1);
|
||||
|
||||
// Tooltips: helper for showing a tooltip when hovering an item
|
||||
// - BeginItemTooltip(), SetItemTooltip() are shortcuts for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip)) { BeginTooltip() or SetTooltip() }' idiom.
|
||||
// - Where 'ImGuiHoveredFlags_Tooltip' itself is a shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav'. For mouse it defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'.
|
||||
IMGUI_API bool BeginItemTooltip(); // begin/append a tooltip window if preceding item was hovered.
|
||||
IMGUI_API void SetItemTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip if preceeding item was hovered. override any previous call to SetTooltip().
|
||||
IMGUI_API void SetItemTooltipV(const char* fmt, va_list args) IM_FMTLIST(1);
|
||||
|
||||
// Popups, Modals
|
||||
// - They block normal mouse hovering detection (and therefore most mouse interactions) behind them.
|
||||
// - If not modal: they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
|
||||
|
Reference in New Issue
Block a user