|
|
|
|
|
|
|
|
|
|
|
Editor.NET FAQ
What's the best way to starting using Editor.NET components? The good place to start using Editor.NET components is reading user manual that can be downloaded here.
Does Editor.NET support .NET Framework 2.0? Yes, Editor.NET supports both .NET Framework 1.1 and 2.0. You can use Visual Studio 2003, Visual Studio 2005, Borland Delphi 8 for .NET and Borland Delphi 2005 as development environment for projects using Editor.NET. How to incorporate the SyntaxEdit control into my form? If the Editor.NET components already added to the Visual Studio/Delphi tool box,
you can simply drag the SyntaxEdit component onto your form at design time.
Read more about how to install components to the toolbox.
QWhale.Editor.SyntaxEdit edit = new QWhale.Editor.SyntaxEdit();
How to set syntax highlighter for the SyntaxEdit control? Text parsing is performed by one of the Parser non-visual components.
This parser should be linked to SyntaxEdit's Lexer property.
Where already designed syntax highlighting schemes are stored? Editor.NET comes with ready-to-use schemes for more than 30 programming languages, located in the "schemes\" folder. To load one of these schemes to the Parser component you need to edit Parser's Scheme property and press Load button in the Syntax Scheme Editor dialog box. What's the difference between using regular expressions based parsers and dedicated parsers? Regular expressions based parser provide common way to perform syntax highlighting for the text based on parsing rules.
Parsing is performed using a finite-state automaton driven by regular expressions matching the parsed text.
This approach allows defining syntax highlighting rules for virtually unlimited set of programming languages.
How to manage Selection in the SyntaxEdit control? SyntaxEdit supports a concept of text selection and a wide range of operations on it. All the selection related aspects are controlled via the Selection property. For example, to execute standard actions like cut/copy/paste you need to use appropriate methods of the Selection object: Selection.Cut / Selection.Copy / Selection.Paste. How to use Outlining feature of the SyntaxEdit control? SyntaxEdit supports code outlining, which is a text navigation feature that can make navigation of large structured texts more
effective by visually replacing them with shorter representation.
syntaxEdit1.Outlining.Outline(new Point(0, 0), new Point(int.MaxValue, 0), 0, "...").Visible = false; Another way to use SyntaxParser already supporting automatic outlining such as CsParser, JsParser, and VbParser. How to use and customize Intellisense feature of the SyntaxEdit control? Intellisense feature allow displaying popup windows containing related information to the Editor's context.
These windows can be presented in form of popup listbox or tooltip window.
How to save/restore additional information about bookmarks, gutter, line styles, etc. of the SyntaxEdit control? Saving and loading state of the SyntaxEdit control is performed using XML serialization. The usage of the XML format causes the entire state of the editor and all related components (text source and syntax parser) to be serialized/deserialized. You can use the following code:
syntaxEdit.SaveFile(FileName, ExportFormat.Xml); How to synchronize key properties for all SyntaxEdit controls in the application? If the application contains more than one instance of the editor, it is quite often desired to share their UI settings, and to provide the user with a centralized facility to manage them. Editor.NET provides SyntaxSettings designed to implement this task. Settings can be saved/loaded to the specific file and assigned to the editor with the following code:
SyntaxSettings GlobalSettings = new SyntaxSettings(); How to enable/disalbe keyboard shortcuts for the SyntaxEdit control? While the SyntaxEdit closely mimics the keymapping common to the most of
Microsoft's products, it is completely customizable: you can add or change behavior of certain
keys or even define an entirely different keymapping.
private void syntaxEdit1_Action() How to localize Search/Replace/Goto Line/Editor Settings dialogs? All string constant used in dialogs are localized to a few foreign languages. So far Editor.NET supports German, French, Spanish, Russian and Ukrainian languages. The following code demonstrates how to switch to German language: QWhale.Common.StringConsts.Localize(new System.Globalization.CultureInfo("de")); How to use custom drawing for the SyntaxEdit control? SyntaxEdit supports Custom Drawing feature allowing customizing drawing of text fragments and graphic primitives. The following code demonstrates how to highlight known identifiers with different color:
private void syntaxEdit1_CustomDraw(object sender, CustomDrawEventArgs e) Vertical line appearing in the SyntaxEdit control. By default, vertical line appears at 80th character position to visually identify virtual limit of the text being typed. Appearance of this line is controlled via EditMargin property, so to hide it just set EditMargin.Visible to false. .NET 2.0(Visual Studio) brings compiler warnings when building the solution. This is known issue. Editor.NET was originally written using .NET Framework 1.1 and building the project under .NET 2.0 results in displaying warning about some obsolete properties. We're going to fix this issue by providing conditional defines for compiling under .NET 2.0. Complier error about missing references. Dropping SyntaxEdit component onto the form and building the project may result in displaying compiler errors about missing references to required dlls. This happens because SyntaxEdit control requires QWhale.Common and QWhale.Syntax dlls (located in "bin\" folder). To fix the problem you just need to add references to these dlls via Solution Explorer. |
|
|||||||||||||||||||||||||||||||||
|
Copyright © 2003-2007 Quantum Whale LLC. All rights reserved.
|