mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Added _None values to various enum flags, useful for readability and some coding style likes it. (Unfortunately we can't refer to them as default value in imgui.h functions because they need to be declared below).
This commit is contained in:
parent
2a6fbb2197
commit
ce0b36ba10
@ -2684,7 +2684,7 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
|
|||||||
return false;
|
return false;
|
||||||
if (!IsMouseHoveringRect(bb.Min, bb.Max))
|
if (!IsMouseHoveringRect(bb.Min, bb.Max))
|
||||||
return false;
|
return false;
|
||||||
if (g.NavDisableMouseHover || !IsWindowContentHoverable(window, ImGuiHoveredFlags_Default))
|
if (g.NavDisableMouseHover || !IsWindowContentHoverable(window, ImGuiHoveredFlags_None))
|
||||||
return false;
|
return false;
|
||||||
if (window->DC.ItemFlags & ImGuiItemFlags_Disabled)
|
if (window->DC.ItemFlags & ImGuiItemFlags_Disabled)
|
||||||
return false;
|
return false;
|
||||||
@ -5007,7 +5007,7 @@ bool ImGui::IsItemFocused()
|
|||||||
|
|
||||||
bool ImGui::IsItemClicked(int mouse_button)
|
bool ImGui::IsItemClicked(int mouse_button)
|
||||||
{
|
{
|
||||||
return IsMouseClicked(mouse_button) && IsItemHovered(ImGuiHoveredFlags_Default);
|
return IsMouseClicked(mouse_button) && IsItemHovered(ImGuiHoveredFlags_None);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui::IsAnyItemHovered()
|
bool ImGui::IsAnyItemHovered()
|
||||||
|
10
imgui.h
10
imgui.h
@ -582,6 +582,7 @@ namespace ImGui
|
|||||||
// Flags for ImGui::Begin()
|
// Flags for ImGui::Begin()
|
||||||
enum ImGuiWindowFlags_
|
enum ImGuiWindowFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiWindowFlags_None = 0,
|
||||||
ImGuiWindowFlags_NoTitleBar = 1 << 0, // Disable title-bar
|
ImGuiWindowFlags_NoTitleBar = 1 << 0, // Disable title-bar
|
||||||
ImGuiWindowFlags_NoResize = 1 << 1, // Disable user resizing with the lower-right grip
|
ImGuiWindowFlags_NoResize = 1 << 1, // Disable user resizing with the lower-right grip
|
||||||
ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window
|
ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window
|
||||||
@ -616,6 +617,7 @@ enum ImGuiWindowFlags_
|
|||||||
// Flags for ImGui::InputText()
|
// Flags for ImGui::InputText()
|
||||||
enum ImGuiInputTextFlags_
|
enum ImGuiInputTextFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiInputTextFlags_None = 0,
|
||||||
ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/
|
ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/
|
||||||
ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef
|
ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef
|
||||||
ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z
|
ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z
|
||||||
@ -641,6 +643,7 @@ enum ImGuiInputTextFlags_
|
|||||||
// Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
|
// Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
|
||||||
enum ImGuiTreeNodeFlags_
|
enum ImGuiTreeNodeFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiTreeNodeFlags_None = 0,
|
||||||
ImGuiTreeNodeFlags_Selected = 1 << 0, // Draw as selected
|
ImGuiTreeNodeFlags_Selected = 1 << 0, // Draw as selected
|
||||||
ImGuiTreeNodeFlags_Framed = 1 << 1, // Full colored frame (e.g. for CollapsingHeader)
|
ImGuiTreeNodeFlags_Framed = 1 << 1, // Full colored frame (e.g. for CollapsingHeader)
|
||||||
ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one
|
ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one
|
||||||
@ -666,6 +669,7 @@ enum ImGuiTreeNodeFlags_
|
|||||||
// Flags for ImGui::Selectable()
|
// Flags for ImGui::Selectable()
|
||||||
enum ImGuiSelectableFlags_
|
enum ImGuiSelectableFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiSelectableFlags_None = 0,
|
||||||
ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window
|
ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window
|
||||||
ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column)
|
ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column)
|
||||||
ImGuiSelectableFlags_AllowDoubleClick = 1 << 2 // Generate press events on double clicks too
|
ImGuiSelectableFlags_AllowDoubleClick = 1 << 2 // Generate press events on double clicks too
|
||||||
@ -674,6 +678,7 @@ enum ImGuiSelectableFlags_
|
|||||||
// Flags for ImGui::BeginCombo()
|
// Flags for ImGui::BeginCombo()
|
||||||
enum ImGuiComboFlags_
|
enum ImGuiComboFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiComboFlags_None = 0,
|
||||||
ImGuiComboFlags_PopupAlignLeft = 1 << 0, // Align the popup toward the left by default
|
ImGuiComboFlags_PopupAlignLeft = 1 << 0, // Align the popup toward the left by default
|
||||||
ImGuiComboFlags_HeightSmall = 1 << 1, // Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo()
|
ImGuiComboFlags_HeightSmall = 1 << 1, // Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo()
|
||||||
ImGuiComboFlags_HeightRegular = 1 << 2, // Max ~8 items visible (default)
|
ImGuiComboFlags_HeightRegular = 1 << 2, // Max ~8 items visible (default)
|
||||||
@ -687,6 +692,7 @@ enum ImGuiComboFlags_
|
|||||||
// Flags for ImGui::IsWindowFocused()
|
// Flags for ImGui::IsWindowFocused()
|
||||||
enum ImGuiFocusedFlags_
|
enum ImGuiFocusedFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiFocusedFlags_None = 0,
|
||||||
ImGuiFocusedFlags_ChildWindows = 1 << 0, // IsWindowFocused(): Return true if any children of the window is focused
|
ImGuiFocusedFlags_ChildWindows = 1 << 0, // IsWindowFocused(): Return true if any children of the window is focused
|
||||||
ImGuiFocusedFlags_RootWindow = 1 << 1, // IsWindowFocused(): Test from root window (top most parent of the current hierarchy)
|
ImGuiFocusedFlags_RootWindow = 1 << 1, // IsWindowFocused(): Test from root window (top most parent of the current hierarchy)
|
||||||
ImGuiFocusedFlags_AnyWindow = 1 << 2, // IsWindowFocused(): Return true if any window is focused
|
ImGuiFocusedFlags_AnyWindow = 1 << 2, // IsWindowFocused(): Return true if any window is focused
|
||||||
@ -697,7 +703,7 @@ enum ImGuiFocusedFlags_
|
|||||||
// Note: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that. Please read the FAQ!
|
// Note: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that. Please read the FAQ!
|
||||||
enum ImGuiHoveredFlags_
|
enum ImGuiHoveredFlags_
|
||||||
{
|
{
|
||||||
ImGuiHoveredFlags_Default = 0, // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them.
|
ImGuiHoveredFlags_None = 0, // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them.
|
||||||
ImGuiHoveredFlags_ChildWindows = 1 << 0, // IsWindowHovered() only: Return true if any children of the window is hovered
|
ImGuiHoveredFlags_ChildWindows = 1 << 0, // IsWindowHovered() only: Return true if any children of the window is hovered
|
||||||
ImGuiHoveredFlags_RootWindow = 1 << 1, // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
|
ImGuiHoveredFlags_RootWindow = 1 << 1, // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
|
||||||
ImGuiHoveredFlags_AnyWindow = 1 << 2, // IsWindowHovered() only: Return true if any window is hovered
|
ImGuiHoveredFlags_AnyWindow = 1 << 2, // IsWindowHovered() only: Return true if any window is hovered
|
||||||
@ -712,6 +718,7 @@ enum ImGuiHoveredFlags_
|
|||||||
// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
|
// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
|
||||||
enum ImGuiDragDropFlags_
|
enum ImGuiDragDropFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiDragDropFlags_None = 0,
|
||||||
// BeginDragDropSource() flags
|
// BeginDragDropSource() flags
|
||||||
ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior.
|
ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior.
|
||||||
ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return true, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item.
|
ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return true, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item.
|
||||||
@ -930,6 +937,7 @@ enum ImGuiStyleVar_
|
|||||||
// Enumeration for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
|
// Enumeration for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
|
||||||
enum ImGuiColorEditFlags_
|
enum ImGuiColorEditFlags_
|
||||||
{
|
{
|
||||||
|
ImGuiColorEditFlags_None = 0,
|
||||||
ImGuiColorEditFlags_NoAlpha = 1 << 1, // // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer).
|
ImGuiColorEditFlags_NoAlpha = 1 << 1, // // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer).
|
||||||
ImGuiColorEditFlags_NoPicker = 1 << 2, // // ColorEdit: disable picker when clicking on colored square.
|
ImGuiColorEditFlags_NoPicker = 1 << 2, // // ColorEdit: disable picker when clicking on colored square.
|
||||||
ImGuiColorEditFlags_NoOptions = 1 << 3, // // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
|
ImGuiColorEditFlags_NoOptions = 1 << 3, // // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
|
||||||
|
Loading…
Reference in New Issue
Block a user