mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
ImStrv: Step 2 - change ImStrv typedef to struct, perform all other logic conversion.
Squashed commits (initially a commit from rokups + many rework by ocornut. keeping them separate commits made rebasing unnecessarily tricking so merged from 2024/02) ImStrv: many fixes (see details), added imconfig class extension example, added natvis description. ImStrv: rework toward ensuring End is always set to constant can be compile time calculated ImStrv: using length(), fix ambiguous empty() function, fix altered behaviors, removed unused operators. ImStrv: various tweaks and fixes. removed ImGuiTextRange from ImGuiTextFilter, fix test engine hooks, removed constructor only used twice.
This commit is contained in:
parent
fd5f6016f8
commit
ef598afc79
9 changed files with 553 additions and 429 deletions
|
|
@ -5152,7 +5152,7 @@ static void DemoWindowLayout()
|
|||
case 2:
|
||||
ImVec4 clip_rect(p0.x, p0.y, p1.x, p1.y); // AddText() takes a ImVec4* here so let's convert.
|
||||
draw_list->AddRectFilled(p0, p1, IM_COL32(90, 90, 120, 255));
|
||||
draw_list->AddText(ImGui::GetFont(), ImGui::GetFontSize(), text_pos, IM_COL32_WHITE, text_str, NULL, 0.0f, &clip_rect);
|
||||
draw_list->AddText(ImGui::GetFont(), ImGui::GetFontSize(), text_pos, IM_COL32_WHITE, text_str, 0.0f, &clip_rect);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -9117,7 +9117,7 @@ struct ExampleAppConsole
|
|||
if (match_len > 0)
|
||||
{
|
||||
data->DeleteChars((int)(word_start - data->Buf), (int)(word_end - word_start));
|
||||
data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len);
|
||||
data->InsertChars(data->CursorPos, ImStrv(candidates[0], candidates[0] + match_len));
|
||||
}
|
||||
|
||||
// List matches
|
||||
|
|
@ -9252,8 +9252,8 @@ struct ExampleAppLog
|
|||
{
|
||||
const char* line_start = buf + LineOffsets[line_no];
|
||||
const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
|
||||
if (Filter.PassFilter(line_start, line_end))
|
||||
ImGui::TextUnformatted(line_start, line_end);
|
||||
if (Filter.PassFilter(ImStrv(line_start, line_end)))
|
||||
ImGui::TextUnformatted(ImStrv(line_start, line_end));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -9279,7 +9279,7 @@ struct ExampleAppLog
|
|||
{
|
||||
const char* line_start = buf + LineOffsets[line_no];
|
||||
const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
|
||||
ImGui::TextUnformatted(line_start, line_end);
|
||||
ImGui::TextUnformatted(ImStrv(line_start, line_end));
|
||||
}
|
||||
}
|
||||
clipper.End();
|
||||
|
|
@ -9584,7 +9584,7 @@ static void ShowExampleAppLongText(bool* p_open)
|
|||
{
|
||||
case 0:
|
||||
// Single call to TextUnformatted() with a big buffer
|
||||
ImGui::TextUnformatted(log.begin(), log.end());
|
||||
ImGui::TextUnformatted(ImStrv(log.begin(), log.end()));
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue