Framework-independent function API

Previous Next

USoft provides a function API for creating controls that are portable across supported frameworks.

Why would you need this?

Creating a button directly out of a HTML string does not automatically style it the same way as a button generated by a button control in a framework you are using, nor will it always behave the same way. Of course, adding the appropriate classes and event types would solve that, but when changing to a different framework you will have to change all these class names and even types. Moreover, some frameworks behave completely differently than others, with different HTML elements that are needed, and even different framework-specific events.

The syntax and API for framework-independent functions is identical for each of the frameworks supported: the function body takes care of the differences. The implementation is such that each of these functions, when called, calls another function that is specific for the framework.

For details on supported frameworks, search 'frameworks' on USoft Community or click here.

The examples displayed in the table below happen to make use of the ‘bootstrap4’ framework.

Function

Description

Example

.usbutton()

Decorates a plain button. Allows the addition of icons, for example for turning the button into a lookup button.

US_clip0001

.usbuttonset()

Creates a group of buttons that act as "radio buttons".

US_clip0002

.usdialog()

Creates a dialog on the basis of a DIV element.

US_clip0003

.usgroup()

Creates a bordered box with a header text on the basis of a DIV element.

US_clip0004

.usmenu()

Creates a horizontally oriented dropdown menu on the basis of an HTML structure consisting of (nested) UL and LI elements.

US_clip0005

.ustabs()

Creates a tab control that shows one panel at at time, depending on the tab clicked on.

US_clip0006

.usdatepicker()

Creates a datepicker using the current framework’s styling classes.

US_clip0007

 

See also

GUI elements (controls)