Newsletter:

TSW Blog

Creating plugins for WebCoder and phpCoder

April 4, 2008

I know I've said this before, but I really do love the scripting support in WebCoder and phpCoder :). However, you can do even more with it than just create simple scripts. Adam Moore has extended the functionality of phpCoder with SVN support using just scripting, as seen in this post, which really shows you some of the potential. In this post, I wish to highlight something equally cool: The ability to create plugins. It makes it much easier to add advanced functionality, since it allows the developer to create most of the functionality in an IDE designed for the job, like Visual Studio or one of the Express editions. I've written a small tutorial on the subject to get you started - it can be found right here. Have a look and let me know what you think of it.

Also, please have a look in this forum thread - I need your help on that one, guys :)

Kasper (TSW) @ 11:17 am in WebCoder, phpCoder

TSW WebCoder 2007 version 7.06 released

March 31, 2008

I'm happy to announce a new maintenance release of TSW WebCoder 2007. This release carries the following changes:

  • An error popped up when configuring the syntax coloring
  • Under certain conditions, multiuser projects were not saved correctly
  • Painting of the active line marker could be wrong under certain conditions
  • Navigating the main menu with first keyboard and then mouse could sometimes fail

To upgrade, simply go to the WebCoder product page and download the application. Install it on top of the previous version, that should cause no problems. If you have any questions or comments, please contact us.

Kasper (TSW) @ 10:11 am in WebCoder

Bringing back the Auto update date with scripting

November 24, 2007

Here's another post mainly written to show you why WebCoder scripting rules :). A customer complained about the lack of the "Auto update date" feature, which was present in WebCoder 2005, as well as a long range of versions before that. I didn't think anyone was really using it, which is why it was skipped for WebCoder 2007. Now that I know that at least one person is still using it, re-implementing it using WebCoder scripting seemed like an interesting idea. And as it turned out, it was pretty easy :). Here is how you do it.

First of all, we need a way to insert the special "tag" that allows WebCoder to update the timestamp in the file. A nice approach would be to add it to the Tools part of WebCoder, but that would be a bit harder to explain (although pretty easy to carry out). Instead, simply create a User button in WebCoder, and make it execute the following simple piece of scripting code:


from System import DateTime 

ScriptUtils.InsertCode("<!--WebCoderAutoDate-->Last updated " + DateTime.Now.ToString("MM-dd-yyyy HH:mm") + "<!--/WebCoderAutoDate-->")

Once the button is clicked, WebCoder will insert the special tag. The comments simply mark the text, to allow for easy recognition. You may change both the text as well as the format string used on the ToString method, but if you do, please remember to change it in the next part as well.

Now, we need to make sure that WebCoder changes the date automatically when saving the document, so in other words, we need to know when the Save button is clicked. No problem, let's hook into the BarManager and listen for the CommandClick event - by doing so, we can monitor every single toolbar and menu item in WebCoder, and wait for the user to click the ones we're interested in. The code below should be saved as a script (select Scripting -> Create new script, paste it in and then select Save), and then you should set it to start up along with WebCoder - otherwise, it won't update your dates until the script has been manually executed. After you have saved the script, select Scripting -> Reload script menu, then select Scripting -> Manage scripts, find your script and check the auto start checkbox.

clr.AddReferenceByPartialName("ActiproSoftware.SyntaxEditor.Net20")

from System.Text.RegularExpressions import Regex
from System import DateTime
from ActiproSoftware.SyntaxEditor import DocumentModificationType, LineTerminator, DocumentModificationOptions
from TSW.WebCoder.Classes import DocumentController

def CommandClickHandler(s, e):
	cmd = e.Command.FullName
	if((cmd == "Files.SaveDocument") or (cmd == "Files.SaveDocumentSplitButton")):
		regex = Regex("Last updated ([0-9-/:. ]*)");
		m = regex.Match(MainForm.Editor.Document.GetText(LineTerminator.CarriageReturn))
		if(m.Success):
			MainForm.Editor.Document.ReplaceText(DocumentModificationType.Replace, m.Index, m.Length, "Last updated " + DateTime.Now.ToString("MM-dd-yyyy HH:mm")  + "", DocumentModificationOptions.RetainSelection)
			MainForm.SaveEditorFile(DocumentController.GetInstance().ActiveDocument.Filename)
			DocumentController.GetInstance().ActiveDocument.Modified = False
			Editor.Document.Modified = False

MainForm.BarManager.CommandClick += CommandClickHandler

And that's it - the auto update date functionality is back, courtesy of WebCoder scripting. You gotta love that :)

Kasper (TSW) @ 4:26 pm in WebCoder

New versions released

November 19, 2007

Hello everyone. I'm happy to announce the maintenance release of all 3 current TSW applications. Please read on for more information.

TSW WebCoder 2007, version 7.04

A new version of TSW WebCoder 2007 has been released. This release fixes a couple of issues with the Extended Search (and replace) functionality, reported by some users. Besides that, it fixes an issue preventing WebCoder from running on some computers when a Panda Antivirus solution was installed.

TSW SiteSync, version 1.02

With this version of SiteSync, I've added a new settings dialog, mainly to allow for customization of the encoding and linebreak type used by the mini editor. Also, a couple of minor bugs have been fixed. Besides that, an issue preventing SiteSync from running on some computers when a Panda Antivirus solution was installed has been resolved.

TSW WebPad.NET, version 1.12

This version of WebPad.NET comes with the same fixes as WebCoder 2007, as stated above. Besides that, a minor FTP client bug was fixed.

How to upgrade

To upgrade, simply go to the appropriate product page and download the application. Install it on top of the previous version, that should cause no problems. If you have any questions or comments, please contact us.

Kasper (TSW) @ 12:44 pm in SiteSync, WebCoder, WebPad.NET

Making a mini webbrowser with WebCoder scripting

October 22, 2007

So, I thought I would do a little WebCoder scripting. We need some more demo scripts, showing off the potential off the scripting system. I created a small webbrowser, inside of WebCoder, and I'm now sharing the result with you. It could use a bit of polishing, but it works, and it has the basic webbrowser functionality, in only 61 lines of commented and nicely structured code - I think that's pretty cool! :)

So, here it is. If you wish to try it out, be sure to copy/paste it exactly like it is - the Python language is whitespace sensitive :). I know that this script is not terribly useful, but hopefully it will give you an idea of how easy it is to create something cool. I hope you can extend on this and make something even cooler! :)

# We need stuff from the .NET class library - add the
# required assemblies and then import the classes we need
clr.AddReferenceByPartialName("System.Windows.Forms")
from System.Windows.Forms import WebBrowser, ToolStrip, ToolStripButton, ToolStripTextBox, Form, DockStyle

# Create our form (the dialog window)
browserForm = Form()
browserForm.Text = "Mini browser"
browserForm.Height = 400
browserForm.Width = 600

# Create an instance of the WebBrowser control and place it correctly
browser = WebBrowser()
browser.Dock = DockStyle.Fill
browserForm.Controls.Add(browser)

# Create an instance of a ToolStrip control (the .NET toolbar) and place it in the top
toolbar = ToolStrip()
toolbar.Dock = DockStyle.Top

# Events for the buttons we are about to create
def BackButtonClick(s, e):
	browser.GoBack()

def ForwardButtonClick(s, e):
	browser.GoForward()

def GoButtonClick(s, e):
	browser.Navigate(addressBox.Text)

# Create a couple of buttons on the toolbar
backButton = ToolStripButton()
backButton.Text = "Go back";
backButton.Click += BackButtonClick
toolbar.Items.Add(backButton)

forwardButton = ToolStripButton()
forwardButton.Text = "Go forward";
forwardButton.Click += ForwardButtonClick
toolbar.Items.Add(forwardButton)

# Create a text field for entering URL's
addressBox = ToolStripTextBox()
toolbar.Items.Add(addressBox)

# Create a Go button
goButton = ToolStripButton()
goButton.Text = "Go!"
goButton.Click += GoButtonClick
toolbar.Items.Add(goButton)

# Add the toolbar to the form
browserForm.Controls.Add(toolbar)

# Navigate to the TSW blog
browser.Navigate("http://www.tsware.net/blog/")

# Show the form
browserForm.ShowDialog()
# Dispose the form, freeing up it's resources
browserForm.Dispose()
Kasper (TSW) @ 9:44 pm in WebCoder

TSW WebCoder 2007, version 7.03 released

October 12, 2007

I'm happy to announce a new minor release of TSW WebCoder 2007. This release comes with a fair amount of small fixes, tweaks and a couple of additions. Here is the list:

  • Added a setting for controlling which type of linebreak used when saving files (Unix, Mac and Windows style)
  • Tweaked the HTML IntelliSense to work better when writing within PHP strings
  • The Alt key was not handled properly when used to access the main menu
  • When creating new files from a project, the file would be empty - the project template OR the default template will now be used
  • Removed visual appearance settings for bracket highlighting from the Editor settings tab. In WebCoder 2007, they should be set from the Syntax coloring tab
  • A few very minor issues were corrected

The update has been released to replace previous versions, so if you are bothered by any of these minor bugs, just re-download from the WebCoder product page and install on top of the previous version. There should be no conflicts with datafiles from the final version of WebCoder.

Note to registered users of WebCoder: This is of course a free upgrade for you :). If you are running WebCoder 2007, version 7.00, you should be aware of the following: The location of the product key has been moved, so that WebCoder can now be registered by users not having access to the HKEY_LOCAL_MACHINE part of the registry. Instead, it will be installed in HKEY_CURRENT_USER. This means that you have to re-register the application. Simply use the same key if you still have it, or get a new one from the serial key system, as described in the e-mail you received upon purchasing WebCoder. If you have any problems, be sure to contact us.

Kasper (TSW) @ 10:31 am in WebCoder

Tips & tricks: Preview and multiple monitors

September 18, 2007

When I start to create a new webdesign, I tend to use WebCoder a bit differently than when I'm just doing maintenance on an existing site. In the latter case, I don't use the internal preview a lot, but when I start a new design, the F12 key seems to be my best friend :). With WebCoder's support for both Mozilla and Internet Explorer as preview browsers, I seem to have everything I need without leaving WebCoder, but it's my dual monitor setup that really makes it easy to test out all the aspects of the new design. I use the customizable interface of WebCoder and drag out the preview Tool windows to my secondary monitor. Depending on what I'm doing, I will either tab the two windows to each other, to create a tab for each of the two browsers, or put them in a splitview position, either horizontally or vertically. This allows me to simply hit F12 in WebCoder and the changes will immediately be shown on my secondary monitor. As we all know, a good design requires a lot of tweaks and changes before it's ready, and being able to preview these changes instantly can be a huge help. In case you haven't already tried this in the design phase, you really should. Even if you don't have multiple monitors, there may be a way for you to position the windows that will give you a more optimal workflow. Try it!

Kasper (TSW) @ 2:38 pm in WebCoder, WebPad.NET

TSW WebCoder 2007, version 7.02 released

September 8, 2007

I'm happy to announce a new update for WebCoder 2007. This is the second update, once again including a number of minor fixes, as requested by the users. It also includes TSW Update, as described in the previous blog post about the SiteSync update. Here is a list of changes in WebCoder 2007, version 7.02:

  • PHP AutoProposal can now suggest variables within PHP strings
  • Database tables with a dash (-) in their name could not be shown
  • When there is no selected text, WebCoder will no longer allow empty lines to be cut or copied to the clipboard
  • Editor setting added to allow for automatic conversion of tabs to spaces
  • WebCoder would sometimes not remember the last used directory in the File explorer properly
  • The Extended search & replace could be come unstable with certain search/replace combinations
  • The Extended search & replace will now use the same encoding as selected by the user in the Settings dialog, when writing to files

The update has been released to replace previous versions, so if you are bothered by any of these minor bugs, just re-download from the WebCoder product page and install on top of the previous version. There should be no conflicts with datafiles from the final version of WebCoder.

Note to registered users of WebCoder: This is of course a free upgrade for you :). If you are running WebCoder 2007, version 7.00, you should be aware of the following: The location of the product key has been moved, so that WebCoder can now be registered by users not having access to the HKEY_LOCAL_MACHINE part of the registry. Instead, it will be installed in HKEY_CURRENT_USER. This means that you have to re-register the application. Simply use the same key if you still have it, or get a new one from the serial key system, as described in the e-mail you received upon purchasing WebCoder. If you have any problems, be sure to contact us.

As mentioned, this release includes TSW Update. It's simply a small application which will launch the first time you start WebCoder, showing you the latest news from TSW. It will start as often as you'd like (or never again), depending on the interval you select - the default is every 3 days. This will keep you updated on everything new from TSW by showing you the latest entries from this blog, which is really the best way to make sure that you get the latest updates to the applications and try the newest beta versions. Besides that, tips & tricks will be posted here now and then. Of course, you may turn off TSW Update if you're not interested.

Kasper (TSW) @ 5:59 pm in TSW, WebCoder

TSW WebCoder 2007 update

August 30, 2007

An update to WebCoder 2007, version 7.01, has been released. It fixes 3 pretty minor bugs:

  • The caret would in certain situations jump over an empty line
  • The Tab order of the FTP overwrite dialog was wrong
  • Problems when trying to write the ASP start sequence (<%) and using HTML AutoProposal

It also adds a new setting, controlling whether or not WebCoder should monitor for external changes to your open files. If you are bothered by WebCoder's prompts to reload changed files, this can now be turned off.

The update has been released to replace version 7.00, so if you are bothered by any of these minor bugs, just re-download from the WebCoder product page and install on top of the previous version. There should be no conflicts with datafiles from the final version of WebCoder.

Note to registered users of WebCoder: This is of course a free upgrade for you :). The location of the product key has been moved, so that WebCoder can now be registered by users not having access to the HKEY_LOCAL_MACHINE part of the registry. Instead, it will be installed in HKEY_CURRENT_USER. This means that you have to re-register the application. Simply use the same key if you still have it, or get a new one from the serial key system, as described in the e-mail you received upon purchasing WebCoder. If you have any problems, be sure to contact us.

Kasper (TSW) @ 9:05 am in WebCoder

TSW WebCoder 2007 - final beta 3

July 26, 2007

A quick jump from FB2 to FB3. I have extended the beta period a bit, to make sure that there's time enough to get rid of all the bugs you can find, so please keep up the good work :). As you hopefully already know, we give away 5 free commercial WebCoder 2007 licenses  to the best betatesters, once the final version has been released!

Download TSW WebCoder 2007 final beta 3 - please provide feedback in the beta forum

I'm looking very much forward to getting your feedback, so keep up the good testing! :)

Please notice that TSW WebCoder 2007 requires the .NET framework to run. The installer will try to install it for you, if you do not already have it. For more information about the .NET framework, please see our .NET info page. Also, please be aware that this is beta software. It's meant for testing only, and if you don't feel comfortable using software with known bugs and quirks, you should wait for the final version.

Kasper (TSW) @ 10:26 am in WebCoder
Next Page »
Forums | Made with WebCoder | JustGirls.dk | ASP.NET Tutorial | C# Tutorial | AJAX Tutorial
© TSW 1998-2008
Made with WebCoder!