Need an advice on creating a text editor
-
I have to create a special but very basic text editor with the following features: - export to special XML format (main feature) - export as normal text format - export to HTML (optional) - export to RTF (optional) - A predefined styles can be applied to the text (this is not necessary to be WYSWYG) I need just directions for now (no source code), just an idea where to look at. Where should I start? What control to use for entering text? How to do the XML output? Do I need to write a custom text box control? Thank you very much in advance!
-
I have to create a special but very basic text editor with the following features: - export to special XML format (main feature) - export as normal text format - export to HTML (optional) - export to RTF (optional) - A predefined styles can be applied to the text (this is not necessary to be WYSWYG) I need just directions for now (no source code), just an idea where to look at. Where should I start? What control to use for entering text? How to do the XML output? Do I need to write a custom text box control? Thank you very much in advance!
hmmm, a refreshing question - most similar posts here ask for SOURCE CODE NOW PLEASE THX URGENT!!!111 :-D A text editor is basically just a big multi-line textbox and a main menu (New File, Save File, Exit etc), you should be able to "knock up" this quick sample before trying anything more complex. Your "special XML format" is a main feature, but youve provided little detail on what you want to do, and depending on how difficult you want to go you could do anything up to a full-blown XML editor (Check out a demo of XMLSpy if you get a chance). Based on some guesswork, you might want to have some simple "tags" defined, where the style would be added after..
[heading]This is my heading[/heading]
[bodyText]This is my body text[/bodyText]This could also be interpreted to form an XML document, an HTML document and an RTF document. There are many object-oriented ways to achieve such a pattern (thing Formatter which takes the raw text and spits out the HTML,RTF,XML etc.) Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
-
hmmm, a refreshing question - most similar posts here ask for SOURCE CODE NOW PLEASE THX URGENT!!!111 :-D A text editor is basically just a big multi-line textbox and a main menu (New File, Save File, Exit etc), you should be able to "knock up" this quick sample before trying anything more complex. Your "special XML format" is a main feature, but youve provided little detail on what you want to do, and depending on how difficult you want to go you could do anything up to a full-blown XML editor (Check out a demo of XMLSpy if you get a chance). Based on some guesswork, you might want to have some simple "tags" defined, where the style would be added after..
[heading]This is my heading[/heading]
[bodyText]This is my body text[/bodyText]This could also be interpreted to form an XML document, an HTML document and an RTF document. There are many object-oriented ways to achieve such a pattern (thing Formatter which takes the raw text and spits out the HTML,RTF,XML etc.) Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
I'll try to explain what I want to do. Maybe there is a better way but I do not know about. I need to enter text. Let's say it is a poem. A poem has staves, verses a title, notes, etc. Currently if I do this I have to write all these XML tags manually. For a few things it is perfectly OK but with time it gets tedious work. Example:
Great poem
by Greatest Poet of all timesA great poem I wrote,
a great poem you read.To write another stave
you must be brave.<title>Great poem<title> <author>by Greatest Poet of all times</author> <stave><verse>A great poem I wrote,</verse> <verse>a great poem you read.</verse></stave> <stave><verse>To write another stave</verse> <verse>>you must be brave.</verse></stave>
Note: this is just an example but it shows basically what I want to do. I do not need to have a full XML editor. I basically imagine it like having a text box where I type the text and on the left I select the style for each paragraph (row) like this:
title: Great poem author: Greatest author of all time verse: a verse verse: a second verse
and the editor will add the rest of the tags as necessary. Last note: Then the XML files will be transformed with XSLT into HTML or used as necessary.
-
I'll try to explain what I want to do. Maybe there is a better way but I do not know about. I need to enter text. Let's say it is a poem. A poem has staves, verses a title, notes, etc. Currently if I do this I have to write all these XML tags manually. For a few things it is perfectly OK but with time it gets tedious work. Example:
Great poem
by Greatest Poet of all timesA great poem I wrote,
a great poem you read.To write another stave
you must be brave.<title>Great poem<title> <author>by Greatest Poet of all times</author> <stave><verse>A great poem I wrote,</verse> <verse>a great poem you read.</verse></stave> <stave><verse>To write another stave</verse> <verse>>you must be brave.</verse></stave>
Note: this is just an example but it shows basically what I want to do. I do not need to have a full XML editor. I basically imagine it like having a text box where I type the text and on the left I select the style for each paragraph (row) like this:
title: Great poem author: Greatest author of all time verse: a verse verse: a second verse
and the editor will add the rest of the tags as necessary. Last note: Then the XML files will be transformed with XSLT into HTML or used as necessary.
OK, that all makes sense and you seem to have the right idea when it comes to building your XML and using it. So what part do you think you need help on? Sounds to me like you could have a stab at trying to create this text editor and post any specific coding questions if you get stuck! Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
-
OK, that all makes sense and you seem to have the right idea when it comes to building your XML and using it. So what part do you think you need help on? Sounds to me like you could have a stab at trying to create this text editor and post any specific coding questions if you get stuck! Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
:) I haven't touched .NET for 2 years so I don't remember much. The main problem is: if I use textbox ot richtextbox how can I output it's contents into the required XML format. For example it's not clear to me. How should I recognize if a character has some special formatting and also how can I add for example a area where the number of a given line is displayed, it's style, etc. I hope it is understandable.