1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-12-01 02:37:24 +01:00

Minor tidying up following (#516) - renamed ImGuiSelectableFlags_HandleDoubleClick to ImGuiSelectableFlags_AllowDoubleClick + comments

This commit is contained in:
ocornut 2016-03-03 00:30:08 +01:00
parent 6846873f23
commit b816d05e33
4 changed files with 12 additions and 14 deletions

View File

@ -8147,7 +8147,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
if (flags & ImGuiSelectableFlags_Menu) button_flags |= ImGuiButtonFlags_PressedOnClick; if (flags & ImGuiSelectableFlags_Menu) button_flags |= ImGuiButtonFlags_PressedOnClick;
if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnClick|ImGuiButtonFlags_PressedOnRelease; if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnClick|ImGuiButtonFlags_PressedOnRelease;
if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled; if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled;
if (flags & ImGuiSelectableFlags_HandleDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnDoubleClick; if (flags & ImGuiSelectableFlags_AllowDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnDoubleClick;
bool hovered, held; bool hovered, held;
bool pressed = ButtonBehavior(bb_with_spacing, id, &hovered, &held, button_flags); bool pressed = ButtonBehavior(bb_with_spacing, id, &hovered, &held, button_flags);
if (flags & ImGuiSelectableFlags_Disabled) if (flags & ImGuiSelectableFlags_Disabled)

View File

@ -506,7 +506,7 @@ enum ImGuiSelectableFlags_
// Default: 0 // Default: 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_HandleDoubleClick = 1 << 2 // Generate press events on double clicks too ImGuiSelectableFlags_AllowDoubleClick = 1 << 2 // Generate press events on double clicks too
}; };
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array // User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array

View File

@ -397,11 +397,9 @@ void ImGui::ShowTestWindow(bool* p_opened)
ImGui::Selectable("2. I am selectable", &selected[1]); ImGui::Selectable("2. I am selectable", &selected[1]);
ImGui::Text("3. I am not selectable"); ImGui::Text("3. I am not selectable");
ImGui::Selectable("4. I am selectable", &selected[2]); ImGui::Selectable("4. I am selectable", &selected[2]);
if (ImGui::Selectable("5. I am double clickable", selected[3], ImGuiSelectableFlags_HandleDoubleClick)) if (ImGui::Selectable("5. I am double clickable", selected[3], ImGuiSelectableFlags_AllowDoubleClick))
{
if (ImGui::IsMouseDoubleClicked(0)) if (ImGui::IsMouseDoubleClicked(0))
selected[3] = !selected[3]; selected[3] = !selected[3];
}
ImGui::TreePop(); ImGui::TreePop();
} }
if (ImGui::TreeNode("Rendering more text into the same block")) if (ImGui::TreeNode("Rendering more text into the same block"))

View File

@ -152,15 +152,15 @@ inline void operator delete(void*, ImPlacementNewDummy, void*) {}
enum ImGuiButtonFlags_ enum ImGuiButtonFlags_
{ {
ImGuiButtonFlags_Repeat = 1 << 0, ImGuiButtonFlags_Repeat = 1 << 0, // hold to repeat
ImGuiButtonFlags_PressedOnClick = 1 << 1, // return pressed on click only (default requires click+release) ImGuiButtonFlags_PressedOnClick = 1 << 1, // return pressed on click (default requires click+release)
ImGuiButtonFlags_PressedOnRelease = 1 << 2, // return pressed on release only (default requires click+release) ImGuiButtonFlags_PressedOnRelease = 1 << 2, // return pressed on release (default requires click+release)
ImGuiButtonFlags_FlattenChilds = 1 << 3, ImGuiButtonFlags_PressedOnDoubleClick = 1 << 3, // return pressed on double-click (default requires click+release)
ImGuiButtonFlags_DontClosePopups = 1 << 4, ImGuiButtonFlags_FlattenChilds = 1 << 4, // allow interaction even if a child window is overlapping
ImGuiButtonFlags_Disabled = 1 << 5, ImGuiButtonFlags_DontClosePopups = 1 << 5, // disable automatically closing parent popup on press
ImGuiButtonFlags_AlignTextBaseLine = 1 << 6, ImGuiButtonFlags_Disabled = 1 << 6, // disable interaction
ImGuiButtonFlags_NoKeyModifiers = 1 << 7, ImGuiButtonFlags_AlignTextBaseLine = 1 << 7, // vertically align button to match text baseline - ButtonEx() only
ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8 ImGuiButtonFlags_NoKeyModifiers = 1 << 8, // disable interaction if a key modifier is held
}; };
enum ImGuiTreeNodeFlags_ enum ImGuiTreeNodeFlags_