Skip to content

DEPRECATED Properties and formulas

Gabriel Inzirillo edited this page Nov 30, 2020 · 1 revision

DEPRACATED

The descriptions here are only keep in compatibility if you are not using the AJUI_Button class.

A button has a set of properties that will define its representation and interactions with the host form. In this chapter, we will review the different existing properties accessible by a formula that acts as Setter and also as Getter if no parameter is passed to them (the parameter corresponding to the state remains mandatory).

All formulas can be called up at the first level of the object.

⚠️ concerning the formulas requiring the state of the button, this one is mandatory, only the second parameter is optional to realize a Getter in this case.

For color-related properties, you can give them a color code in hexadecimal (e. g. 0x00FFFFFFFF) or as CSS strings (e. g. "black", "#0A509E").

It is recommended not to manually modify properties whose values are not defined by formulas because they are managed internally by the component.

Global

Global properties at the second level of the object : btn.global

Formula Description
Composition -> string
Default value : text
Parameter :
* Button composition (string)
Button composition :
- text
- picture
- composite
Name -> string
Default value : empty string
Parameter :
* Button name (string)
Name of the button and therefore of the picture form object.
OnClick -> string
Default value : empty string
Parameters :
* Callback (string)
* Parameters (object)
Name of the callback method on the event « On Click ». You can pass in the second parameter an object that contains the callback parameters.
OnDoubleClick -> string
Default value : empty string
Parameters :
* Callback (string)
* Parameters (object)
Name of the callback method on the event « On Double Click ». You can pass in the second parameter an object that contains the callback parameters.
Type -> string
Default value : rectangle
Parameter :
* Button type (string)
Button type (shape) :
- rectangle
- circle.

Box

Properties related to the container on the second level of the object : btn.box

Formula Description
BGColor -> string
Default value : #4d9ad4
Parameters :
* Button state (constant)
* Primary color (string)
Main button color. It is possible to define an opacity rate (%). (E.g.: black:80 - black with 80% opacity).
CornerRadius -> longint
Default value : 5
Parameters :
* Button state (constant)
* Corner radius (longint)
Value of the radius applied to the four corners of the buttons.
Height -> longint
Default value : -1
Parameters :
* Button state (constant)
* Button height (longint)
Button height. The value -1 takes the original height of the picture
padding -> longint
Default value : 3
Parameters :
* Button state (constant)
* Button padding (longint)
Button padding. Set the padding of the button, cannot be <0
Resizable -> boolean
Default value : False
Parameter :
* Resize form object (boolean)
If true, it will take into account the values passed in height and width. If false, it takes into account the dimensions of the picture object in the form editor.
Width -> longint
Default value : -1
Parameters :
* Button state (constant)
* Button width (longint)
Button width. The value -1 takes the original width of the picture

Border

Border properties at the second level of the object : btn.border

Formula Description
BorderColor -> string
Default value : #0a509e
Parameters :
* Button state (constant)
* Border color (string)
Border color. It is possible to define an opacity rate (%).
BorderSize -> longint
Default value : 0
Parameters :
* Button state (constant)
* Border size (longint)
Border size.

Text

Properties related to text elements on the second level of the object : btn.text

Formula Description
FontColor -> string
Default value : white
Parameters :
* Button state (constant)
* Text color (string)
Text color. It is possible to define an opacity rate (%).
FontName -> string
Default value : Arial, Helvetica, MS Sans Serif
Parameters :
* Button state (constant)
* Font name (string)
Name of the font to use. Several fonts can be entered by separating them with a comma without spaces. The component will search for the first usable font in relation to your OS.
FontSize -> longint
Default value : 16
Parameters :
* Button state (constant)
* Font size (longint)
Font size.
FontStyle -> string
Default value : empty string
Parameters :
* Button state (constant)
* Font style (string)
Font style :
- Bold
- Italic
- Underline
- Strikethrough
textAlign -> string
Default value : "center"
Parameters :
* Button state (constant)
* Text Align (string)
Text Align :
- left
- center
- right
Label -> string
Default value : Label
Parameters :
* Button state (constant)
* Button label (string)
Text to be displayed.
TextMarginHorizontal -> longint
Default value : 0
Parameters :
* Button state (constant)
* Horizontal margin (longint)
Horizontal margin applied to the text to add a gap when it is aligned to the left or right. If the text is centered, it can be compressed. The margin applies to each side of the text.

Picture

Properties related to picture elements on the second level of the object : btn.picture

Formula Description
ColorToReplace -> string
Default value : empty string
Parameters :
* Button state (constant)
* Old color (string)
Current color of a SVG picture. Value of the tag "fill".
PictureHeight -> longint
Default value : -1
Parameters :
* Button state (constant)
* Picture height (longint)
Picture height. The value -1 takes the original height of the picture.
PictureOpacity -> longint
Default value : 100
Parameters :
* Button state (constant)
* Opacity of the picture (longint)
Picture opacity rate.
PicturePath -> string
Default value : empty string
Parameters :
* Button state (constant)
* Path of the picture (string)
Folder path from the "resources" folder.

You can also use "#" plus the name of your picture file as a path. This will only work with an imported AJUI Button template and the picture must be located in the same folder as the template.
PictureRatio -> real
Default value : 1
Parameters :
* Button state (constant)
* Ratio of the picture size (real)
Enlarges/reduces the picture size. It is taken into consideration instead of the properties height and width. The value 1 disables the consideration of the ratio (1 = current picture size).
ReplacingColor -> string
Default value : empty string
Parameters :
* Button state (constant)
* New color (string)
Color to replace the current color in an SVG picture.
PictureScale -> longint
Default value : 0
Parameters :
* Button state (constant)
* Scale of the picture (string)
Resizing the picture according to the size of the button according to a percentage. Overrides all other properties that change the size. The value zero disables this operation. The value must be between 0 and 100.
PictureWidth -> longint
Default value : -1
Parameters :
* Button state (constant)
* Picture width (longint)
Picture width. The value -1 takes the original width of the picture.

Composite

Properties related to composite elements at the second level of the object : btn.composite

Formula Description
CompActiveSecondColor -> boolean
Default value : False
Parameter :
* Activate second color (boolean)
Active second color.
BGSecondaryColor -> string
Default value : #9fddf9
Parameters :
* Button state (constant)
* Secondary color (string)
Secondary color for composite. It is possible to define an opacity rate (%) (example: black:80 - black with 80% opacity).
CompLinked -> boolean
Default value : False
Parameter :
* Bind text and picture (boolean)
Binds the text with the picture and applies a padding between them (secondary color is not active in this case).
CompPadding -> longint
Default value : 10
Parameters :
* Button state (constant)
* Padding between text and picture (longint)
Padding between the picture and the text if linked.
CompPicturePosition -> string
Default value : left
Parameters :
* Button state (constant)
* Picture position (string)
Position of the picture in the button (only applicable for composites).

Available position :
- left
- right
- top
- bottom
CompPictSizeAllocation -> longint
Default value : 30
Parameters :
* Button state (constant)
* Size allocated to the picture (longint)
Space (in px) allocated to the picture in proportion to the text. This is used to resize the picture if it exceeds the button limits.

This value will be applied to the height or width depending on the position of the image in relation to the text.
CompTextAlign -> string
Default value : center
Parameters :
* Button state (constant)
* Text align (string)
Text align in the composite button :
- left
- center
- right).