Showing posts with label text editor. Show all posts
Showing posts with label text editor. Show all posts

Wednesday, August 31, 2011

Text editor - Visual basic

Today, let's see the making of our first system software - text editor. We will create it using Visual basic language and Visual Studio IDE. Incase, you don't have Visual Studio, download a free version of Visual Studio or Visual basic express from the below link

http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express

I have made it using Visual Studio 2010, so it may be compatible with 2008 edition, but before that I cannot guarantee. Below is the download link for my project. If you know Visual Basic, it's very easy and intuitive to understand the commands and if you have any doubts, please post them as comments

http://www.filefactory.com/file/cd55136/n/Dileepad.zip

It does all the things that a notepad does, along with good exception handling. The only change is that, it uses " Rich text " files, instead of traditional notepad files. And one more thing, it's name is Dileepad

I have tried to implement spell checker functionality in it, by using "Keyoti Rapid spell Desktop", but it's a paid version and since the version expired, I have to remove the functionality. It's just a single one line in Form_Load, that makes the rich tex box we are using, to gain the spell checker functionality. Try to do it, if you couldn't comment, I will help you. The Dileepad looks as the one shown below

Click to enlarge

If you know Visual basic, skip the remaining post.

If you don't know Visual Basic, don't bother yourself, it's one of the easiest languages to learn and with .net frame work, it has become more subtle. Just go through the code and try to understand it. If you got doubts, clarify them by going through the msdn blog. It has hundreds of articles and forums dedicated to Visual Basic. Or alternatively you can post them over here.


I will give some hints for the beginners to grasp the code. Unzip the file. Open Visual Studio. File->open->Project/Solution. Navigate to the unzipped folder. If the unzipped folder's name is dileepad, go to dileepad->dileepad->dileepad and now you must be seeing a folder with the first subfolder as bin. If not  navigate into one more dileepad subfolder. Finally there will be a Visual Studio Project file named "Dileepad" in the same folder which contains "bin" subfolder. Click on it and the whole project get's opened.


Form1.vb is the heart of the system and it contains the main interface of notepad while form2 is just created to tell about the software for "About" or "Credits". Form1.vb contains usable controls that I dragged and dropped from the tool box on the left hand side. And the things that the control does when a user presses it, is presented in the code behind it. Just double click the control and you can see the code behind it. Very simple and easy to grasp. To run the file, just press "F5".


I have two more system software codes to give you, they are of pure C-language and what those softwares are is a suspense for now.

Wednesday, June 8, 2011

Text editor

Let's speak of the text editor, the most basic of the System Software, what's the need for it and what's the GAG

The basic aim of the text editor's is that of processing the text, so in your every day life, the notepad you see is a text editor, Gedit is a text editor, Emacs is a text editor, Vim, MS Word, Open office word processsor ... any software or programme that can be used to edit or process the text is called text editor.

Mostly from the olden days to till date, these are used to write programmes by devs, which also became the basic tool for constructing different kinds of documents, that you come across in your day to day life.And mostly these come bundled with compilers and various word processing programmes.Consider the below cases as examples


  1. Visual Studio's text editor is the most robust one and user friendly built till date, since it incorporates every other system software ( except OS) in it.The best thing about it is, you need not bother about syntax errors, just like the spell checker in MS Word, it underlines when ever you do a mistake ( This is done by a special system software called interpreter that is normally absent in other editors )
  2. Open source has a small yet powerful competitor in this arena, the Vim editor, it has syntax highlighting (This is done with the help of different colours ), but no suggestions are shown as VS.And the best thing about this is it is the most powerful and fastest one, if you know the commands (Yup, faster than VS in this aspect).But it doesn't have any built in compiler
  3. Other programmes like Codeblocks, Dev CPP, Free C have the compiler functionality inbuilt into them


If you want to learn about the cool things that you can do with Vi editor (normally available in open Source OS), follow this link

http://flylib.com/books/en/1.533.1.24/1/

Inside that there is a link for Emacs editor also

And about Visual Studio, there is a hell lot of people out there, and basically it's not a text editor, but a software to build microsoft software with ease and it has the coolest IDE on earth. If you want to learn more about it, there are official Microsoft videos available  to get you started and keep going.You can even download them, if you wish

http://msdn.microsoft.com/en-us/vstudio/ff459609

And I presume you already know how to use a notepad :)

Let's talk about the Macro Processor in the next post