63.2 F
Los Angeles
Thursday, March 28, 2024

Trump Lawyer Resigns One Day Before Trial To Begin

Joseph Tacopina has filed with the courts that he will not represent Donald J. Trump. The E. Jean Carroll civil case is schedule to begin Tuesday January 16,...

Judge Lewis A. Kaplan Issues Order RE Postponement

On May 9, 2023, a jury found Donald J. Trump liable for sexual assault and defamation. The jury awarded Ms. Carroll $5 million in damages. Seven months ago,...

ASUS Announces 2023 Vivobook Classic Series

On April 7, 2023, ASUS introduced five new models in the 2023 Vivobook Classic series of laptops. The top laptops in the series use the 13th Gen Intel® Core™...
HardwareTablet PCRevisiting source code ink comments

Revisiting source code ink comments

Two years ago almost to the day (wow, time flys) I experimented with a way to embed ink in source code.

The basic idea? I want to be able to place sketches of data structures, diagrams, handwritten comments, marked-up screenshots, and the like in my source code. How many times have you tried to explain a data structure in text, for instance? It’s challenging.

So I tried to write an ink annotation tool that plugged into Visual Studio.

I didn’t get beyond the prototype stage because of two reasons:

* Ink comments in themselves are not enough. I needed to be able to paste screenshots–possibly marked up with ink–too. And at the time I didn’t have flexible enough ink editing tools to handle the rich interaction needed. Fortunately, now there’s the professional version of the Agilix ink editor.

* Visual Studio Add-ins that support rich interaction with the editor are an unknown to me. Still are, actually.

So here I am two years later, reworking the code using the Agilix Scribble control.

To start with I have a separate app for the ink. I figured if I couldn’t get the infrastructure needed working separate from Visual Studio I couldn’t get it integrated either.

In the standalone program the user can scribble some ink, copy it, and then paste it into source code. Yeah, like most editors, Visual Studio doesn’t support ink or pictures or anything non-text. So the pasted ink comments are base64 encoded as needed, wrapped in an XML string and (optionally) copied to the source code file. Actually, the now text-encoded comments are “commented out” and placed in a #region block so that the editor can collapse and hide all but a descriptive header line. This way most of the time the ink comment just looks like a single line.

CommentTestSeq.gif

Later someone can copy the comment region by selecting and pasting it into the standalone app. As soon as they do this the text block is decoded and pasted into the viewer–revealing the actual ink comment.

The standalone program is built from a ScribbleBox control which supplies an inkable area and a default set of toolbars. That was enough to get me started. The professional edition of the Scribble control supports inking, pictures, text and some simple shape recognition for diagramming, which is a nice collection of features.

Here’s a movie (4MB WMV. Right click and Save As) that shows the tool in action. It’s a rather large file, but shows a sequence where I handwrote some comments and a diagram, copied and pasted them into a source file, and then copied the text-encoded comment from the source file and pasted it into another ink viewer.

For this example the encoded ink is directly embedded into the source file. For small annotations this is fine. Optionally I can place the comments in a separate file although right now the interaction isn’t so hot because you have to supply a file name for the comment file.

Once I get the tool integrated into Visual Studio I hope to solve this and other issues.

A week from now I’m heading for TechEd and number one on my list is to find out how to do this IDE integration. I expect with Visual Studio 2005 the integration will be quite possible, but it’s finding the right person and the right nugget of information that can make all the difference.

Loren
Lorenhttp://www.lorenheiny.com
Loren Heiny (1961 - 2010) was a software developer and author of several computer language textbooks. He graduated from Arizona State University in computer science. His first love was robotics.

Latest news

Related news