-
Notifications
You must be signed in to change notification settings - Fork 3
5. Component methods
AJUI_Button ( { template_obj} ) -> class obj
This method replaces New AJUI_Button starting from V18R3, it is used to return the Button class. The functions of the class are identical to the formulas. It is possible to pass an object as a parameter to it in order to import an AJUI Button template (JSON file). The object expects as properties:
- templateName : Name of the folder containing the JSON file to import (template). If the file is not found, the method will return a new instance of AJUI Button.
C_OBJECT($o)
$o:=New object("templateName";"slideOn")
Form.btn1:=AJUI_Button.new ($o)
Form.btn1.Name("btn1")
- templatePath (optional): You can specify a path to retrieve the file otherwise, the component will search in the default folder located in the resources (.../Resources/AJUI_Button_Templates/). You can use "#" to designate the 4D resources folder in your path.
$template_obj:=New object("templateName";"MyTemplate.json";"templatePath";"C/:/MyTemplates/")
$myBtn:=AJUI_Button.new ($template_obj)
AJUI_Btn_LoadTemplates ({folderPath}) -> templates_name_col
Utility method to get all JSON files from a folder into a collection. You can pass in parameter the path of the folder containing the templates. If this is not the case, the method will search in the default path (.../Resources/AJUI_Button_Templates/).
$folder:=Folder(Form.templateLocPref.path_global;fk platform path)
If($folder.exists)
$templates_col:=AJUI_Btn_LoadTemplates($folder.platformPath)
End if
AJUI_Btn_info ( ) -> version_txt
This method returns a string representing the version number of the component.
New AJUI_Button ( { template_obj} ) -> button_obj
This method returns an object variable that represents an instance of AJUI Button. It contains all the properties and their default values as well as the formulas (member functions) to manipulate them. It is possible to pass an object as a parameter to it in order to import an AJUI Button template (JSON file). The object expects as properties:
- templateName : Name of the folder containing the JSON file to import (template). If the file is not found, the method will return a new instance of AJUI Button.
C_OBJECT($o)
$o:=New object("templateName";"slideOn")
Form.btn1:=New AJUI_Button ($o)
Form.btn1.Name("btn1")
- templatePath (optional): You can specify a path to retrieve the file otherwise, the component will search in the default folder located in the resources (.../Resources/AJUI_Button_Templates/). You can use "#" to designate the 4D resources folder in your path.
$template_obj:=New object("templateName";"MyTemplate.json";"templatePath";"C/:/MyTemplates/")
$myBtn:=New AJUI_Button($template_obj)
AJUI Button 1.3.3 - Wednesday, 29 July 2020
User Manual 🇺🇸