Codebot Cross Library
This is the official landing page for the Codebot Cross library. Source code, assets, and example projects are hosted on Github under the GLPv3 open source license. The library has been in constant development for over a decade and has been updated or hosted on various servers, but the main line is now and will in the future be permanently synchronized with Github.The packages and other assets contained in the library are designed to be used with the Free Pascal compiler and the Lazarus IDE. It adds many enhancements, performance improvements, advanced design elements, routines, classes components, and controls.
Installation
To make use of this library you'll need to clone or download it from the official Github repository. You'll need to open the appropriate package from the source folder and build it. This step will register the package with the IDE. You can then start any new project and use the project inspector to add "codebot" or "codebot controls" package as a requirement. After adding the requirement you can make use of the library in that project.Registering a Package
The following are the steps you would take in the Lazarus IDE to install the controls packages.- Open the codebot.lpk package and press the build button.
- Open the codebot_controls.lpk package and press the build button.
- Open the codebot_controls_design.lpk package and press the build button.
- In the codebot_controls_design.lpk package click use -> install.
- When prompted click yes to rebuild the IDE.
Project Source
When using this library it is recommended to place theCodebot.System
unit as the first unit in your project uses clause. You can then delete any platform specific threading or memory management units from the project source. The Codebot.System
unit will take care of these platform specific options for you.
Unit Options
Please note all the source code units in the library use{$mode delphi}
and reference a {$i codebot.inc}
standard library include file that defines unit level compilation options.
Documentation
Most of the content in the Codebot Cross library is well documented in its source code files. Every type, function, class, and method is decorated with detailed information in the form of comments. Some of the content is categorized by group, functionality, and is often linked to other related content. Most of the content is further organized by regions, which can be expanded or collapsed in the IDE.Example
Below is an example of how the documentation appears in the source code taken from the command line switch routines of theCodebot.System
unit. Most of the content in this library is organized in this fashion, and reading or browsing the source code should provide users with more than enough information to understand how content in the library can be used.{ Returns true if a program has a matching switch See also <link Codebot.System.SwitchIndex, SwitchIndex function> <link Codebot.System.SwitchValue, SwitchValue function> [group string] } function SwitchExists(const Switch: string): Boolean; { Returns the index of a program's matching switch or -1 if no match was found See also <link Codebot.System.SwitchExists, SwitchExists function> <link Codebot.System.SwitchValue, SwitchValue function> [group string] } function SwitchIndex(const Switch: string): Integer; { Returns the value of a program's switch See also <link Codebot.System.SwitchExists, SwitchExists function> <link Codebot.System.SwitchIndex, SwitchIndex function> [group string] } function SwitchValue(const Switch: string): string;
Organization
The source code in this library is organized into three packages. These packages are the base package, the control package, and the rendering package. The last two packages depend on the base package.Below is a brief summary of the three packages.
Codebot Package
The codebot package is the base package of this library. It includes routines and classes for general programming purposes. Some of the functionality includes enhanced string handling, dynamic array extensions, file and directory services, simplified threading, multicast delegates, simplified sockets with SSL/TLS support, an advanced graphics interface, XML, JSON, text encoding, and much more.Functionality is organized by dotted unit namespace names. For example the an XML interface is provided in the
Codebot.Text.XML
namespace, while an implemenation of FTP is provided by the Codebot.Networking.FTP
namespace. This design pattern of related functionality group into general then progressively more specific namespaces is repeated throughout the entire library.
Controls Package
The controls package relies on the codebot package and provides a collection of components, controls, and IDE designer enhancements. All controls make use of the advanced graphic interface defined in the codebot base package. These advanced graphics are exposed by way of aISurface
property and a protected virtual Render
method that can be override.Some of the custom controls include
TContentGrid
, THuePicker
, TIndeterminateProgress
, TDrawList
, TRenderBox
, TThinButton
, and TSlideBar
. Several custom form modules are also included in the controls package as well as useful components such as TTextStorage
, and TImagStrip
.