Welcome to Dovetail Software Blogs : Sign in | Join | Help
Rich Text in the Clarify Classic Client

Someone recently asked me if the Clarify Classic Client could handle rich text in multi-line text controls - i.e. can text be made bold, italics, use different fonts/colors, etc.

Out of the box - no. Clarify handles plain text only.

But, we can customize Clarify.

One approach to this problem is to use an ActiveX control that supports rich text.

As a proof-of-concept, I downloaded the SpellEditor RichTextBox RTF Control, and slapped it onto the Solution form. (There's a bunch of available controls out there. I'm not saying this is the best one, but it was sufficient to prove my concept.)

I then added a bit of ClearBasic code:

  • During form_load, take the description field contents from the solution's contextual object, and stuff it into the RTF text property of the control.
  • During form_save, take the RTF text from the control, and stuff it into the description field of the solution's contextual object.

And here's what we get:

rich_text_solution

 

Pretty slick!

 

Clarify String Limits

One issue that we may need to deal with is that Clarify can only handle strings up to 32K. When using RTF (rich text format), the 32K would include the formatting.

For example, this plain text:

The Dovetail Technology Stack includes:
.NET 1.1, 2.0, 3.5
Javascript
CSS
HTML
Important: Server 2003 is recommended!
(server 2008 is OK as well)

would become this in RTF:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Trebuchet MS;}{\f1\fswiss\fprq2\fcharset0 Trebuchet MS;}{\f2\fnil\fcharset0 Calibri;}{\f3\fnil\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset0 Calibri;}{\f5\fnil\fcharset0 MS Sans Serif;}{\f6\fnil\fcharset2 Symbol;}}

{\colortbl ;\red128\green0\blue0;\red255\green0\blue0;\red0\green0\blue255;\red0\green0\blue0;}

{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\cf1\f0\fs32 The Dovetail Technology Stack includes:\cf2\f1\par

\pard{\pntext\f6\'B7\tab}{\*\pn\pnlvlblt\pnf6\pnindent0{\pntxtb\'B7}}\fi-360\li1080\cf3 .NET 1.1, 2.0, 3.5\par

{\pntext\f6\'B7\tab}Javascript\par

{\pntext\f6\'B7\tab}CSS\par

{\pntext\f6\'B7\tab}HTML\par

\pard\cf2\b\fs44 Important: Server 2003 is recommended!\par

\fs28 (server 2008 is OK as well)\par

}

Pretty clear how RTF takes up more space.

Looking at the text that you see in the above screenshot, there are 474 characters displayed. But with formatting, it becomes 3246 characters. This means that we'll need to keep track of the total length, including the formatting. Not hard, just something we'll need to deal with.

Proof-Of-Concept

Obviously, this isn't a complete working example - but it does prove that it can be done.

This demonstrates the Extensibility of the Clarify platform.

Posted: Thursday, December 18, 2008 5:26 PM by gsherman

Comments

Kevin Miller said:

Very nice stuff. It is impressive what you can do when you know platform well. Great post.

# December 19, 2008 9:35 AM

Alan Stephens said:

Well, Gary, it sure beats dropping on a "Calendar" ActiveX control. :-)  I'm pretty sure the last time I added an "external" ActiveX control to the form it was one of those.  But that was eight years ago or so.

But it's certainly a nice proof-of-concept.

# December 19, 2008 3:40 PM

gsherman said:

@Alan

heheh - yea, it seemed like it was always a Calender or a Timer ActiveX control for a demo.

Even still, a lot of folks who have had Clarify for many years still don't realize what they can do with it.

Thanks for stopping by.

# December 19, 2008 6:53 PM