Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/bind-imgui.js

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions build/imgui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,15 @@ export { IM_UNICODE_CODEPOINT_MAX as UNICODE_CODEPOINT_MAX };
export declare const IM_UNICODE_CODEPOINT_MAX: number;
export { ImGuiTextFilter as TextFilter };
export declare class ImGuiTextFilter {
constructor(default_filter?: string);
Draw(label?: string, width?: number): boolean;
PassFilter(text: string, text_end?: number | null): boolean;
Build(): void;
Filters: string[];
CountGrep: number;
InputBuf: ImStringBuffer;
constructor(defaultFilter: string | null);
Clear(): void;
IsActive(): boolean;
InputBuf: ImStringBuffer;
CountGrep: number;
Draw(label?: string, width?: number): boolean;
Build(): void;
PassFilter(text: string): boolean;
}
export { ImGuiTextBuffer as TextBuffer };
export declare class ImGuiTextBuffer {
Expand Down
136 changes: 59 additions & 77 deletions build/imgui.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/imgui.js.map

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions example/build/imgui_demo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/build/imgui_demo.js.map

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions example/src/imgui_demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5670,7 +5670,7 @@ function ShowDemoWindowMisc(): void
{
// Helper class to easy setup a text filter.
// You may want to implement a more feature-full filtering scheme in your own application.
const filter = STATIC<ImGui.TextFilter>(UNIQUE("filter#51f8d318"), new ImGui.TextFilter());
const filter = STATIC<ImGui.TextFilter>(UNIQUE("filter#51f8d318"), new ImGui.TextFilter(""));
ImGui.Text("Filter usage:\n" +
" \"\" display all lines\n" +
" \"xxx\" display lines containing \"xxx\"\n" +
Expand Down Expand Up @@ -6266,7 +6266,7 @@ function /*ImGui.*/ShowStyleEditor(ref: ImGui.Style | null = null): void
ImGui.SameLine(); ImGui.SetNextItemWidth(120); ImGui.Combo("##output_type", output_dest.access, "To Clipboard\0To TTY\0");
ImGui.SameLine(); ImGui.Checkbox("Only Modified Colors", output_only_modified.access);

const filter = STATIC<ImGui.TextFilter>(UNIQUE("filter#82eacb19"), new ImGui.TextFilter());
const filter = STATIC<ImGui.TextFilter>(UNIQUE("filter#82eacb19"), new ImGui.TextFilter(""));
filter.value.Draw("Filter colors", ImGui.GetFontSize() * 16);

const alpha_flags = STATIC<ImGui.ColorEditFlags>(UNIQUE("alpha_flags#5b075799"), 0);
Expand Down Expand Up @@ -6530,7 +6530,7 @@ class ExampleAppConsole
public Commands: ImGui.Vector<string> = new ImGui.Vector<string>();
public History: ImGui.Vector<string> = new ImGui.Vector<string>();
public HistoryPos: float = -1; // -1: new line, 0..this.History.Size-1 browsing history.
public Filter: ImGui.TextFilter = new ImGui.TextFilter();
public Filter: ImGui.TextFilter = new ImGui.TextFilter("");
public AutoScroll: boolean = true;
public ScrollToBottom: boolean = false;

Expand Down Expand Up @@ -6902,7 +6902,7 @@ function ShowExampleAppConsole(p_open: ImGui.Access<boolean>): void
class ExampleAppLog
{
Buf: ImGui.TextBuffer = new ImGui.TextBuffer();
Filter: ImGui.TextFilter = new ImGui.TextFilter();
Filter: ImGui.TextFilter = new ImGui.TextFilter("");
LineOffsets: ImGui.Vector<int> = new ImGui.Vector(); // Index to lines offset. We maintain this with this.AddLog() calls.
AutoScroll: boolean; // Keep scrolling if already at the bottom.

Expand Down Expand Up @@ -6975,14 +6975,13 @@ class ExampleAppLog
// This is because we don't have a random access on the result on our filter.
// A real application processing logs with ten of thousands of entries may want to store the result of
// search/filter.. especially if the filtering function is not trivial (e.g. reg-exp).
for (let line_no = 0; line_no < this.LineOffsets.Size; line_no++)
var _s = this.Buf.Buf.split('\n')
for (let line_no = 0; line_no < _s.length; line_no++)
{
// string line_start = buf + this.LineOffsets[line_no];
// string line_end = (line_no + 1 < this.LineOffsets.Size) ? (buf + this.LineOffsets[line_no + 1] - 1) : buf_end;
const line_start = this.Buf.Buf.substr(this.LineOffsets[line_no]);
const line_end = (line_no + 1 < this.LineOffsets.Size) ? this.LineOffsets[line_no + 1] - 1 : buf_end;
if (this.Filter.PassFilter(line_start, line_end))
ImGui.TextUnformatted(line_start, line_end);
if (this.Filter.PassFilter(_s[line_no]))
ImGui.TextUnformatted(_s[line_no]);
}
}
else
Expand Down
Loading