Inspired by a recent newsgroup thread and my latest experiments in Clarion –> DotNet interop I have put together a simple program that shows you how to use the Zeta Color Editor from a clarion app!

image

 

The Zeta Color Editor is from an article in The Code Project and I have adapted it slightly to include a “Clarion Code” entry control as well as the “HTML code” it comes with. You may remember this control from the awesome InsertClarionColor addin.

This is the complete C# code used to call the Zeta Color Editor:

The clarion declaration looks like this:

The zip file contains a clarion 8 solution (app file, etc), compiled exe for the impatient, the C# wrapper (ColorPicker.dll) and the ZetaColorEditor.dll. This should be everything you need to do your own testing. The original source for the ZetaColorEditor is found at the Code Project link at the beginning of this post, my customisations can be found at the clarion-addins google project page.

Download: download ColorPickerTest.zip
Version: 0.1
Updated: September 20, 2011
Size: 852.29 KB
Downloads: 587

 

This is a very basic addin which shows you how you can add additional items in the Quick Starts section of the New Solution, Project or Application dialog. It is based on the shipping quick starts found in the ClarionWin backend binding and hacked together to give you an idea of what is possible.

Disclaimer: I have not actually tested the code generated by this example project template but it should give you an idea of how it works!

New solution dialog showing the example quick start This example creates a new project/solution with basic INC/CLW files pre-loaded

There are a few things that are done incorrectly in this example, such as not using string resources for the prompts but you should get the idea. You can inspect the code once you have installed the addin by looking in the %appdata%\SoftVelocity\Clarion\7.0\AddIns\ folder or just extract the contents of the sdaddin package (it is just a zip file). There is no DLL associated with this, all you need is a .addin file which defines the search path for the XPT files which define the quick starts.

Download: download QuickStartTemplates.sdaddin
Version: 0.1
Updated: June 3, 2011
Size: 1.49 KB
Downloads: 579

-brahn

A while back on the ClarionLive skype chat I mentioned this template and promised to upload a version. I completely forgot all about it a few days later but here it is finally!

This template just calls up SubWCRev.exe which is shipped with TortoiseSVN. After that it is up to you to arrange to compile the details into your EXE or DLL. This is very easy to do using the VersionRes.TPL shipped with Clarion but it should also work fine with any other similar template designed to include values from an external file.

At this point I don’t intend to ship a fully working example but hopefully the following explanation will be enough to get you going.

The Template:

 

This template has only been tested with Clarion7 ABC but it should work fine in C6 as well as legacy applications.

Some screenshots that should explain how I use it:

 

1. Add the global extension to your application

GenerateSubVersion template dialog with default values

Note the name of the “Source version file”. This is the template used as the input for SubWCRev. Here is an example of how you might want to use it:

You will need to create this “SubVersion.in” file yourself. The destination file “SubVersion” is generated for you)

2. Add the global Version Resource template and configure it to use the destination file specified in the GenerateSubVersion template:

Clarions VersionRes.tpl configured to use an external file

3. Compile your application and if all goes well you should now have your SubVersion build compiled into your version resource!

Compiled EXE with SVN revision information!

The SVN revision in this example is "2" and as you can see I have chosen to include the rev date as well. The date could be useful to automatically include the Copyright year for example…

Today at work I needed some code to Add “x” months to a given date. System.AddMonths looked like the kind of thing I was after but I needed it implemented in clarion code.

Not hard but nice to have.

Thanks Mark for the assistance!

Some examples:

  1. 05-Oct-2009 + 1 Month = 05-Nov-2009
  2. 31-Oct-2990 + 1 Month = 30-Nov-2009

Here is a very quick and dirty example of embedding a web browser control in a clarion window.

To use the Mozilla example you will need to download and install the Mozilla ActiveX Control from here:

http://www.iol.ie/~locka/mozilla/control.htm#download

Enjoy!

Download: download EmbMozilla.app
Version: 0.1
Updated: March 16, 2009
Size: 48.25 KB
Downloads: 1,210
Details: Clarion App file created with Clarion 6.3
Download: download EmbMozilla.exe
Version: 0.1
Updated: March 16, 2009
Size: 1.03 MB
Downloads: 912
Details: Executable compiled with Clarion 6.3. in local mode so it should run as is. (Don’t forget to install the mozilla OCX!)