BoltBait.com

CodeLab Tutorial Part 6 - Adding Help

How to use CodeLab to add help to your plugins!




If you haven't already done so, please go back and review the following:

Part 1 - Simple
Part 2 - Intermediate
Part 3 - Complex
Part 4 - Odds & Ends
Part 5 - Beyond CodeLab

Back? OK, good. Now that you've mastered those lessons, you're probably making some fairly complex effects. Maybe it is time to add a help file to your effect to aid your users in getting the most out of your effect.

Part 6 - Adding Help

Starting with Paint.NET version 4.0.6, effects can have help available:



Starting with CodeLab v2.6, help can be added to an effect in 3 different ways:

1) Use the comment method. Add to your script:

// Help: This is the help text.

All help content must be on one line. Use \t for tab and \n for new line.

2) Save your help text in a file with the same name as your effect. MyEffect.cs would have a help file MyEffect.txt. These two files must be saved in the same directory. This is similar to how MyEffect.png is automatically picked up for the icon. (Overrides #1)

3) Enter your text on the Save as DLL screen. (Overrides #1 & #2)

The Save as DLL screen has a preview button (?), editor, and instructions on how to create your help content.



The editor has a save button (looks like a picture of a folder) to create the files used in "2)" above.


The File New templates have a new option for coding your own custom help system and will code a stub to get you started.


Help content can take 4 forms:

1) None. If no help text is entered, no ? button will be added to your effect.

2) Plain text (including tabs and returns). This will be displayed in a modal message box.

3) URL. If your help text is a URL, it will be opened in a non-modal browser window.

4) UBB Formatted Text. This will be transformed and displayed in a modal pop up form with a rich text format control. About 22 codes supported. All URLs included are automatically clickable and open in a new browser window.

UBB supported codes:

[b]bold[/b]
[i]italics[/i]
[u]underline[/u]
[s]strikeout[/s]
[red]color[/red]
[blue]color[/blue]
[cyan]color[/cyan]
[green]color[/green]
[brown]color[/brown]
[white]color[/white]
[yellow]color[/yellow]
[purple]color[/purple]
[orange]color[/orange]
[silver]color[/silver]
[sharpie]color[/sharpie] - be sure to color the text too.
[highlighter]color[highlighter]
[indent]indent[/indent]
[center]center[/center]
[small]size[/small]
[big]size[/big]
superscript[sup]2[/sup]
subscript[sub]2[/sub]

Codes can be nested, so to make bold underlined text, use [b][u]Bold & Underlined[/u][/b].

In addition to all of those codes, all URL's specified will automatically be clickable. You don't need to specify any special codes for URL's.

By the way, if you are curious what code is being generated, you can always select the "view code" option on the Save as DLL screen.


Final Thoughts

In this tutorial, I haven't really talked about the help content. I'll leave that up to you. After all, YOU are the expert in your own effect. My best advice to you would be to place yourself in your user's point of view and ask yourself what questions could your user's have. Your help text should answer those questions.

If you've made it this far and would like to say, "thank you" for all the hard work that went into collecting and developing this series, you can buy me a beer.




More Information

Here is some more information that you may find useful:
CodeLab Effects Design Overview
Sample Code for User Interface Elements
Using the Code Editor
Designing a User Interface for Your Effect
Building a DLL File
CodeLab Help File
Check for CodeLab Updates
Learn C#

 

News


CodeLab 2.24 Released
(August 31, 2017)
This latest release of CodeLab for Paint.NET includes the Notepad++ editor and a full WYSIWYG help editor.
More...

HTML Editor 1.5 Released
(March 31, 2016)
This latest release is a complete rewrite adding a wysiwyg editor mode and a much improved UI.
More...

Double-Six Dominoes 3.0
(September 25, 2015)
This long-awaited refresh of the most popular dominoes game on Download.com is now available!
More...