Lines Matching defs:flags
105 static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data);
388 bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags)
393 if (flags & ImGuiButtonFlags_Disabled)
402 if ((flags & (ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick)) == 0)
403 flags |= ImGuiButtonFlags_PressedOnClickRelease;
406 if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
422 if (g.DragDropActive && (flags & ImGuiButtonFlags_PressedOnDragDropHold) && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoHoldToOpenOthers))
434 if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
438 if (hovered && (flags & ImGuiButtonFlags_AllowItemOverlap) && (g.HoveredIdPreviousFrame != id && g.HoveredIdPreviousFrame != 0))
444 if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt))
452 if ((flags & ImGuiButtonFlags_PressedOnClickRelease) && g.IO.MouseClicked[0])
455 if (!(flags & ImGuiButtonFlags_NoNavFocus))
459 if (((flags & ImGuiButtonFlags_PressedOnClick) && g.IO.MouseClicked[0]) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseDoubleClicked[0]))
462 if (flags & ImGuiButtonFlags_NoHoldingActiveID)
468 if ((flags & ImGuiButtonFlags_PressedOnRelease) && g.IO.MouseReleased[0])
470 if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[0] >= g.IO.KeyRepeatDelay)) // Repeat mode trumps <on release>
475 // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above).
477 if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && g.IO.MouseDownDuration[0] > 0.0f && IsMouseClicked(0, true))
493 bool nav_activated_by_inputs = IsNavInputPressed(ImGuiNavInput_Activate, (flags & ImGuiButtonFlags_Repeat) ? ImGuiInputReadMode_Repeat : ImGuiInputReadMode_Pressed);
501 if ((nav_activated_by_code || nav_activated_by_inputs) && !(flags & ImGuiButtonFlags_NoNavFocus))
522 if (hovered && (flags & ImGuiButtonFlags_PressedOnClickRelease))
523 if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[0] >= g.IO.KeyRepeatDelay)) // Repeat mode trumps <on release>
528 if (!(flags & ImGuiButtonFlags_NoNavFocus))
544 bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags flags)
556 if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrentLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
566 flags |= ImGuiButtonFlags_Repeat;
568 bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
579 //if (pressed && !(flags & ImGuiButtonFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
626 bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiButtonFlags flags)
641 flags |= ImGuiButtonFlags_Repeat;
644 bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
950 bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value)
952 bool v = ((*flags & flags_value) == flags_value);
957 *flags |= flags_value;
959 *flags &= ~flags_value;
1148 // Those flags should eventually be overridable by the user
1149 ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal;
1150 IM_ASSERT(ImIsPowerOfTwo((int)(flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical)))); // Check that only 1 option is selected
1151 if (flags & ImGuiSeparatorFlags_Vertical)
1280 bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags)
1291 IM_ASSERT((flags & (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)) != (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)); // Can't use both flags together
1296 const float arrow_size = (flags & ImGuiComboFlags_NoArrowButton) ? 0.0f : GetFrameHeight();
1298 const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : CalcItemWidth();
1312 if (!(flags & ImGuiComboFlags_NoPreview))
1314 if (!(flags & ImGuiComboFlags_NoArrowButton))
1320 if (preview_value != NULL && !(flags & ImGuiComboFlags_NoPreview))
1343 if ((flags & ImGuiComboFlags_HeightMask_) == 0)
1344 flags |= ImGuiComboFlags_HeightRegular;
1345 IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiComboFlags_HeightMask_)); // Only one
1347 if (flags & ImGuiComboFlags_HeightRegular) popup_max_height_in_items = 8;
1348 else if (flags & ImGuiComboFlags_HeightSmall) popup_max_height_in_items = 4;
1349 else if (flags & ImGuiComboFlags_HeightLarge) popup_max_height_in_items = 20;
1361 if (flags & ImGuiComboFlags_PopupAlignLeft)
1730 bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const TYPE v_min, const TYPE v_max, const char* format, float power, ImGuiDragFlags flags)
1733 const ImGuiAxis axis = (flags & ImGuiDragFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
1834 bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* v, float v_speed, const void* v_min, const void* v_max, const char* format, float power, ImGuiDragFlags flags)
1849 case ImGuiDataType_S32: return DragBehaviorT<ImS32, ImS32, float >(data_type, (ImS32*)v, v_speed, v_min ? *(const ImS32* )v_min : IM_S32_MIN, v_max ? *(const ImS32* )v_max : IM_S32_MAX, format, power, flags);
1850 case ImGuiDataType_U32: return DragBehaviorT<ImU32, ImS32, float >(data_type, (ImU32*)v, v_speed, v_min ? *(const ImU32* )v_min : IM_U32_MIN, v_max ? *(const ImU32* )v_max : IM_U32_MAX, format, power, flags);
1851 case ImGuiDataType_S64: return DragBehaviorT<ImS64, ImS64, double>(data_type, (ImS64*)v, v_speed, v_min ? *(const ImS64* )v_min : IM_S64_MIN, v_max ? *(const ImS64* )v_max : IM_S64_MAX, format, power, flags);
1852 case ImGuiDataType_U64: return DragBehaviorT<ImU64, ImS64, double>(data_type, (ImU64*)v, v_speed, v_min ? *(const ImU64* )v_min : IM_U64_MIN, v_max ? *(const ImU64* )v_max : IM_U64_MAX, format, power, flags);
1853 case ImGuiDataType_Float: return DragBehaviorT<float, float, float >(data_type, (float*)v, v_speed, v_min ? *(const float* )v_min : -FLT_MAX, v_max ? *(const float* )v_max : FLT_MAX, format, power, flags);
1854 case ImGuiDataType_Double: return DragBehaviorT<double,double,double>(data_type, (double*)v, v_speed, v_min ? *(const double*)v_min : -DBL_MAX, v_max ? *(const double*)v_max : DBL_MAX, format, power, flags);
2104 bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, TYPE* v, const TYPE v_min, const TYPE v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
2109 const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
2269 bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
2275 return SliderBehaviorT<ImS32, ImS32, float >(bb, id, data_type, (ImS32*)v, *(const ImS32*)v_min, *(const ImS32*)v_max, format, power, flags, out_grab_bb);
2278 return SliderBehaviorT<ImU32, ImS32, float >(bb, id, data_type, (ImU32*)v, *(const ImU32*)v_min, *(const ImU32*)v_max, format, power, flags, out_grab_bb);
2281 return SliderBehaviorT<ImS64, ImS64, double>(bb, id, data_type, (ImS64*)v, *(const ImS64*)v_min, *(const ImS64*)v_max, format, power, flags, out_grab_bb);
2284 return SliderBehaviorT<ImU64, ImS64, double>(bb, id, data_type, (ImU64*)v, *(const ImU64*)v_min, *(const ImU64*)v_max, format, power, flags, out_grab_bb);
2287 return SliderBehaviorT<float, float, float >(bb, id, data_type, (float*)v, *(const float*)v_min, *(const float*)v_max, format, power, flags, out_grab_bb);
2290 return SliderBehaviorT<double,double,double>(bb, id, data_type, (double*)v, *(const double*)v_min, *(const double*)v_max, format, power, flags, out_grab_bb);
2631 ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ((data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double) ? ImGuiInputTextFlags_CharsScientific : ImGuiInputTextFlags_CharsDecimal);
2632 bool value_changed = InputTextEx(label, data_buf, IM_ARRAYSIZE(data_buf), bb.GetSize(), flags);
2644 bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_ptr, const void* step, const void* step_fast, const char* format, ImGuiInputTextFlags flags)
2661 if ((flags & (ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
2662 flags |= ImGuiInputTextFlags_CharsDecimal;
2663 flags |= ImGuiInputTextFlags_AutoSelectAll;
2672 if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view
2678 if (flags & ImGuiInputTextFlags_ReadOnly)
2700 if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
2707 bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* v, int components, const void* step, const void* step_fast, const char* format, ImGuiInputTextFlags flags)
2722 value_changed |= InputScalar("", data_type, v, step, step_fast, format, flags);
2735 bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, const char* format, ImGuiInputTextFlags flags)
2737 flags |= ImGuiInputTextFlags_CharsScientific;
2738 return InputScalar(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), format, flags);
2741 bool ImGui::InputFloat2(const char* label, float v[2], const char* format, ImGuiInputTextFlags flags)
2743 return InputScalarN(label, ImGuiDataType_Float, v, 2, NULL, NULL, format, flags);
2746 bool ImGui::InputFloat3(const char* label, float v[3], const char* format, ImGuiInputTextFlags flags)
2748 return InputScalarN(label, ImGuiDataType_Float, v, 3, NULL, NULL, format, flags);
2751 bool ImGui::InputFloat4(const char* label, float v[4], const char* format, ImGuiInputTextFlags flags)
2753 return InputScalarN(label, ImGuiDataType_Float, v, 4, NULL, NULL, format, flags);
2758 bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags flags)
2763 return InputFloat(label, v, step, step_fast, format, flags);
2766 bool ImGui::InputFloat2(const char* label, float v[2], int decimal_precision, ImGuiInputTextFlags flags)
2771 return InputScalarN(label, ImGuiDataType_Float, v, 2, NULL, NULL, format, flags);
2774 bool ImGui::InputFloat3(const char* label, float v[3], int decimal_precision, ImGuiInputTextFlags flags)
2779 return InputScalarN(label, ImGuiDataType_Float, v, 3, NULL, NULL, format, flags);
2782 bool ImGui::InputFloat4(const char* label, float v[4], int decimal_precision, ImGuiInputTextFlags flags)
2787 return InputScalarN(label, ImGuiDataType_Float, v, 4, NULL, NULL, format, flags);
2791 bool ImGui::InputInt(const char* label, int* v, int step, int step_fast, ImGuiInputTextFlags flags)
2794 const char* format = (flags & ImGuiInputTextFlags_CharsHexadecimal) ? "%08X" : "%d";
2795 return InputScalar(label, ImGuiDataType_S32, (void*)v, (void*)(step>0 ? &step : NULL), (void*)(step_fast>0 ? &step_fast : NULL), format, flags);
2798 bool ImGui::InputInt2(const char* label, int v[2], ImGuiInputTextFlags flags)
2800 return InputScalarN(label, ImGuiDataType_S32, v, 2, NULL, NULL, "%d", flags);
2803 bool ImGui::InputInt3(const char* label, int v[3], ImGuiInputTextFlags flags)
2805 return InputScalarN(label, ImGuiDataType_S32, v, 3, NULL, NULL, "%d", flags);
2808 bool ImGui::InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags)
2810 return InputScalarN(label, ImGuiDataType_S32, v, 4, NULL, NULL, "%d", flags);
2813 bool ImGui::InputDouble(const char* label, double* v, double step, double step_fast, const char* format, ImGuiInputTextFlags flags)
2815 flags |= ImGuiInputTextFlags_CharsScientific;
2816 return InputScalar(label, ImGuiDataType_Double, (void*)v, (void*)(step>0.0 ? &step : NULL), (void*)(step_fast>0.0 ? &step_fast : NULL), format, flags);
2827 bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
2829 IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline()
2830 return InputTextEx(label, buf, (int)buf_size, ImVec2(0,0), flags, callback, user_data);
2833 bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
2835 return InputTextEx(label, buf, (int)buf_size, size, flags | ImGuiInputTextFlags_Multiline, callback, user_data);
3065 static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
3072 pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline));
3073 pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput));
3081 if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific))
3083 if (flags & ImGuiInputTextFlags_CharsDecimal)
3087 if (flags & ImGuiInputTextFlags_CharsScientific)
3091 if (flags & ImGuiInputTextFlags_CharsHexadecimal)
3095 if (flags & ImGuiInputTextFlags_CharsUppercase)
3099 if (flags & ImGuiInputTextFlags_CharsNoBlank)
3104 if (flags & ImGuiInputTextFlags_CallbackCharFilter)
3110 callback_data.Flags = flags;
3129 bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* callback_user_data)
3135 IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackHistory) && (flags & ImGuiInputTextFlags_Multiline))); // Can't use both together (they both use up/down keys)
3136 IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackCompletion) && (flags & ImGuiInputTextFlags_AllowTabInput))); // Can't use both together (they both use tab key)
3142 const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0;
3143 const bool is_editable = (flags & ImGuiInputTextFlags_ReadOnly) == 0;
3144 const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0;
3145 const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0;
3146 const bool is_resizable = (flags & ImGuiInputTextFlags_CallbackResize) != 0;
3207 const bool focus_requested = FocusableItemRegister(window, id, (flags & (ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_AllowTabInput)) == 0); // Using completion callback disable keyboard tabbing
3217 bool select_all = (g.ActiveId != id) && ((flags & ImGuiInputTextFlags_AutoSelectAll) != 0 || user_nav_input_start) && (!is_multiline);
3252 if (flags & ImGuiInputTextFlags_AlwaysInsertMode)
3261 if (!is_multiline && !(flags & ImGuiInputTextFlags_CallbackHistory))
3288 edit_state.UserFlags = flags;
3340 if (InputTextFilterCharacter(&c, flags, callback, callback_user_data))
3386 bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0;
3394 if (InputTextFilterCharacter(&c, flags, callback, callback_user_data))
3398 else if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressedMap(ImGuiKey_Tab) && !io.KeyCtrl && !io.KeyShift && !io.KeyAlt && is_editable)
3401 if (InputTextFilterCharacter(&c, flags, callback, callback_user_data))
3451 if (c >= 0x10000 || !InputTextFilterCharacter(&c, flags, callback, callback_user_data))
3482 bool apply_edit_back_to_user_buffer = !cancel_edit || (enter_pressed && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0);
3496 if ((flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackAlways)) != 0)
3503 if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressedMap(ImGuiKey_Tab))
3508 else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_UpArrow))
3513 else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_DownArrow))
3518 else if (flags & ImGuiInputTextFlags_CallbackAlways)
3526 callback_data.Flags = flags;
3547 IM_ASSERT(callback_data.Flags == flags);
3579 callback_data.Flags = flags;
3686 if (!(flags & ImGuiInputTextFlags_NoHorizontalScroll))
3799 if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0)
3820 bool ImGui::ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flags)
3822 return ColorEdit4(label, col, flags | ImGuiColorEditFlags_NoAlpha);
3828 bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags)
3837 const float w_extra = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x);
3845 const ImGuiColorEditFlags flags_untouched = flags;
3846 if (flags & ImGuiColorEditFlags_NoInputs)
3847 flags = (flags & (~ImGuiColorEditFlags__InputsMask)) | ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_NoOptions;
3850 if (!(flags & ImGuiColorEditFlags_NoOptions))
3851 ColorEditOptionsPopup(col, flags);
3854 if (!(flags & ImGuiColorEditFlags__InputsMask))
3855 flags |= (g.ColorEditOptions & ImGuiColorEditFlags__InputsMask);
3856 if (!(flags & ImGuiColorEditFlags__DataTypeMask))
3857 flags |= (g.ColorEditOptions & ImGuiColorEditFlags__DataTypeMask);
3858 if (!(flags & ImGuiColorEditFlags__PickerMask))
3859 flags |= (g.ColorEditOptions & ImGuiColorEditFlags__PickerMask);
3860 flags |= (g.ColorEditOptions & ~(ImGuiColorEditFlags__InputsMask | ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask));
3862 const bool alpha = (flags & ImGuiColorEditFlags_NoAlpha) == 0;
3863 const bool hdr = (flags & ImGuiColorEditFlags_HDR) != 0;
3868 if (flags & ImGuiColorEditFlags_HSV)
3875 if ((flags & (ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
3881 const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x);
3895 const int fmt_idx = hide_prefix ? 0 : (flags & ImGuiColorEditFlags_HSV) ? 2 : 1;
3904 if (flags & ImGuiColorEditFlags_Float)
3913 if (!(flags & ImGuiColorEditFlags_NoOptions))
3919 else if ((flags & ImGuiColorEditFlags_HEX) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
3940 if (!(flags & ImGuiColorEditFlags_NoOptions))
3946 if (!(flags & ImGuiColorEditFlags_NoSmallPreview))
3948 if (!(flags & ImGuiColorEditFlags_NoInputs))
3952 if (ColorButton("##ColorButton", col_v4, flags))
3954 if (!(flags & ImGuiColorEditFlags_NoPicker))
3962 if (!(flags & ImGuiColorEditFlags_NoOptions))
3982 if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel))
3994 if (flags & ImGuiColorEditFlags_HSV)
4011 if ((window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget())
4036 bool ImGui::ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags)
4039 if (!ColorPicker4(label, col4, flags | ImGuiColorEditFlags_NoAlpha))
4102 bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags, const float* ref_col)
4114 if (!(flags & ImGuiColorEditFlags_NoSidePreview))
4115 flags |= ImGuiColorEditFlags_NoSmallPreview;
4118 if (!(flags & ImGuiColorEditFlags_NoOptions))
4119 ColorPickerOptionsPopup(col, flags);
4122 if (!(flags & ImGuiColorEditFlags__PickerMask))
4123 flags |= ((g.ColorEditOptions & ImGuiColorEditFlags__PickerMask) ? g.ColorEditOptions : ImGuiColorEditFlags__OptionsDefault) & ImGuiColorEditFlags__PickerMask;
4124 IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__PickerMask))); // Check that only 1 is selected
4125 if (!(flags & ImGuiColorEditFlags_NoOptions))
4126 flags |= (g.ColorEditOptions & ImGuiColorEditFlags_AlphaBar);
4129 int components = (flags & ImGuiColorEditFlags_NoAlpha) ? 3 : 4;
4130 bool alpha_bar = (flags & ImGuiColorEditFlags_AlphaBar) && !(flags & ImGuiColorEditFlags_NoAlpha);
4159 if (flags & ImGuiColorEditFlags_PickerHueWheel)
4191 if (!(flags & ImGuiColorEditFlags_NoOptions))
4194 else if (flags & ImGuiColorEditFlags_PickerHueBar)
4204 if (!(flags & ImGuiColorEditFlags_NoOptions))
4230 if (!(flags & ImGuiColorEditFlags_NoSidePreview))
4236 if (!(flags & ImGuiColorEditFlags_NoLabel))
4241 if ((flags & ImGuiColorEditFlags_NoSidePreview))
4247 if (!(flags & ImGuiColorEditFlags_NoSidePreview))
4250 ImVec4 col_v4(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]);
4251 if ((flags & ImGuiColorEditFlags_NoLabel))
4253 ColorButton("##current", col_v4, (flags & (ImGuiColorEditFlags_HDR|ImGuiColorEditFlags_AlphaPreview|ImGuiColorEditFlags_AlphaPreviewHalf|ImGuiColorEditFlags_NoTooltip)), ImVec2(square_sz * 3, square_sz * 2));
4257 ImVec4 ref_col_v4(ref_col[0], ref_col[1], ref_col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : ref_col[3]);
4258 if (ColorButton("##original", ref_col_v4, (flags & (ImGuiColorEditFlags_HDR|ImGuiColorEditFlags_AlphaPreview|ImGuiColorEditFlags_AlphaPreviewHalf|ImGuiColorEditFlags_NoTooltip)), ImVec2(square_sz * 3, square_sz * 2)))
4274 if ((flags & ImGuiColorEditFlags_NoInputs) == 0)
4278 ImGuiColorEditFlags sub_flags = (flags & sub_flags_to_forward) | ImGuiColorEditFlags_NoPicker;
4279 if (flags & ImGuiColorEditFlags_RGB || (flags & ImGuiColorEditFlags__InputsMask) == 0)
4287 if (flags & ImGuiColorEditFlags_HSV || (flags & ImGuiColorEditFlags__InputsMask) == 0)
4289 if (flags & ImGuiColorEditFlags_HEX || (flags & ImGuiColorEditFlags__InputsMask) == 0)
4315 if (flags & ImGuiColorEditFlags_PickerHueWheel)
4360 else if (flags & ImGuiColorEditFlags_PickerHueBar)
4410 bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags, ImVec2 size)
4431 if (flags & ImGuiColorEditFlags_NoAlpha)
4432 flags &= ~(ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf);
4440 if ((flags & ImGuiColorEditFlags_AlphaPreviewHalf) && col.w < 1.0f)
4449 ImVec4 col_source = (flags & ImGuiColorEditFlags_AlphaPreview) ? col : col_without_alpha;
4463 if (g.ActiveId == id && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropSource())
4465 if (flags & ImGuiColorEditFlags_NoAlpha)
4469 ColorButton(desc_id, col, flags);
4476 if (!(flags & ImGuiColorEditFlags_NoTooltip) && hovered)
4477 ColorTooltip(desc_id, &col.x, flags & (ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf));
4485 void ImGui::SetColorEditOptions(ImGuiColorEditFlags flags)
4488 if ((flags & ImGuiColorEditFlags__InputsMask) == 0)
4489 flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__InputsMask;
4490 if ((flags & ImGuiColorEditFlags__DataTypeMask) == 0)
4491 flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__DataTypeMask;
4492 if ((flags & ImGuiColorEditFlags__PickerMask) == 0)
4493 flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__PickerMask;
4494 IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__InputsMask))); // Check only 1 option is selected
4495 IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__DataTypeMask))); // Check only 1 option is selected
4496 IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__PickerMask))); // Check only 1 option is selected
4497 g.ColorEditOptions = flags;
4501 void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags)
4505 int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]);
4516 ColorButton("##preview", ImVec4(col[0], col[1], col[2], col[3]), (flags & (ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)) | ImGuiColorEditFlags_NoTooltip, sz);
4518 if (flags & ImGuiColorEditFlags_NoAlpha)
4525 void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags)
4527 bool allow_opt_inputs = !(flags & ImGuiColorEditFlags__InputsMask);
4528 bool allow_opt_datatype = !(flags & ImGuiColorEditFlags__DataTypeMask);
4552 int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]);
4554 ImFormatString(buf, IM_ARRAYSIZE(buf), "(%.3ff, %.3ff, %.3ff, %.3ff)", col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]);
4560 if (flags & ImGuiColorEditFlags_NoAlpha)
4573 void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags)
4575 bool allow_opt_picker = !(flags & ImGuiColorEditFlags__PickerMask);
4576 bool allow_opt_alpha_bar = !(flags & ImGuiColorEditFlags_NoAlpha) && !(flags & ImGuiColorEditFlags_AlphaBar);
4589 ImGuiColorEditFlags picker_flags = ImGuiColorEditFlags_NoInputs|ImGuiColorEditFlags_NoOptions|ImGuiColorEditFlags_NoLabel|ImGuiColorEditFlags_NoSidePreview|(flags & ImGuiColorEditFlags_NoAlpha);
4663 bool ImGui::TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags)
4669 return TreeNodeBehavior(window->GetID(label), flags, label, NULL);
4672 bool ImGui::TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...)
4676 bool is_open = TreeNodeExV(str_id, flags, fmt, args);
4681 bool ImGui::TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...)
4685 bool is_open = TreeNodeExV(ptr_id, flags, fmt, args);
4690 bool ImGui::TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args)
4698 return TreeNodeBehavior(window->GetID(str_id), flags, g.TempBuffer, label_end);
4701 bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args)
4709 return TreeNodeBehavior(window->GetID(ptr_id), flags, g.TempBuffer, label_end);
4712 bool ImGui::TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
4714 if (flags & ImGuiTreeNodeFlags_Leaf)
4748 is_open = storage->GetInt(id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0;
4753 if (g.LogEnabled && !(flags & ImGuiTreeNodeFlags_NoAutoOpenOnLog) && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
4759 bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end)
4767 const bool display_frame = (flags & ImGuiTreeNodeFlags_Framed) != 0;
4768 const ImVec2 padding = (display_frame || (flags & ImGuiTreeNodeFlags_FramePadding)) ? style.FramePadding : ImVec2(style.FramePadding.x, 0.0f);
4792 bool is_open = TreeNodeBehaviorIsOpen(id, flags);
4793 bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0;
4798 if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
4807 if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
4819 if (flags & ImGuiTreeNodeFlags_AllowItemOverlap)
4821 if (flags & ImGuiTreeNodeFlags_OpenOnDoubleClick)
4822 button_flags |= ImGuiButtonFlags_PressedOnDoubleClick | ((flags & ImGuiTreeNodeFlags_OpenOnArrow) ? ImGuiButtonFlags_PressedOnClickRelease : 0);
4826 bool selected = (flags & ImGuiTreeNodeFlags_Selected) != 0;
4834 toggled = !(flags & (ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) || (g.NavActivateId == id);
4835 if (flags & ImGuiTreeNodeFlags_OpenOnArrow)
4837 if (flags & ImGuiTreeNodeFlags_OpenOnDoubleClick)
4860 if (flags & ImGuiTreeNodeFlags_AllowItemOverlap)
4896 if (flags & ImGuiTreeNodeFlags_Bullet)
4905 if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
4978 bool ImGui::CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags)
4984 return TreeNodeBehavior(window->GetID(label), flags | ImGuiTreeNodeFlags_CollapsingHeader, label);
4987 bool ImGui::CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags)
4997 bool is_open = TreeNodeBehavior(id, flags | ImGuiTreeNodeFlags_CollapsingHeader | (p_open ? ImGuiTreeNodeFlags_AllowItemOverlap : 0), label);
5021 bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
5030 if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet) // FIXME-OPT: Avoid if vertically clipped.
5043 float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? GetWindowContentRegionMax().x : GetContentRegionMax().x;
5045 ImVec2 size_draw((size_arg.x != 0 && !(flags & ImGuiSelectableFlags_DrawFillAvailWidth)) ? size_arg.x : w_draw, size_arg.y != 0.0f ? size_arg.y : size.y);
5047 if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_DrawFillAvailWidth))
5061 if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet)
5068 if (flags & ImGuiSelectableFlags_NoHoldingActiveID) button_flags |= ImGuiButtonFlags_NoHoldingActiveID;
5069 if (flags & ImGuiSelectableFlags_PressedOnClick) button_flags |= ImGuiButtonFlags_PressedOnClick;
5070 if (flags & ImGuiSelectableFlags_PressedOnRelease) button_flags |= ImGuiButtonFlags_PressedOnRelease;
5071 if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled;
5072 if (flags & ImGuiSelectableFlags_AllowDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick;
5073 if (flags & ImGuiSelectableFlags_Disabled)
5096 if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet)
5102 if (flags & ImGuiSelectableFlags_Disabled) PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
5104 if (flags & ImGuiSelectableFlags_Disabled) PopStyleColor();
5107 if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(window->DC.ItemFlags & ImGuiItemFlags_SelectableDontClosePopup))
5112 bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
5114 if (Selectable(label, *p_selected, flags, size_arg))
5719 ImGuiWindowFlags flags = ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoNavFocus;
5721 flags |= ImGuiWindowFlags_ChildWindow;
5722 menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
5755 ImGuiSelectableFlags flags = ImGuiSelectableFlags_PressedOnRelease | (enabled ? 0 : ImGuiSelectableFlags_Disabled);
5764 pressed = Selectable(label, false, flags, ImVec2(w, 0.0f));
5773 pressed = Selectable(label, false, flags | ImGuiSelectableFlags_DrawFillAvailWidth, ImVec2(w, 0.0f));
5863 bool ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags)
5874 return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused);
5877 bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImGuiTabBarFlags flags)
5884 if ((flags & ImGuiTabBarFlags_DockNode) == 0)
5897 if ((flags & ImGuiTabBarFlags_Reorderable) && !(tab_bar->Flags & ImGuiTabBarFlags_Reorderable) && tab_bar->Tabs.Size > 1 && tab_bar->PrevFrameVisible != -1)
5901 if ((flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0)
5902 flags |= ImGuiTabBarFlags_FittingPolicyDefault_;
5904 tab_bar->Flags = flags;
5916 const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_Tab);
6308 bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags flags)
6316 bool ret = TabItemEx(tab_bar, label, p_open, flags);
6317 if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
6339 bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags)
6380 flags |= ImGuiTabItemFlags_NoCloseButton;
6386 tab->Flags = flags;
6456 if (pressed || ((flags & ImGuiTabItemFlags_SetSelected) && !tab_contents_visible)) // SetSelected can only be passed on explicit tab bar
6488 TabItemBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive));
6495 TabItemBackground(display_draw_list, bb, flags, tab_col);
6504 flags |= ImGuiTabItemFlags_NoCloseWithMiddleMouseButton;
6508 bool just_closed = TabItemLabelAndCloseButton(display_draw_list, bb, flags, tab_bar->FramePadding, label, id, close_button_id);
6555 void ImGui::TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col)
6560 IM_UNUSED(flags);
6582 bool ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id)
6592 if (flags & ImGuiTabItemFlags_UnsavedDocument)
6619 if (!(flags & ImGuiTabItemFlags_NoCloseWithMiddleMouseButton) && IsMouseClicked(2))