Components / libraries / libdesc program


Documents presenting more information about component packages

HBasic developers
C++ library developers

Overview components

There are many different programming languages which allow loading shared libraries at runtime to extend the methods and types defined in the base program. HBasic can load shared libraries that may export constant values, method definitions and descriptions of components. A component may be a visible widget like a button or a scrollbar or can be used like new types in the HBasic sourcecode. The sourcecode for a component is C or C++ code. This sourcecode will be compiled to a shared object library which may be linked to HBasic at runtime.

Components may export methods, properties and events similar to a class definition. If you create an instance of a component in your code you may access methods and properties of the component and connect to events triggered by the component. A group of component definitions will be called package and can be loaded into your HBasic project with the package manager.

Visible components (Qt widgets) can be inserted into your project forms in the formdesigner. All base widgets will be defined in the hbasic_stdgui package. Each icon in the select window on the left side of the HBasic main window represents one component type. Just click on the widget icon and create the component instance with another mouseclick in the formdesigner window. You may also create instances of components within the sourcecode with a Dim statement.

Example: Create instance of component Date defined in library hbasic_datetime_1.so
Create Instance in HBasic sourcecode and access method month() defined in component with statement"

Dim d As Date
Print d.month()

HBasic delivers some predefined component packages for common tasks. The sourcecode for the components is C or C++ code. Defining your own components you may integrate nearly all functions that may be created with a C++ program into the HBasic language. You can also create Qt widgets with your own functions that may be used in the HBasic formdesigner (see useredit component or remote admin component).

As a HBasic developer you should know how to add packages to your project with the package manager. If you want to extend available components or create new libraries you show read the information for C++ library developers. Since HBasic needs some additional information about libraries before it knows how to handle the objects in the library developers should also read the documentation of the libdesc program. The libdesc program is a GUI interface to edit library description files (*.dso)