Please enable JavaScript to view this site.

Codolex

Prerequisites

 

Delphi / RAD Studio installed

Codolex installed

 

Set up project

 

To add an activity to Codolex, we need to create a so-called plugin that will add the necessary components and code. Basically, this is a BPL. We created a plugin template for you to download, so you don't need to start from scratch. Click the following link to download the zip file with the package source code:

GDK-codolex-plugin-template.zip

 

Project settings

 

Once you downloaded the project, we need to take a look at the settings to make it ready for the new activity.

 

Add SynEdit

 

The project makes use of the installed Codolex files. The only thing you need in addition is the CodolexSynEditDR.dcp file for compiling. If you run the project straight after installation the following error will occur:

clip0026

Download the SynEdit component and place the component in your search path. Be sure to get the right version for Codolex and your RAD Studio version. In the example, we will use Codolex 1.7.0 and RAD Studio 11.3.

 

You need to include the path to this file in your search path.   

 clip0027

 

clip0028

 

Rename template files

 

Open the template project and rename the template part in the file "CodolexComponents.Template.Plugin.pas" to something that defines your plugin. Let's name it CodolexComponents.PlaySound.Plugin.pas. Don't forget to change the name defined in the PluginName function.

 

The 'Plugins\Core\Example' folder also contains the files with the name example in them. Every activity you develop should have this file set. In the implementation part, we will take a closer look at each one of these files. For now, you only have to rename the word Example to the name of your plugin.

 

Set project BPL name

 

In addition to renaming the files, it's good to rename the BPL project. This is also a good time to check if the settings are still $(Auto) for the LIB suffix.

clip0029

This ensures that the right suffix for the plugin is used. So, if you installed Codolex for Delphi 11.3, and you are building the plugin in the same version, the suffix 280.bpl is used. If the BPL does not have the right suffix, it will not be used by Codolex.

 

Define your activities

 

In the Components function in the Codolex.YourProjectName.Plugin.Pas file, you need to define the activities your plugin should contain. If you only want one activity, you can change the name of TExamplePluggableComponent to your class. If you want more activities, be sure to create them with the right names. In this example we've looked at two activities needed. Let's name them "TPlaySoundPluggableComponent" and "TStopSoundPluggableComponent"

 

clip0030

 

These are the activities that will show up in the activity palette once the plugin is complete and installed. But, as you can see from the error lines, we need to implement these activities.

 

 

© by GDK Software