Software


25
Apr 11

Programmer’s Notepad 2.3 RC Released

I’m happy to announce a new testing release, Programmer’s Notepad 2.3 RC, has been released to the Google Code page. This version includes a bunch of bug fixes, some minor changes and various changes under the hood.

Changes of interest in 2.3:

  1. Jump dialog now filters results as you type.
  2. Custom scheme is now implemented as a PN extension.
  3. Double-click on tab bar (not on tab) starts a new doc.
  4. 3 types of block comment supported in custom schemes (schemedef).
  5. Tags only auto-closed in the correct state in HTML/XML, hr br and img not auto-closed.
  6. Miscellaneous updates to schemes to improve highlighting (including HTML5 elements and attributes).
  7. RTF export reworked, background colours now working better.
  8. Properties scheme folding.
  9. Crash issues with split views fixed.
  10. Chinese Windows XP menu issues fixed.
  11. Portable edition translations issues fixed.
  12. Some autocomplete fixes

Downloads:
Download 2.3 RC Installer
Download 2.3 RC Portable
Download 2.3 RC Multi-Language

You may also like to add the following updated extensions to your 2.3 RC install:

PyPN to get support for scripting/macros with Python: PyPN 1.0 RC
TextUtil for miscellaneous extra text helpers: TextUtil 0.2

Thanks to all contributors, translators and testers for their help with this release.

p.s. this release has been available for a while, I just haven’t had time to write it up. A new family member has been keeping me very busy!


10
Dec 10

Programmer’s Notepad 2.2 Released

I’m happy to announce a new stable release, Programmer’s Notepad 2.2, has been released to our Google Code page. This release is very similar to 2.1.5 (fixing a few bugs and landing a few minor changes), but is a huge improvement over the last stable release 2.0.10.

Headline Changes in 2.2:

There have been too many improvements since 2.0.10 to recount them all here, but these are the headline changes in 2.2 over 2.0.10:

  1. Complete Unicode conversion, files, searching, projects, UI, clips…
  2. Complete redesign of text clips, with editing built in to new UI view and code templates and text clips consolidated
  3. Multiple concurrent selections (ctrl+select)
  4. Type into multiple selections and block selections
  5. Virtual space
  6. Translations – PN in your language
  7. Flexible split views
  8. Converting between ANSI/Unicode properly converts current file contents
  9. Vastly improved file encoding options and defaults

Downloads:
Download 2.2 Installer
Download 2.2 Portable
Download 2.2 Multi-Language

You may also like to add the PyPN extension to your 2.2 install to get support for scripting/macros with Python: PyPN 0.12

Thanks to all contributors, translators and testers for their help with this release.


5
Feb 10

Programmer’s Notepad 2.1.2 Released

A new testing release, version 2.1.2 of Programmer’s Notepad has been released to Google Code. The major new feature in this release is Code Template Fields, but there have been a lot of other changes too:

  • Code Template Fields
  • Cleaner visual style for the document tabs
  • Added line padding options, allows more whitespace between lines
  • Switch to Scintilla’s built-in line length measurement
  • Removed some 3D styling bits to clean up the look of the editor, more to do.
  • New tab text changed from to Untitled
  • -z parameter now assumes a single file after the -z, designed for notepad replacement.
  • Updated to latest Scintilla bits for some multi-caret fixes
  • Fixed a couple of regular expression issues.
  • Fix tools options tab titles.
  • Made SmartHighlight more visible, less alpha blending

In case you haven’t used a 2.1 build yet, here are the other headline features in the testing builds:

  1. Full Unicode Support
  2. Support for Translations – PN in your language
  3. Prototype Command Bar feature (with PyPN)
  4. Multiple simultaneous selections, including typing into block selections
  5. Virtual space

Downloads:

Download 2.1.2 Installer
Download 2.1.2 Multi-language Installer
Download 2.1.2 Portable

Updated Portable download link now, apologies for the confusion!


21
Jul 09

Trunk Now Open for 2.1 Changes

This post is probably only of interest to those playing with or working on the code for Programmer’s Notepad.

Programmer’s Notepad 2.0.10 RC is now out, and with that the code has been branched in subversion to the rel-2-0-10 branch.

This means that the trunk is open for big changes again, and there are some relatively big changes on the way – in fact for the next few weeks expect the trunk to be broken fairly often. Here are the changes coming in:

  1. Fixing the Unicode build – 2.1 will be released as a full Unicode rather than mixed mode build
  2. Updating to the newest Scintilla code, error handling model has changed completely
  3. Moving to Visual Studio 2008 SP1 for development instead of 2005
  4. Updating Boost to latest release

Apart from this (!) I don’t intend on taking many changes before 2.1 is released. You can see the current suggested list of items to fix in the tracker: Ellington Issues.


16
Feb 09

Creating your first Programmer’s Notepad extension

PyPN provides a great way to add functionality to Programmer’s Notepad by writing simple Python code, but you might want to do something more advanced. For this there’s the Programmer’s Notepad Extension SDK.

The SDK lets you extend PN using C++, allowing you to react to editor events and provide new commands in the menu. PyPN is itself implemented as an extension using this same SDK, and you can use the SDK to provide support for other scripting languages too.

What You’ll Need

You need a Windows C++ compiler and the Boost C++ library. Note that you don’t need to compile any of boost, we use the header-only bits.

I suggest using the free Microsoft Visual C++ Express if you don’t already have Visual Studio, this should guarantee compatibility.

Getting Started

Download the SDK and copy the template project, this is a good base for your extension. Note that the SDK also contains a demo extension showing use of various parts of the SDK. Change the name and version of your extension and you’re ready to add it to Programmer’s Notepad for the first time:

void __declspec(dllexport) __stdcall pn_get_extension_info(PN::BaseString& name, PN::BaseString& version)
{
    name = "My First Plugin";
    version = "1.0";
}

Compile the extension and place the .dll file in your PN directory. Now run “pn –findexts” and your plugin will be discovered and loaded the next time you start PN. Go to Tools->Options->Extensions and see your extension listed.

Everything else you want to do flows from the instance of IPN that’s passed to your init function. This interface gives you access to the open documents, lets you sign up to handle document events and gives you access to app-level services like script registration, find in files and options management.

Working with Documents

Everything you want to do with an open document is done through the IDocument interface. You get a pointer to one of these from your IPN instance by calling GetCurrentDocument, NewDocument or equivalent.

    // Make a new document
    IDocumentPtr doc = pn->NewDocument(NULL);

    // Send scintilla messages (see scintilla.org documentation)
    doc->SendEditorMessage(SCI_APPENDTEXT, 6, (LPARAM)"Hello!");

    // Save changes
    doc->Save("c:\\temp\\test.txt", true);

    // Done with the document
    doc->Close();

This is the first in a series of posts that will become the introductory documentation for extensions. Next time we’ll look at how to add menu commands for your plugin. The series will be added to the docs site as we go: Writing your First Extension


10
Feb 09

Code Snippet Trackers

While searching for a pastebin yesterday I stumbled across two sites that provide long-term personal and “social” or shared code snippet storage.

snipt  snipplr

Both provide syntax highlighting and long term access to your snippets. Snipplr also provides an API and several libraries for accessing your code, including python bindings and a wordpress plugin for displaying snippets from snipplr. The design of snipt is cleaner, and more “web 2.0”, but Snipplr seems to have more content and more third-party integration.


13
Jan 09

Awesome Windows 7 “Secrets” list

Tim Sneath has a great list of features that you might not have found if you’re using the Windows 7 Beta.

The Bumper List of Windows 7 Secrets

I’m loving the multi-monitor keyboard shortcuts, finally! I also think the Black Box Recorder could be extremely useful in getting useful bug reports, both for Windows and for third-party software – like PN!


12
Sep 08

Hansel-link, so that’s where the traffic came from

I was out last night, and noticed when I got back that for a brief while the pnotepad.org server had stopped responding. I didn’t really look into it but this morning it all became clear as I read my feeds in Google Reader. Scott Hanselman has a great review of the use of WTL in Chrome (Google’s new browser) in his latest Weekly Source Code.

He linked to an old article I wrote way back when on the Joys of WTL. Fun to see my own words quoted back at me on Scott’s blog! WTL is still the UI framework used for Programmer’s Notepad 2 and in the most part has served very well.

I’d also downloaded the Chromium code to go spelunking into their WTL use having read the excellent post from Peter Krumins’ blog on Code Reuse in Chrome.

Interestingly Google include the WTL code in their distribution, this was something I’d been thinking about doing for PN to reduce the number of steps needed for people to build PN. It would also help with the fact that PN 2.0.9 needs changes currently only available in the WTL Subversion depot.


28
Jul 08

Software Tracking

While playing around with new search engine Cuil I stumbled across a software tracking website I hadn’t seen before: Wakoopa

Sign up for Wakoopa, install a small piece of software and they will track your software use and build up an online profile showing this information. In return they’ll recommend software for you and let you know about new versions. Seems interesting, and you can see a bunch of users of Wakoopa also like Programmer’s Notepad: Programmer’s Notepad on Wakoopa. When I looked, 101 users had clocked up more than 370 hours of usage, across Mexico, Norway, Iran and the Netherlands (amongst many more). Hello international users!

Using Wakoopa reminded me of Ohloh – an open source software tracker. Ohloh concentrates on tracking contributions to open source software, and analyses the source code and commit history for open source projects to build up interesting metrics on each project. Some interesting statistics from the Ohloh Programmer’s Notepad page:

162,795 C++ Code Lines (with a further 29,856 lines of comment)
79,622 C Code Lines (with a further 12,076 lines of comment)

The ratio of comment to code for Programmer’s Notepad 2 is 15.5%, and was only 9.6% for version 1 – clearly I’m getting better behaved in my old age. Statistics are also provided for each developer, and I can see that my Median Commit Rate is 10 commits per month changing 2,200 lines of code – that’s a lot of code for an evenings and weekends project. Of course some of my commits are code contributed by others – don’t want to take all the credit!

You can click the button below to add your support for Programmer’s Notepad at Ohloh:


5
Jun 08

C# Automatic Properties can have Attributes

The MSDN documentation for Automatic Properties (a C# 3 language feature) states that attributes are not valid on automatic properties. This is not true, the following code compiles and works as expected:

public class Data
{
[XmlAttribute]
public int SomeNumber { get; set; }
}

class Program
{
static void Main(string[] args)
{
using (XmlWriter w = XmlWriter.Create(@”c:\temp\test.xml”))
{
XmlSerializer s = new XmlSerializer(typeof (Data));
s.Serialize(w, new Data { SomeNumber = 5 });
}
}
}

Running this code results in an XML file looking roughly like this (I stripped some unneeded namespace declarations):

< ?xml version="1.0" encoding="utf-8"?>
<data SomeNumber="5" />

SomeNumber is saved as an attribute, so the XmlAttribute attribute worked correctly.