This post is a heads up to let you know that the syntax highlighting package for Clarion, SublimeClarion, is now available from Sublime Package Control!

If you have not done so already, first install Sublime Package Control as described here then install the SublimeClarion package via the command palette. .. couldn’t be easier! More details on command palette usage here.

 

image

-brahn

 

Ok, so before you ask why on earth would you bother let me explain 🙂

As part of my work over at ClarionAddins I am always looking for way to improve the user experience as well as stretching my knowledge of .Net programming. I thought it might be nice to use WPF but since the Clarion IDE is targeting v2.0 of the .Net framework this is not so easy. Hence this example!

Of course there are many resources out there related to this topic, see below, but nothing I could discover specific to v2.0 so for me it took a little work to get there. I learnt a lot about reflection along the way!

This code assumes that the v3.5 Framework is installed on the target machine. For production it would of course be necessary to test for this and react accordingly.

Here is a screenshot of this technique being used in an addin I am working on:

WPF UserControl in an Addin Pad!

-brahn

 

The following is a simple example of running a native clarion win32 application as a cloud service.

Technologies used:

For the Impatient

See it running – WazClarion (Waz – Windows Azure!)

Say what?!

Using the PackAndDeploy example from the Smarx Running the Mongoose Web Server in Windows Azure tutorial I have managed to successfully test and deploy a clarion application to the Windows Azure cloud service! Read on for some more info on the steps involved. Leave a comment or send me an email if you have any questions.

Prerequisites

Install the Windows Azure SDK to your dev machine.

Step 1 –  Git clone the PackAndDeploy to a dev folder.

See Step 1 in the Quick Walkthrough from Smarx.

Additionally I highly recommend following that example and making sure that your Azure SDK and emulator are setup and running correctly and get a little familiar with Azure before you start adding clarion to the mix.

Step 2 – Prepare your clarion APP

I used the “BasicBrowseAndForm” example that comes with NetTalk. Anything that can reply to HTTP requests should work fine.

There were a couple of changes to get the example working

  • WebServer procedure, in ThisWebServer.Open, before parent

  • WebServer procedure, in ThisWindow.Init

  • In application global properties, file control tab set the access mode to ReadOnly.

Step 3 – Adjust the PackAndDeploy example to work with the clarion app

Delete all the files in the WorkerRole sub directory except for the Run.cmd

Edit the WorkerRole\Run.cmd file to look like this:

Copy your clarion EXE and support directories into the WorkerRole folder. Anything in this folder gets included in the deployment package.

Step 4 – Deploy to the cloud

Use the “pack.cmd” from the PackAndDeploy example to create a package for upload and use the Windows Azure portal to deploy your application!

Step 5 – See it in Action!

http://wazclariontest.cloudapp.net/

Ok so it is not perfect yet, I had to tell clarion to only access the files in ReadOnly mode. You would need to look into the various storage options to fix that if you really want to use TPS, a better alternative will most likely be to use SQL server for your data needs. Error handling and diagnostics would need some forethought. There is a way to access a remote desktop session for debugging via a GUI if you want though. The pack and deploy process can probably do with some further automation too Smile.

 

Sublime Text is a sophisticated text editor for code, html and prose. You’ll love the slick user interface and extraordinary features.

I must say that after a few days of use I totally agree! This is looking like the top contender to replace TextPad, something I have been trying to do for years without any success. TextPad is great but falls short in a few places and until now I have not found anything that comes close to its ease of use and performance…

Of course there is no syntax definition available for clarion files by default so I have made a start on one.

Disclaimer, I am new to Sublime Text as well as GitHub but I will plug away at it for a while and see what comes out!

You should take a look at the official help for creating Syntax Definitions before trying to understand the files in the GitHub repo. When it is a little more mature I will create a package that can be loaded easily, for now you will have to do it the hard way 🙂

Grab the code for SublimeClarion on GitHub.

image

-brahn

 

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: 596