TextControlBox.JuliusKirsch
1.6.0
See the version list below for details.
dotnet add package TextControlBox.JuliusKirsch --version 1.6.0
NuGet\Install-Package TextControlBox.JuliusKirsch -Version 1.6.0
<PackageReference Include="TextControlBox.JuliusKirsch" Version="1.6.0" />
paket add TextControlBox.JuliusKirsch --version 1.6.0
#r "nuget: TextControlBox.JuliusKirsch, 1.6.0"
// Install TextControlBox.JuliusKirsch as a Cake Addin #addin nuget:?package=TextControlBox.JuliusKirsch&version=1.6.0 // Install TextControlBox.JuliusKirsch as a Cake Tool #tool nuget:?package=TextControlBox.JuliusKirsch&version=1.6.0
TextControlBox-UWP
A UWP based textbox with syntaxhighlighting and support for very large amount of text which is still in development.
Reason why I built it
UWP has a default Textbox and a RichTextBox. Both of them are very slow in rendering multiple thousand lines. The selection works also very slow. So I decided to create my own version of a Textbox.
Info:
The textbox is mostly done, but there are still some bugs, I'm working on. I also would like to have a Winui3 variant, but the CoreTextServicesManager is not available yet
Features:
- Viewing files with a million lines or more without performance issues
- Syntaxhighlighting
- Outstanding performance because it only renders the lines that are needed to display
- Linenumbering
- Linehighlighter
- Json to create custom syntaxhighlighting
- Highly customizable
Problems:
- Current text limit is 100 million characters
- Currently there is no textwrapping
- Not available for Winui3, because CoreTextServicesManager is not available
Available languages:
- Batch
- Config file
- C++
- C#
- GCode
- Hex
- Html
- Java
- Javascript
- Json
- PHP
- Python
- QSharp
- Xml
Properties:
- ScrollBarPosition (get/set)
- CharacterCount (get)
- NumberOfLines (get)
- CurrentLineIndex (get)
- SelectedText (get/set)
- SelectionStart (get/set)
- SelectionLength (get/set)
- ContextFlyoutDisabled (get/set)
- ContextFlyout (get/set)
- CursorSize (get/set)
- ShowLineNumbers (get/set)
- ShowLineHighlighter (get/set)
- ZoomFactor (get/set)
- IsReadonly (get/set)
- Text (get/set)
- RenderedFontSize (get)
- FontSize (get/set)
- FontFamily (get/set)
- Cursorposition (get/set)
- SpaceBetweenLineNumberAndText (get/set)
- LineEnding (get/set)
- SyntaxHighlighting (get/set)
- CodeLanguage (get/set)
- RequestedTheme (get/set)
- Design (get/set)
- static CodeLanguages (get/set)
- VerticalScrollSensitivity (get/set)
- HorizontalScrollSensitivity (get/set)
- VerticalScroll (get/set)
- HorizontalScroll (get/set)
- CornerRadius (get/set)
- UseSpacesInsteadTabs (get/set)
- NumberOfSpacesForTab (get/set)
Functions:
- SelectLine(index)
- GoToLine(index)
- SetText(text)
- LoadText(text)
- Paste()
- Copy()
- Cut()
- GetText()
- SetSelection(start, length)
- SelectAll()
- ClearSelection()
- Undo()
- Redo()
- ScrollLineToCenter(line)
- ScrollOneLineUp()
- ScrollOneLineDown()
- ScrollLineIntoView(line)
- ScrollTopIntoView()
- ScrollBottomIntoView()
- ScrollPageUp()
- ScrollPageDown()
- GetLineContent(line)
- GetLinesContent(startline, count)
- SetLineContent(line, text)
- DeleteLine(line)
- AddLine(position, text)
- FindInText(pattern)
- SurroundSelectionWith(value)
- SurroundSelectionWith(value1, value2)
- DuplicateLine(line)
- FindInText(word, up, matchCase, wholeWord)
- ReplaceInText(word, replaceword, up, matchCase, wholeword)
- ReplaceAll(word, replaceword, up, matchCase, wholeword)
- static GetCodeLanguageFromJson(jsondata)
- static SelectCodeLanguageById(identifier)
- Unload()
- ClearUndoRedoHistory()
Create custom syntaxhighlighting languages with JSON:
{
"Highlights": [
{
"CodeStyle": { //optional delete when not used
"Bold": true,
"Underlined": true,
"Italic": true
},
"Pattern": "REGEX PATTERN",
"ColorDark": "#ffffff", //color in dark theme
"ColorLight": "#000000" //color in light theme
},
],
"Name": "NAME",
"Filter": "EXTENSION1|EXTENSION2", //.cpp|.c
"Description": "DESCRIPTION",
"Author": "AUTHOR"
}
To bind it to the textbox you can use one of these ways:
TextControlBox textbox = new TextControlBox();
//Use a builtin language | Available: Batch, ConfigFile, C++, CSharp, GCode, Hex, Html, Javascript, JSON, PHP, Python, QSharp, Xml
//Language identifiers are case insensitive
textbox.CodeLanguage = TextControlBox.GetCodeLanguageFromId("CSharp");
//Use a custom language:
var result = TextControlBox.GetCodeLanguageFromJson("JSON DATA");
if(result.Succeed)
textbox.CodeLanguage = result.CodeLanguage;
Create custom designs in C#:
textbox.Design = new TextControlBoxDesign(
new SolidColorBrush(Color.FromArgb(255, 30, 30, 30)), //Background brush
Color.FromArgb(255, 255, 255, 255), //Text color
Color.FromArgb(100, 0, 100, 255), //Selection color
Color.FromArgb(255, 255, 255, 255), //Cursor color
Color.FromArgb(50, 100, 100, 100), //Linehighlighter color
Color.FromArgb(255, 100, 100, 100), //Linenumber color
Color.FromArgb(0, 0, 0, 0), //Linenumber background
Color.FromArgb(100,255,150,0) //Search highlight color
);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
Universal Windows Platform | uap was computed. uap10.0 is compatible. |
-
UAP 10.0
- Collections.Pooled (>= 1.0.82)
- Newtonsoft.Json (>= 13.0.2)
- Win2D.uwp (>= 1.26.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.8.0 | 311 | 7/10/2023 | |
1.7.1 | 217 | 5/13/2023 | |
1.7.0 | 166 | 5/10/2023 | |
1.6.0 | 218 | 4/10/2023 | |
1.5.1 | 294 | 2/2/2023 | |
1.5.0 | 311 | 1/30/2023 | |
1.4.2 | 324 | 12/30/2022 | |
1.4.1 | 303 | 12/29/2022 | |
1.3.2 | 333 | 12/26/2022 | |
1.3.1 | 321 | 12/24/2022 | |
1.3.0 | 302 | 12/22/2022 | |
1.2.1 | 353 | 12/3/2022 | |
1.2.0 | 363 | 12/2/2022 | |
1.1.0 | 322 | 11/24/2022 | |
1.0.0 | 360 | 11/1/2022 |
Added python support
Added colored emoji support
Fixed xml and html closing tag issues
Other minor rendering fixes