![]() |
Desktop Development »
Miscellaneous »
General
Intermediate
Fireball.CodeEditorBy dotnetfireballFireball.CodeEditor is simple and complete control for create source code editing controls |
C#, Windows, .NET, Visual Studio, Dev
|
||||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

Fireball.CodeEditor is an source code editor control derived from the best compona SyntaxBox Control, because compona as recently released it as LGPL, i have imported it on my framework,because imported? because i need to add some changes and solve some issue, example;
BUG: The original source code of the compona don't work on C#, Visual Studio 2005.
FIXED: Fireball.CodeEditor work correctly on C# 2.0 and on Visual Studio 2005 Designer!
Removed some bad try catch statment and replaced with if statment because are more speedly.
BUG: The original compona code, caret don't position correctly on presence of { and (
FIXED: This is a p/invoke issue because C# 2.0 don't work on the same mode as C# 1.0 for p/invoke, i have find this bug simply removing all try catch!
On the Fireball Framework the needed dll's are this Fireball.CodeEditor ( this contains the CodeEditorControl ), Fireball.Windows.Forms ( this contains some widgets use by the CodeEditorControl ),Fireball.SyntaxDocument ( this contain the SyntaxDocument used by the CodeEditorControl) and Fireball.Core! that contains some low level api like GDIObject, it is also present another library the Fireball.CodeEditor.SyntaxFiles this is only a utils library that contains some standard syntax files for common programming languages and a class for fast loading this.
On this article i explain the basic usage of this control, this article article can't cover advanced use of this control, it is only an introduction, i can write more about the CodeEditorControl on the future, for use the example on this article you need to download and compile all libraries, the compile order is this,
Next you can compile the example of this article.
Note: You need to change the build output directory because it set for working with fireball repository structure.
N.B The demo illustrated on this article is a really working Fireball application called FireEdit!
For find a dettailed use of this libraries you can see the code, next i put some line of that illustrate the use of CodeEditorControl.
Adding an istance of CodeEditorControl to your form is very simple, you need only to add to your toolbox the Fireball.CodeEditor.dll, or you can also istance it manualy with this lines of code.
... using Fireball.Windows.Forms; // Where is located CodeEditorControl class using Fireball.Syntax; // Where is located SyntaxDocument class using Fireball.CodeEditor.SyntaxFiles; // Where is located commons SyntaxFiles public class yourclass : Form { public yourclass() { CodeEditorControl codeEdit = new CodeEditorControl(); this.Controls.Add(codeEdit ); codeEdit.Dock = DockStyle.Fill; codeEdit.Document = CodeEditorSyntaxLoader.SetSyntax(codeEdit, SyntaxLanguage.CSharp); } }
You have istanced your own CodeEditor! very simple!!
What is SyntaxLanguage? is an enumeration that contains a list of the common languages, see the enum,
public enum SyntaxLanguage { Lang6502 = 0, ASP = 1, CPP = 2, Cobol = 3, CSharp = 4, CSS = 5, DataFlex = 6, Delphi = 7, DOSBatch = 8, Fortran90 = 9, FoxPro = 10, Java = 11, JavaScript = 12, JSP = 13, LotusScript = 14, MSIL = 15, MySql_SQL = 16, NPath = 17, Oracle_SQL = 18, Perl = 19, PHP = 20, Povray = 21, Python = 22, Rtf = 23, SmallTalk = 24, SqlServer2K = 25, SqlServer7 = 26, SystemPolicies = 27, Template = 28, Text = 29, TurboPascal = 30, VBNET = 31, VB = 32, VBScript = 33, VRML97 = 34, XML = 35, }
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 30 Apr 2006 Editor: |
Copyright 2006 by dotnetfireball Everything else Copyright © CodeProject, 1999-2009 Web15 | Advertise on the Code Project |