ImGuiColorTextEdit: a code editor widget with syntax highlighting, and a text diff viewer.
The C++ API of ImGuiColorTextEdit as it is bound to Python: the entries of the module imgui_bundle.imgui_color_text_edit, in the same order, with their C++ signatures and the headers’ comments. From the stubs: the functions excluded from the bindings, the typedefs and the macros are absent.
TextEditor.h¶
TextEditor¶
TextEditor (struct)¶
TextEditor::TextEditor¶
TextEditor();constructor
TextEditor::DocPos (struct)¶
| Member | |
|---|---|
size_t line = 0; | |
size_t index = 0; |
TextEditor::DocPos::DocPos¶
DocPos() = default;DocPos(size_t line, size_t index) : line(line), index(index);represents the logical position of a glyph in a document expressed as a line number and glyph index (both zero-based)
TextEditor::DocSelection (struct)¶
| Member | |
|---|---|
DocPos start; | |
DocPos end; |
TextEditor::DocSelection::DocSelection¶
DocSelection() = default;DocSelection(DocPos start, DocPos end) : start(start), end(end);represents a range of glyphs from a starting position to an end position
TextEditor::VisPos (struct)¶
| Member | |
|---|---|
size_t row = 0; | |
size_t column = 0; |
TextEditor::VisPos::VisPos¶
VisPos() = default;VisPos(size_t row, size_t column) : row(row), column(column);represents the visual position of a glyph expressed as a visible row and column number (both zero-based) this is not necessarily the same as the document position tabs create a horizontal offset between index and column word-wrapping creates a vertical offset between line and row
TextEditor::SetTabSize¶
inline void SetTabSize(size_t value);TextEditor::GetTabSize¶
inline size_t GetTabSize() const;TextEditor::SetInsertSpacesOnTabs¶
inline void SetInsertSpacesOnTabs(bool value);TextEditor::IsInsertSpacesOnTabs¶
inline bool IsInsertSpacesOnTabs() const;TextEditor::SetLineSpacing¶
inline void SetLineSpacing(float value);TextEditor::GetLineSpacing¶
inline float GetLineSpacing() const;TextEditor::SetWordWrapEnabled¶
inline void SetWordWrapEnabled(bool value);TextEditor::IsWordWrapEnabled¶
inline bool IsWordWrapEnabled() const;TextEditor::SetReadOnlyEnabled¶
inline void SetReadOnlyEnabled(bool value);TextEditor::IsReadOnlyEnabled¶
inline bool IsReadOnlyEnabled() const;TextEditor::SetCaretsVisible¶
inline void SetCaretsVisible(bool value);TextEditor::IsCaretsVisible¶
inline bool IsCaretsVisible() const;TextEditor::SetAutoIndentEnabled¶
inline void SetAutoIndentEnabled(bool value);TextEditor::IsAutoIndentEnabled¶
inline bool IsAutoIndentEnabled() const;TextEditor::SetShowWhitespacesEnabled¶
inline void SetShowWhitespacesEnabled(bool value);TextEditor::IsShowWhitespacesEnabled¶
inline bool IsShowWhitespacesEnabled() const;TextEditor::SetShowSpacesEnabled¶
inline void SetShowSpacesEnabled(bool value);TextEditor::IsShowSpacesEnabled¶
inline bool IsShowSpacesEnabled() const;TextEditor::SetShowTabsEnabled¶
inline void SetShowTabsEnabled(bool value);TextEditor::IsShowTabsEnabled¶
inline bool IsShowTabsEnabled() const;TextEditor::SetShowLineNumbersEnabled¶
inline void SetShowLineNumbersEnabled(bool value);TextEditor::IsShowLineNumbersEnabled¶
inline bool IsShowLineNumbersEnabled() const;TextEditor::SetShowMiniMapEnabled¶
inline void SetShowMiniMapEnabled(bool value);TextEditor::IsShowMiniMapEnabled¶
inline bool IsShowMiniMapEnabled() const;TextEditor::SetMiniMapColumns¶
inline void SetMiniMapColumns(size_t value);TextEditor::GetMiniMapColumns¶
inline size_t GetMiniMapColumns() const;TextEditor::SetShowScrollbarMiniMapEnabled¶
inline void SetShowScrollbarMiniMapEnabled(bool value);TextEditor::IsShowScrollbarMiniMapEnabled¶
inline bool IsShowScrollbarMiniMapEnabled() const;TextEditor::SetShowPanScrollIndicatorEnabled¶
inline void SetShowPanScrollIndicatorEnabled(bool value);TextEditor::IsShowPanScrollIndicatorEnabled¶
inline bool IsShowPanScrollIndicatorEnabled() const;TextEditor::SetShowMatchingBrackets¶
inline void SetShowMatchingBrackets(bool value);TextEditor::IsShowingMatchingBrackets¶
inline bool IsShowingMatchingBrackets() const;TextEditor::SetCompletePairedGlyphs¶
inline void SetCompletePairedGlyphs(bool value);TextEditor::IsCompletingPairedGlyphs¶
inline bool IsCompletingPairedGlyphs() const;TextEditor::SetLineFoldingEnabled¶
inline void SetLineFoldingEnabled(bool value);TextEditor::IsLineFoldingEnabled¶
inline bool IsLineFoldingEnabled() const;TextEditor::SetOverwriteEnabled¶
inline void SetOverwriteEnabled(bool value);TextEditor::IsOverwriteEnabled¶
inline bool IsOverwriteEnabled() const;TextEditor::SetMiddleMousePanMode¶
inline void SetMiddleMousePanMode();TextEditor::SetMiddleMouseScrollMode¶
inline void SetMiddleMouseScrollMode();TextEditor::IsMiddleMousePanMode¶
inline bool IsMiddleMousePanMode() const;TextEditor::SetLineNumberLeftMargin¶
inline void SetLineNumberLeftMargin(size_t value);margins are expressed in glyphs
TextEditor::GetLineNumberLeftMargin¶
inline size_t GetLineNumberLeftMargin() const;TextEditor::SetDecorationLeftMargin¶
inline void SetDecorationLeftMargin(size_t value);TextEditor::GetDecorationLeftMargin¶
inline size_t GetDecorationLeftMargin() const;TextEditor::SetTextLeftMargin¶
inline void SetTextLeftMargin(size_t value);TextEditor::GetTextLeftMargin¶
inline size_t GetTextLeftMargin() const;TextEditor::SetText¶
inline void SetText(const std::string_view& text);inline void SetText(const std::vector<std::string_view>& lines);TextEditor::GetText¶
inline std::string GetText() const;get text from editor as UTF-8 encoded strings
TextEditor::GetSectionText¶
inline std::string GetSectionText(DocPos start, DocPos end) const;inline std::string GetSectionText(const DocSelection& selection) const;TextEditor::GetCursorText¶
inline std::string GetCursorText(size_t cursor) const;TextEditor::GetLineText¶
inline std::string GetLineText(size_t line) const;TextEditor::ReplaceSectionText¶
inline void ReplaceSectionText(DocPos start, DocPos end, const std::string_view& text);inline void ReplaceSectionText(const DocSelection& selection, const std::string_view& text);TextEditor::ClearText¶
inline void ClearText();clear the editor
TextEditor::IsEmpty¶
inline bool IsEmpty() const;TextEditor::GetLineCount¶
inline size_t GetLineCount() const;TextEditor::Render¶
inline bool Render(const char* title, const ImVec2& size=ImVec2(), ImGuiChildFlags childFlags=0, ImGuiWindowFlags windowFlags=ImGuiWindowFlags_NoMove | ImGuiWindowFlags_HorizontalScrollbar);render the text editor in a Dear ImGui context note: if you overwrite windowFlags to for instance add ImGuiWindowFlags_NoSavedSettings ensure you keep the default as they are required for the editor
ImGuiWindowFlags_NoMove to ensure mouse drag event are passed to the editor
ImGuiWindowFlags_HorizontalScrollbar to ensure a horizontal scrollbar is rendered when required
TextEditor::SetFocus¶
inline void SetFocus();programmatically set focus on the editor
TextEditor::Cut¶
inline void Cut();TextEditor::Copy¶
inline void Copy() const;TextEditor::Paste¶
inline void Paste();TextEditor::Undo¶
inline void Undo();TextEditor::Redo¶
inline void Redo();TextEditor::CanUndo¶
inline bool CanUndo() const;TextEditor::CanRedo¶
inline bool CanRedo() const;TextEditor::GetUndoIndex¶
inline size_t GetUndoIndex() const;TextEditor::SelectAll¶
inline void SelectAll();manipulate cursors and selections (line numbers are zero-based)
TextEditor::SelectLine¶
inline void SelectLine(size_t line);TextEditor::SelectLines¶
inline void SelectLines(size_t start, size_t end);TextEditor::SelectRegion¶
inline void SelectRegion(DocPos start, DocPos end);TextEditor::SelectToBrackets¶
inline void SelectToBrackets(bool includeBrackets=true);TextEditor::GrowSelections¶
inline void GrowSelections();TextEditor::ShrinkSelections¶
inline void ShrinkSelections();TextEditor::AddNextOccurrence¶
inline void AddNextOccurrence(bool wholeWord=false);TextEditor::SelectAllOccurrences¶
inline void SelectAllOccurrences(bool wholeWord=false);TextEditor::AnyCursorHasSelection¶
inline bool AnyCursorHasSelection() const;TextEditor::AllCursorsHaveSelection¶
inline bool AllCursorsHaveSelection() const;TextEditor::CursorHasSelection¶
inline bool CursorHasSelection(size_t cursor) const;TextEditor::MainCursorHasSelection¶
inline bool MainCursorHasSelection() const;TextEditor::CurrentCursorHasSelection¶
inline bool CurrentCursorHasSelection() const;TextEditor::ClearCursors¶
inline void ClearCursors();TextEditor::GetNumberOfCursors¶
inline size_t GetNumberOfCursors() const;get cursor positions (the meaning of main and current is explained in README.md)
TextEditor::GetCursorPosition¶
inline DocPos GetCursorPosition(size_t cursor) const;TextEditor::GetMainCursorPosition¶
inline DocPos GetMainCursorPosition() const;TextEditor::GetCurrentCursorPosition¶
inline DocPos GetCurrentCursorPosition() const;TextEditor::GetCursorSelection¶
inline DocSelection GetCursorSelection(size_t cursor) const;TextEditor::GetMainCursorSelection¶
inline DocSelection GetMainCursorSelection() const;TextEditor::GetCurrentCursorSelection¶
inline DocSelection GetCurrentCursorSelection() const;TextEditor::IsMousePosOverGlyph¶
inline bool IsMousePosOverGlyph(const ImVec2& mousePos) const;get information at mouse position (e.g. from ImGui::GetMousePos())
TextEditor::IsMousePosOverTextArea¶
inline bool IsMousePosOverTextArea(const ImVec2& mousePos) const;TextEditor::GetDocPosAtMousePos¶
inline DocPos GetDocPosAtMousePos(const ImVec2& mousePos) const;TextEditor::GetWordAtMousePos¶
inline std::string GetWordAtMousePos(const ImVec2& mousePos) const;TextEditor::Scroll (enum)¶
scrolling support
| Member | Value | |
|---|---|---|
alignTop | 0 | |
alignMiddle | 1 | |
alignBottom | 2 |
TextEditor::ScrollToLine¶
inline void ScrollToLine(size_t line, Scroll alignment=Scroll::alignMiddle);TextEditor::GetFirstVisibleRow¶
inline size_t GetFirstVisibleRow() const;TextEditor::GetLastVisibleRow¶
inline size_t GetLastVisibleRow() const;TextEditor::GetFirstVisibleColumn¶
inline size_t GetFirstVisibleColumn() const;TextEditor::GetLastVisibleColumn¶
inline size_t GetLastVisibleColumn() const;TextEditor::SetCursor¶
inline void SetCursor(DocPos pos);specify a new cursor position and scroll to it (if required) if the new position is currently in a folded region, it will be automatically unfolded
TextEditor::GetLineHeight¶
inline float GetLineHeight() const;TextEditor::GetGlyphWidth¶
inline float GetGlyphWidth() const;TextEditor::DocPos2VisPos¶
inline VisPos DocPos2VisPos(DocPos pos) const;TextEditor::VisPos2DocPos¶
inline DocPos VisPos2DocPos(VisPos pos) const;TextEditor::IsDocPosVisible¶
inline bool IsDocPosVisible(DocPos pos) const;see if a specified document location is visible (not folded and currently on screen)
TextEditor::IsVisPosOverGlyph¶
inline bool IsVisPosOverGlyph(VisPos pos) const;see if a visual position covers a glyph
TextEditor::FindWordStart¶
inline DocPos FindWordStart(DocPos pos, bool wholeWord=false) const;TextEditor::FindWordEnd¶
inline DocPos FindWordEnd(DocPos pos, bool wholeWord=false) const;TextEditor::SelectFirstOccurrenceOf¶
inline void SelectFirstOccurrenceOf(const std::string_view& text, bool caseSensitive=true, bool wholeWord=false);TextEditor::SelectNextOccurrenceOf¶
inline void SelectNextOccurrenceOf(const std::string_view& text, bool caseSensitive=true, bool wholeWord=false);TextEditor::SelectAllOccurrencesOf¶
inline void SelectAllOccurrencesOf(const std::string_view& text, bool caseSensitive=true, bool wholeWord=false);TextEditor::ReplaceTextInCurrentCursor¶
inline void ReplaceTextInCurrentCursor(const std::string_view& text);TextEditor::ReplaceTextInAllCursors¶
inline void ReplaceTextInAllCursors(const std::string_view& text);TextEditor::OpenFindReplaceWindow¶
inline void OpenFindReplaceWindow();TextEditor::CloseFindReplaceWindow¶
inline void CloseFindReplaceWindow();TextEditor::HasFindString¶
inline bool HasFindString() const;TextEditor::FindNext¶
inline void FindNext();TextEditor::FindAll¶
inline void FindAll();TextEditor::SetFindButtonLabel¶
inline void SetFindButtonLabel(const std::string_view& label);internationalize find window labels (strings must be UTF-8 encoded)
TextEditor::SetFindAllButtonLabel¶
inline void SetFindAllButtonLabel(const std::string_view& label);TextEditor::SetReplaceButtonLabel¶
inline void SetReplaceButtonLabel(const std::string_view& label);TextEditor::SetReplaceAllButtonLabel¶
inline void SetReplaceAllButtonLabel(const std::string_view& label);TextEditor::AddMarker¶
inline void AddMarker(size_t line, ImU32 lineNumberColor, ImU32 textColor, const std::string_view& lineNumberTooltip, const std::string_view& textTooltip);TextEditor::ClearMarkers¶
inline void ClearMarkers();TextEditor::HasMarkers¶
inline bool HasMarkers() const;TextEditor::AddSquiggle¶
inline void AddSquiggle(DocPos start, DocPos end, size_t type, ImU32 color, const std::string_view& tooltip = std::string_view());TextEditor::ClearSquiggles¶
inline void ClearSquiggles(DocPos start, DocPos end);inline void ClearSquiggles(size_t type);inline void ClearSquiggles();TextEditor::HasSquiggles¶
inline bool HasSquiggles() const;TextEditor::SetChangeCallback¶
inline void SetChangeCallback(std::function<void()> callback, int delay=0);specify a change callback (called when changes are made (including undo/redo)) the delay parameter specifies a time in miliseconds that the editor will wait for before calling which helps in case you don’t need to track every keystroke
TextEditor::ClearChangeCallback¶
inline void ClearChangeCallback();TextEditor::HasChangeCallback¶
inline bool HasChangeCallback() const;TextEditor::Change (struct)¶
detailed change report passed to callback below this callback is different from the one above as it reports every change (not just a summary) and is very detailed the insert flag states whether the change was an insert (True) or a delete (False) in case of an overwrite, there will be two actions (first a delete and then an insert) the start parameters refer to the insert point or the start of the delete the end parameters refer to the end of the inserted text or the end of the deleted text the text parameter contains the inserted or deleted text (UTF-8 encoded) line and index values are zero-based
| Member | |
|---|---|
bool insert; | |
DocPos start; | |
DocPos end; | |
std::string text; |
TextEditor::SetTransactionCallback¶
inline void SetTransactionCallback(std::function<void(const std::vector<Change>&)> callback);specify a transaction callback (live document changes in great detail) it provides a list of changes made to the document in a single transaction (in the right order) be carefull with this callback as it gets very verbose (called on every keystroke, delete, cut, paste, undo and redo)
TextEditor::ClearTransactionCallback¶
inline void ClearTransactionCallback();TextEditor::HasTransactionCallback¶
inline bool HasTransactionCallback() const;TextEditor::Decorator (struct)¶
line-based decoration
| Member | |
|---|---|
size_t line; | zero-based |
float width; | |
float height; | |
ImVec2 glyphSize; |
TextEditor::SetLineDecorator¶
inline void SetLineDecorator(size_t width, std::function<void(Decorator& decorator)> callback);setup a line decorator (width is number of glyphs)
TextEditor::ClearLineDecorator¶
inline void ClearLineDecorator();TextEditor::HasLineDecorator¶
inline bool HasLineDecorator() const;TextEditor::CustomCaret (struct)¶
custom text cursor (caret) rendering
| Member | |
|---|---|
ImDrawList* drawList; | |
ImVec2 glyphPos; | |
ImVec2 glyphSize; | |
bool caretVisible; | |
ImU32 caretColor; | |
size_t cursorIndex; |
TextEditor::SetCustomCaretRenderer¶
inline void SetCustomCaretRenderer(std::function<void(const CustomCaret& data)> callback);TextEditor::ClearCustomCaretRenderer¶
inline void ClearCustomCaretRenderer();TextEditor::HasCustomCaretRenderer¶
inline bool HasCustomCaretRenderer() const;TextEditor::CustomLineNumber (struct)¶
custom line number renderer
| Member | |
|---|---|
ImDrawList* drawList; | |
ImVec2 pos; | |
ImVec2 size; | |
size_t digits; | |
size_t lineNumber; | |
size_t cursorLineNumber; | |
ImU32 color; |
TextEditor::SetCustomLineNumberRenderer¶
inline void SetCustomLineNumberRenderer(std::function<void(const CustomLineNumber& data)> callback);TextEditor::ClearCustomLineNumberRenderer¶
inline void ClearCustomLineNumberRenderer();TextEditor::HasCustomLineNumberRenderer¶
inline bool HasCustomLineNumberRenderer() const;TextEditor::PopupData (struct)¶
setup right click or hover callbacks the editor sets up a popup menu in the right location the callback has to populate it context callbacks activate on a right click hover callbacks are just based on position (no mouse buttons required)
| Member | |
|---|---|
DocPos pos; |
TextEditor::SetLineNumberContextMenuCallback¶
inline void SetLineNumberContextMenuCallback(std::function<void(PopupData& data)> callback);TextEditor::ClearLineNumberContextMenuCallback¶
inline void ClearLineNumberContextMenuCallback();TextEditor::HasLineNumberContextMenuCallback¶
inline bool HasLineNumberContextMenuCallback() const;TextEditor::SetTextContextMenuCallback¶
inline void SetTextContextMenuCallback(std::function<void(PopupData& data)> callback);TextEditor::ClearTextContextMenuCallback¶
inline void ClearTextContextMenuCallback();TextEditor::HasTextContextMenuCallback¶
inline bool HasTextContextMenuCallback() const;TextEditor::SetTextHoverCallback¶
inline void SetTextHoverCallback(std::function<void(PopupData& data)> callback);TextEditor::ClearTextHoverCallback¶
inline void ClearTextHoverCallback();TextEditor::HasTextHoverCallback¶
inline bool HasTextHoverCallback() const;TextEditor::FoldAroundLine¶
inline void FoldAroundLine(size_t line);line folding support (only works when line folding is activated)
TextEditor::UnfoldAroundLine¶
inline void UnfoldAroundLine(size_t line);TextEditor::ToggleAtLine¶
inline void ToggleAtLine(size_t line);TextEditor::UnfoldAll¶
inline void UnfoldAll();TextEditor::IsLineFoldable¶
inline bool IsLineFoldable(size_t line) const;TextEditor::IsLineFolded¶
inline bool IsLineFolded(size_t line) const;TextEditor::IsLineVisible¶
inline bool IsLineVisible(size_t line) const;TextEditor::IsLineHidden¶
inline bool IsLineHidden(size_t line) const;TextEditor::IndentLines¶
inline void IndentLines();TextEditor::DeindentLines¶
inline void DeindentLines();TextEditor::MoveUpLines¶
inline void MoveUpLines();TextEditor::MoveDownLines¶
inline void MoveDownLines();TextEditor::ToggleComments¶
inline void ToggleComments();TextEditor::FilterSelections¶
inline void FilterSelections(std::function<std::string(std::string_view)> filter);TextEditor::SelectionToLowerCase¶
inline void SelectionToLowerCase();TextEditor::SelectionToUpperCase¶
inline void SelectionToUpperCase();TextEditor::StripTrailingWhitespaces¶
inline void StripTrailingWhitespaces();TextEditor::FilterLines¶
inline void FilterLines(std::function<std::string(std::string_view)> filter);TextEditor::TabsToSpaces¶
inline void TabsToSpaces();TextEditor::SpacesToTabs¶
inline void SpacesToTabs();TextEditor::Color (enum)¶
color palette support
| Member | Value | |
|---|---|---|
text | 0 | |
keyword | 1 | |
declaration | 2 | |
number | 3 | |
string | 4 | |
punctuation | 5 | |
preprocessor | 6 | |
identifier | 7 | |
knownIdentifier | 8 | |
comment | 9 | |
background | 10 | |
cursor | 11 | |
selection | 12 | |
whitespace | 13 | |
matchingBracketBackground | 14 | |
matchingBracketActive | 15 | |
matchingBracketLevel1 | 16 | |
matchingBracketLevel2 | 17 | |
matchingBracketLevel3 | 18 | |
matchingBracketError | 19 | |
lineNumber | 20 | |
currentLineNumber | 21 |
TextEditor::Palette (struct)¶
TextEditor::Palette::get¶
inline ImU32 get(Color color) const;TextEditor::SetPalette¶
inline void SetPalette(const Palette& newPalette);TextEditor::GetPalette¶
inline const Palette& GetPalette() const;TextEditor::SetDefaultPalette¶
static inline void SetDefaultPalette(const Palette& aValue);TextEditor::GetDefaultPalette¶
static inline Palette& GetDefaultPalette();TextEditor::GetDarkPalette¶
static const Palette& GetDarkPalette();TextEditor::GetLightPalette¶
static const Palette& GetLightPalette();TextEditor::Language (struct)¶
language support
TextEditor::Language::C¶
static const Language* C();TextEditor::Language::Cpp¶
static const Language* Cpp();TextEditor::Language::Cs¶
static const Language* Cs();TextEditor::Language::AngelScript¶
static const Language* AngelScript();TextEditor::Language::Lua¶
static const Language* Lua();TextEditor::Language::Python¶
static const Language* Python();TextEditor::Language::Glsl¶
static const Language* Glsl();TextEditor::Language::Hlsl¶
static const Language* Hlsl();TextEditor::Language::Json¶
static const Language* Json();TextEditor::Language::Markdown¶
static const Language* Markdown();TextEditor::Language::Sql¶
static const Language* Sql();TextEditor::SetLanguage¶
void SetLanguage(const Language* language);TextEditor::GetLanguage¶
inline const Language* GetLanguage() const;TextEditor::HasLanguage¶
inline bool HasLanguage() const;TextEditor::GetLanguageName¶
inline std::string GetLanguageName() const;TextEditor::SetLanguageChangeCallback¶
inline void SetLanguageChangeCallback(std::function<void()> callback);TextEditor::IterateIdentifiers¶
inline void IterateIdentifiers(std::function<void(const std::string& identifier)> callback) const;iterate through identifiers detected by the colorizer (based on current language)
TextEditor::LineBreakConfig (struct)¶
configuration for line break algorithm used when word wrap is active
| Member | |
|---|---|
bool useUnicodeAnnex14 = false; | |
std::string breakAfter = " \t{[("; | |
std::string breakBefore = "."; | |
bool lb2 = true; | |
bool lb3 = true; | |
bool lb4 = true; | |
bool lb5 = true; | |
bool lb6 = true; | |
bool lb7 = true; | |
bool lb8 = true; | |
bool lb8a = true; | |
bool lb9 = true; | |
bool lb10 = true; | |
bool lb11 = true; | |
bool lb12 = true; | |
bool lb12a = true; | |
bool lb13 = true; | |
bool lb14 = true; | |
bool lb15a = true; | |
bool lb15b = true; | |
bool lb15c = true; | |
bool lb15d = true; | |
bool lb16 = true; | |
bool lb17 = true; | |
bool lb18 = true; | |
bool lb19 = true; | |
bool lb19a = true; | |
bool lb20 = true; | |
bool lb20a = true; | |
bool lb21 = true; | |
bool lb21a = true; | |
bool lb21b = true; | |
bool lb22 = true; | |
bool lb23 = true; | |
bool lb23a = true; | |
bool lb24 = true; | |
bool lb25 = true; | |
bool lb26 = true; | |
bool lb27 = true; | |
bool lb28 = true; | |
bool lb28a = true; | |
bool lb29 = true; | |
bool lb30 = true; | |
bool lb30a = true; | |
bool lb30b = true; |
TextEditor::SetLineBreakConfig¶
inline void SetLineBreakConfig(LineBreakConfig& newConfig);set the line break configuration
TextDiff.h¶
TextDiff¶
TextDiff (struct)¶
TextDiff::TextDiff¶
TextDiff();constructor
TextDiff::SetSideBySideMode¶
inline void SetSideBySideMode(bool flag);TextDiff::GetSideBySideMode¶
inline bool GetSideBySideMode() const;TextDiff::SetTabSize¶
inline void SetTabSize(size_t value);TextDiff::GetTabSize¶
inline size_t GetTabSize() const;TextDiff::SetLineSpacing¶
inline void SetLineSpacing(float value);TextDiff::GetLineSpacing¶
inline float GetLineSpacing() const;TextDiff::SetWordWrapEnabled¶
inline void SetWordWrapEnabled(bool value);TextDiff::IsWordWrapEnabled¶
inline bool IsWordWrapEnabled() const;TextDiff::SetShowWhitespacesEnabled¶
inline void SetShowWhitespacesEnabled(bool value);TextDiff::IsShowWhitespacesEnabled¶
inline bool IsShowWhitespacesEnabled() const;TextDiff::SetShowSpacesEnabled¶
inline void SetShowSpacesEnabled(bool value);TextDiff::IsShowSpacesEnabled¶
inline bool IsShowSpacesEnabled() const;TextDiff::SetShowTabsEnabled¶
inline void SetShowTabsEnabled(bool value);TextDiff::IsShowTabsEnabled¶
inline bool IsShowTabsEnabled() const;TextDiff::SetShowScrollbarMiniMapEnabled¶
inline void SetShowScrollbarMiniMapEnabled(bool value);TextDiff::IsShowScrollbarMiniMapEnabled¶
inline bool IsShowScrollbarMiniMapEnabled() const;TextDiff::SetLanguage¶
inline void SetLanguage(const TextEditor::Language* language);TextDiff::GetLanguage¶
inline const TextEditor::Language* GetLanguage() const;TextDiff::SetColors¶
inline void SetColors(ImU32 ac, ImU32 dc);TextDiff::SetPalette¶
inline void SetPalette(const TextEditor::Palette& newPalette);TextDiff::GetPalette¶
inline const TextEditor::Palette& GetPalette() const;TextDiff::SetFocus¶
inline void SetFocus();programmatically set focus on the editor
TextDiff::SetText¶
void SetText(const std::string_view& left, const std::string_view& right);specify the text to be compared (using UTF-8 encoded strings)
TextDiff::Render¶
void Render(const char* title, const ImVec2& size=ImVec2(), ImGuiChildFlags childFlags=0, ImGuiWindowFlags windowFlags=ImGuiWindowFlags_NoMove);render text diff in a Dear ImGui context note: if you overwrite windowFlags to for instance add ImGuiWindowFlags_NoSavedSettings ensure you keep the default as it is required for the diff widget
ImGuiWindowFlags_NoMove to ensure mouse drag event are passed to the diff widget