Skip to content

Commit 977dd10

Browse files
author
Gary Criblez
committed
Updated documentation
1 parent c321195 commit 977dd10

File tree

5 files changed

+92
-50
lines changed

5 files changed

+92
-50
lines changed

Documentation/Methods/AJUI_Btn_LoadTemplates.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
<!-- AJUI_Btn_LoadTemplates ( ) -> templates -->
1+
<!-- AJUI_Btn_LoadTemplates ( {folderPath} ) -> templates -->
22

3-
# AJUI_Btn_LoadTemplates
43

5-
## Parameters
4+
## Description
65

7-
* (text) (optional) folderPath
6+
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/).
87

9-
## Return value
108

11-
(collection) content of the template files
9+
```4d
10+
AJUI_Btn_LoadTemplates ( {folderPath} ) -> templates
11+
```
1212

13-
## Description
14-
15-
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/).
13+
| Parameter | Type | In/Out | Description |
14+
| --------- | ---- | ------ | ----------- |
15+
| folderPath | text | in | where to find the template json files |
16+
| templates | collection | out | content of the template files  |
1617

1718
## Example
1819

19-
```
20+
```4d
2021
$folder:=Folder($path;fk platform path)
2122
2223
If ($folder.exists)
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<!-- AJUI_Btn_info ( ) -> version -->
22

3-
# AJUI_Btn_info
43

5-
## Parameters
4+
## Description
65

7-
* none
6+
Show the version info of the component.
87

9-
## Return value
8+
```4d
9+
AJUI_Btn_info ( ) -> version
10+
```
1011

11-
(text) version
12+
| Parameter | Type | In/Out | Description |
13+
| --------- | ---- | ------ | ----------- |
14+
| version | text | out | version info of the component |
1215

13-
## Description
14-
15-
Show the version info of the component.
1616

1717
## Example
1818

19-
```
19+
```4d
2020
C_String($version)
2121
22-
$version:= AJUI_Btn_info ()
22+
$version:= AJUI_Btn_info () //AJUI Button(v18): 1.3.2-Build170
2323
```
Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
1-
<!-- AJUI_Button ( ) -> Button class -->
1+
<!-- AJUI_Button.new ( {template} ) -> instance of Button class -->
22

3-
# AJUI_Button
43

5-
## Parameters
6-
7-
* none
4+
## Description
85

9-
## Return value
6+
Exposes the Button class at the host base. Replace New AJUI_Button since V18R3. It is possible to pass an object as a parameter to it in order to import an AJUI Button template (JSON file).
107

11-
(object) button class
128

13-
## Description
9+
```4d
10+
AJUI_Button.new ( {template} ) -> instance
11+
```
1412

15-
Exposes the Button class at the host base.
13+
| Parameter | Type | In/Out | Description |
14+
| --------- | ---- | ------ | ----------- |
15+
| template | object | in | Properties :<br> - (text) 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.<br> - (text) (optional) templatePath : 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/). |
16+
| instance | object | out | instance of AJUI_Button with all the member functions |
1617

1718
## Example
1819

19-
```
20-
C_Object ($buttonClass)
20+
```4d
21+
Case of
22+
: (Form event code=On Load)
23+
C_Object($myButton;$template_obj)
24+
25+
$template_obj:=New object("templateName";Form.templateName;"templatePath";Form.templatePath)
26+
27+
Form.btn:=AJUI_Button.new($template_obj)
28+
Form.btn.Name("btn3")
29+
30+
//default
31+
Form.btn.BGColor(AJUI_btn_default;"lightgrey")
32+
Form.btn.Label(AJUI_btn_default;"BTN 3")
33+
Form.btn.BorderSize(AJUI_btn_default;2)
34+
35+
//hover
36+
Form.btn.BGColor(AJUI_btn_hover;"darkgrey")
37+
Form.btn.Label(AJUI_btn_hover;"On Hover")
38+
39+
//active
40+
Form.btn.BGColor(AJUI_btn_active;"grey")
41+
Form.btn.Label(AJUI_btn_active;"On Click")
42+
End case
43+
44+
Form.btn.Draw()
2145
22-
$buttonClass:=AJUI_Button
2346
```
Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,45 @@
11
<!--New AJUI_Button ( {template_obj} ) -> AJUI Tip instance -->
22

3-
# New AJUI_Button
43

5-
## Parameters
6-
7-
* (object) (optional) template :
8-
* (text) 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.
9-
* (text) (optional) templatePath : 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/).
4+
## Description
105

11-
## Return value
6+
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).
127

13-
(object) instance of an AJUI Button
8+
```4d
9+
New AJUI_Button ( {template} ) -> instance
10+
```
1411

15-
## Description
12+
| Parameter | Type | In/Out | Description |
13+
| --------- | ---- | ------ | ----------- |
14+
| template | object | in | Properties :<br> - (text) 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.<br> - (text) (optional) templatePath : 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/). |
15+
| instance | object | out | instance of AJUI_Button with all the member functions |
1616

17-
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:
1817

1918
## Example
2019

21-
```
22-
C_Object($myButton;$template_obj)
23-
C_String($path;$templateName)
24-
25-
$template_obj:=New object("templateName";$templateName;"templatePath";$path)
26-
$myButton:=New AJUI_Button ($template_obj)
27-
```
20+
```4d
21+
Case of
22+
: (Form event code=On Load)
23+
C_Object($myButton;$template_obj)
24+
25+
$template_obj:=New object("templateName";Form.templateName;"templatePath";Form.templatePath)
26+
27+
Form.btn:= New AJUI_Button($template_obj)
28+
Form.btn.Name("btn3")
29+
30+
//default
31+
Form.btn.BGColor(AJUI_btn_default;"lightgrey")
32+
Form.btn.Label(AJUI_btn_default;"BTN 3")
33+
Form.btn.BorderSize(AJUI_btn_default;2)
34+
35+
//hover
36+
Form.btn.BGColor(AJUI_btn_hover;"darkgrey")
37+
Form.btn.Label(AJUI_btn_hover;"On Hover")
38+
39+
//active
40+
Form.btn.BGColor(AJUI_btn_active;"grey")
41+
Form.btn.Label(AJUI_btn_active;"On Click")
42+
End case
43+
44+
Form.btn.Draw()
45+

Project/Sources/Methods/AJUI_Btn_info.4dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ End if
2020

2121
C_TEXT:C284($0)
2222

23-
$version_t:="1.3.2-Build170" // Fri, 12 Jun 2020 14:44:31 GMT
23+
$version_t:="1.3.2-Build171" // Fri, 26 Jun 2020 08:19:21 GMT
2424

2525
$0:="AJUI Button(v18): "+$version_t

0 commit comments

Comments
 (0)