Lines Matching defs:buf

1909 int ImGui::DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format)
1913 return ImFormatString(buf, buf_size, format, *(const ImU32*)p_data);
1915 return ImFormatString(buf, buf_size, format, *(const ImU64*)p_data);
1917 return ImFormatString(buf, buf_size, format, *(const float*)p_data);
1919 return ImFormatString(buf, buf_size, format, *(const double*)p_data);
1921 return ImFormatString(buf, buf_size, format, *(const ImS8*)p_data);
1923 return ImFormatString(buf, buf_size, format, *(const ImU8*)p_data);
1925 return ImFormatString(buf, buf_size, format, *(const ImS16*)p_data);
1927 return ImFormatString(buf, buf_size, format, *(const ImU16*)p_data);
1984 bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format)
1986 while (ImCharIsBlankA(*buf))
1987 buf++;
1991 char op = buf[0];
1994 buf++;
1995 while (ImCharIsBlankA(*buf))
1996 buf++;
2002 if (!buf[0])
2023 if (op == '+') { if (sscanf(buf, "%d", &arg1i)) *v = (int)(arg0i + arg1i); } // Add (use "+-" to subtract)
2024 else if (op == '*') { if (sscanf(buf, "%f", &arg1f)) *v = (int)(arg0i * arg1f); } // Multiply
2025 else if (op == '/') { if (sscanf(buf, "%f", &arg1f) && arg1f != 0.0f) *v = (int)(arg0i / arg1f); } // Divide
2026 else { if (sscanf(buf, format, &arg1i) == 1) *v = arg1i; } // Assign constant
2036 if (sscanf(buf, format, &arg1f) < 1)
2050 if (sscanf(buf, format, &arg1f) < 1)
2061 if (sscanf(buf, format, p_data) < 1)
2068 if (sscanf(buf, format, &v32) < 1)
3315 // fmt = "%.3f hello" -> return buf written with "%.3f"
3316 const char* ImParseFormatTrimDecorations(const char* fmt, char* buf, size_t buf_size)
3324 ImStrncpy(buf, fmt_start, ImMin((size_t)(fmt_end - fmt_start) + 1, buf_size));
3325 return buf;
3354 bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags)
3364 bool value_changed = InputTextEx(label, NULL, buf, buf_size, bb.GetSize(), flags | ImGuiInputTextFlags_MergedItem);
3428 char buf[64];
3429 DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format);
3444 if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view
3445 value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
3481 if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
3482 value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
3583 bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
3586 return InputTextEx(label, NULL, buf, (int)buf_size, ImVec2(0, 0), flags, callback, user_data);
3589 bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
3591 return InputTextEx(label, NULL, buf, (int)buf_size, size, flags | ImGuiInputTextFlags_Multiline, callback, user_data);
3594 bool ImGui::InputTextWithHint(const char* label, const char* hint, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
3597 return InputTextEx(label, hint, buf, (int)buf_size, ImVec2(0, 0), flags, callback, user_data);
3940 // - When active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while the InputText is active has no effect.
3944 bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* callback_user_data)
3950 IM_ASSERT(buf != NULL && buf_size >= 0);
4048 // From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode)
4049 const int buf_len = (int)strlen(buf);
4051 memcpy(state->InitialTextA.Data, buf, buf_len + 1);
4057 state->TextAIsValid = false; // TextA is not valid yet (we will display buf until then)
4058 state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, buf_size, buf, NULL, &buf_end);
4059 state->CurLenA = (int)(buf_end - buf); // We can't get the result from ImStrncpy() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
4062 // FIXME: For non-readonly widgets we might be able to require that TextAIsValid && TextA == buf ? (untested) and discard undo stack if user buffer has changed.
4131 state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, buf, NULL, &buf_end);
4132 state->CurLenA = (int)(buf_end - buf);
4139 const bool is_displaying_hint = (hint != NULL && (buf_display_from_state ? state->TextA.Data : buf)[0] == 0);
4383 if (!is_readonly && strcmp(buf, state->InitialTextA.Data) != 0)
4406 // FIXME: We actually always render 'buf' when calling DrawList->AddText, making the comment above incorrect.
4491 if (!is_readonly && strcmp(state->TextA.Data, buf) != 0)
4510 callback_data.Buf = buf;
4515 buf = callback_data.Buf;
4523 ImStrncpy(buf, apply_new_text, ImMin(apply_new_text_length + 1, buf_size));
4552 const char* buf_display = buf_display_from_state ? state->TextA.Data : buf; //-V595
4924 char buf[64];
4926 ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", ImClamp(i[0], 0, 255), ImClamp(i[1], 0, 255), ImClamp(i[2], 0, 255), ImClamp(i[3], 0, 255));
4928 ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp(i[0], 0, 255), ImClamp(i[1], 0, 255), ImClamp(i[2], 0, 255));
4930 if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
4933 char* p = buf;
5609 char buf[64];
5610 ImFormatString(buf, IM_ARRAYSIZE(buf), "(%.3ff, %.3ff, %.3ff, %.3ff)", col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]);
5611 if (Selectable(buf))
5612 SetClipboardText(buf);
5613 ImFormatString(buf, IM_ARRAYSIZE(buf), "(%d,%d,%d,%d)", cr, cg, cb, ca);
5614 if (Selectable(buf))
5615 SetClipboardText(buf);
5616 ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", cr, cg, cb);
5617 if (Selectable(buf))
5618 SetClipboardText(buf);
5621 ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", cr, cg, cb, ca);
5622 if (Selectable(buf))
5623 SetClipboardText(buf);