The making of "WebCoder.NET" – part 3

January 15, 2007

One of the big questions I was facing when I started working on "WebCoder.NET", was the integrated scripting which has been a part of WebCoder for the last couple of versions. When switching from Delphi to .NET, I had to find replacements for the part of the applications which I can't or won't make my self. In the Delphi world, this is referred to as "3rd party components" or simply "Components". These components are like building blocks, allowing you to use the work of other people in certain places. For instance, creating a fully featured component for editing and syntax highlighting code would probably take a single person many months of really hard work. As you can see in WebPad.NET, I have found really good replacements for the components used in the Delphi version of WebCoder, but for the next version, I really needed a good component for handling scripting.

I searched a lot, but no real good alternatives turned up, and at one point, I was actually considering to skip the scripting support, partly because I wasn't sure how many people were actually using it. Fortunately, I finally found a solution that seems to be just right for WebCoder. IronPython is an implementation of Python for .NET, created by Microsoft actually. I didn't know anything about Python, but a couple of nerdy friends seemed to be very fond of it, so I gave it a try. It turned out to be a very nice implementation, allowing the scripter to interact with the entire .NET framework, and Python is actually a pretty nice language to work in. It's not that different from the scripting used in the current version of WebCoder, and people with experience from other programming languages will probably find it easy to use.

As I described earlier, one of my main concerns about missing a scripting engine, was the tag dialogs. As you may know, all the HTML tag dialogs of WebCoder 5 and 2005 is based on XML and scripting, instead of the usual approach of building them as a part of the application. This allows the user to change the existing dialogs and even create new ones. With the new scripting engine in place, it was really just about rewriting all the dialogs to use the new scripting language. I'm almost done, and so far everything has turned out pretty well. Looking at my old XML code, I decided to freshen it up a bit, to make it more readable, so I wrote a nice little utility to convert and change where I found it appropriate. Hopefully we will see more user created dialogs with next version of WebCoder :)

I will end this post with a small example of the scripting in "WebCoder.NET", to show you how easy it is. These few lines of code will replace < and > characters in the current document with their HTML entities:

code = Editor.Text
code = code.Replace("<", "&lt;")
code = code.Replace(">", "&gt;") 

Editor.Text = code
Kasper (TSW) @ 10:37 am in WebCoder

WebPad.NET and the Ctrl+Tab window

January 10, 2007

In many applications, you can switch between open documents by using the keyboard shortcut Ctrl+Tab. WebPad.NET takes this to the next level, by giving you a nice overview of your open documents and Tool windows. Try holding down the Ctrl key and then press the Tab key to see the window. As long as the Ctrl key is down, the window remains open, allowing you to use some of the other keys to navigate through it. When you release the Ctrl key, the selected item is then activated (document or Tool window).

Press Tab again to select the next document. Hold down Shift as well, to select the previous document instead. You may also use the arrow keys to navigate between the open documents, or move focus to one of the Tool windows. You may also use the mouse to click on one of the items. Simply release the Ctrl key to activate it.

That's all :)

Kasper (TSW) @ 11:53 am in WebPad.NET

The making of "WebCoder.NET" – part 2

January 2, 2007

As I described in the last blog entry, the first thing I started working on, was the PHP IntelliSense feature. Actually, I started working on it before I had a "WebCoder.NET" project created and even before WebPad.NET was fully finished. My goal was pretty simple: To get at least the same level of PHP IntelliSense as in WebCoder 2005. I used a lot of the same ideas from WebCoder 2005, but I still had to write this from scratch, based on a new system. It took me less than half the time I originally used, to rewrite this. Now it mostly needs some polishing, and it already feels better than in WebCoder 2005. It's still not integrated into "WebCoder.NET", as you can see on the screenshot:

PHP IntelliSense

As I said, it's not completely done, but it's getting there, and soon I will be able to implement it into WebCoder. If you have any comments, based on how stuff works in WebCoder 2005, then please be sure to let me know - right now is the best time for me to look into any issues you might have with it :). Stay tuned for more information about "WebCoder.NET", I have several blog entries planned already :)

Kasper (TSW) @ 11:17 am in WebCoder