-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demo tabs with object or list as datasource
- Loading branch information
1 parent
f9380d8
commit 9368b32
Showing
11 changed files
with
298 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
test UI/Project/Sources/Classes/_DEMO_tabControl_Controller.4dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
property form : cs:C1710.ui.form | ||
property backButton; cancel; ok : cs:C1710.ui.button | ||
|
||
Class constructor | ||
|
||
This:C1470.isSubform:=True:C214 | ||
|
||
// MARK:-Delegates 📦 | ||
var $form : Object | ||
$form:=Try(JSON Parse:C1218(File:C1566("/SOURCES/Forms/"+Current form name:C1298+"/form.4DForm").getText())) | ||
This:C1470.form:=cs:C1710.ui.form.new(This:C1470; $form) | ||
|
||
This:C1470.form.init() | ||
|
||
// MARK:-[Standard Suite] | ||
// === === === === === === === === === === === === === === === === === === === === === === === === | ||
Function init() | ||
|
||
// MARK: Top tabs | ||
This:C1470.TOP:=This:C1470.form.tabControl.new("tabControl1"; {\ | ||
values: ["Page 1"; "Page 2"]; \ | ||
index: 0}) | ||
|
||
// MARK: Bottom tabs | ||
var $list : Integer:=New list:C375 | ||
APPEND TO LIST:C376($list; "Page 1"; 1) | ||
SET LIST ITEM PROPERTIES:C386($list; 0; True:C214; Plain:K14:1; "path:/RESOURCES/local.svg") | ||
APPEND TO LIST:C376($list; "Page 2"; 2) | ||
SET LIST ITEM PROPERTIES:C386($list; 0; True:C214; Plain:K14:1; "path:/RESOURCES/github.svg") | ||
|
||
// ⚠️ This is a list of choices - Don't forget to call This.tabControl.clearList() to clear the memory. | ||
This:C1470.BOTTOM:=This:C1470.form.tabControl.new("tabControl"; $list) | ||
|
||
// === === === === === === === === === === === === === === === === === === === === === === === === | ||
Function handleEvents($e : cs:C1710.ui.evt) | ||
|
||
$e:=$e || cs:C1710.ui.evt.new() | ||
|
||
// MARK:Form Method | ||
If ($e.objectName=Null:C1517) // <== FORM METHOD | ||
|
||
Case of | ||
|
||
//______________________________________________________ | ||
: ($e.pageChange) | ||
|
||
// Synchronize TOP with BOTTOM (for demo) | ||
This:C1470.BOTTOM.pageNumber:=This:C1470.form.page | ||
|
||
//______________________________________________________ | ||
: ($e.unload) | ||
|
||
This:C1470.BOTTOM.clearList() // ⚠️ Its a choiceList | ||
|
||
//______________________________________________________ | ||
End case | ||
|
||
return | ||
|
||
End if | ||
|
||
// MARK: Widget Methods | ||
Case of | ||
|
||
//============================================== | ||
: (This:C1470.BOTTOM.catch($e)) | ||
|
||
This:C1470.BOTTOM.goToPage() | ||
|
||
//============================================== | ||
End case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
test UI/Project/Sources/Forms/DEMO_tabControl/form.4DForm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"$4d": { | ||
"version": "1", | ||
"kind": "form" | ||
}, | ||
"windowSizingX": "fixed", | ||
"windowSizingY": "fixed", | ||
"windowMinWidth": 0, | ||
"windowMinHeight": 0, | ||
"windowMaxWidth": 32767, | ||
"windowMaxHeight": 32767, | ||
"rightMargin": 20, | ||
"bottomMargin": 20, | ||
"events": [ | ||
"onLoad", | ||
"onClick", | ||
"onUnload", | ||
"onPageChange" | ||
], | ||
"destination": "detailScreen", | ||
"pages": [ | ||
{ | ||
"objects": { | ||
"tabControl": { | ||
"type": "tab", | ||
"text": "Tab control", | ||
"top": 127, | ||
"left": 17, | ||
"width": 530, | ||
"height": 118, | ||
"dataSource": "formGetInstance.BOTTOM.dataSource", | ||
"events": [ | ||
"onClick" | ||
] | ||
}, | ||
"ok": { | ||
"type": "button", | ||
"text": "OK", | ||
"top": 265, | ||
"left": 459, | ||
"width": 88, | ||
"height": 25, | ||
"events": [ | ||
"onClick" | ||
] | ||
}, | ||
"cancel": { | ||
"type": "button", | ||
"text": "Cancel", | ||
"top": 265, | ||
"left": 351, | ||
"width": 88, | ||
"height": 25, | ||
"events": [ | ||
"onClick" | ||
], | ||
"defaultButton": false | ||
}, | ||
"tabControl1": { | ||
"type": "tab", | ||
"text": "Tab control", | ||
"top": 15, | ||
"left": 17, | ||
"width": 530, | ||
"height": 92, | ||
"dataSource": "formGetInstance.TOP.dataSource", | ||
"events": [], | ||
"action": "gotoPage" | ||
} | ||
} | ||
}, | ||
{ | ||
"objects": { | ||
"Static Picture2": { | ||
"type": "picture", | ||
"top": 155, | ||
"left": 236, | ||
"width": 90, | ||
"height": 90, | ||
"picture": "/RESOURCES/local.svg", | ||
"pictureFormat": "scaled" | ||
} | ||
}, | ||
"entryOrder": [] | ||
}, | ||
{ | ||
"objects": { | ||
"Static Picture3": { | ||
"type": "picture", | ||
"top": 155, | ||
"left": 235, | ||
"width": 90, | ||
"height": 90, | ||
"picture": "/RESOURCES/github.svg", | ||
"pictureFormat": "scaled" | ||
} | ||
} | ||
} | ||
], | ||
"geometryStamp": 662, | ||
"editor": { | ||
"activeView": "View 1", | ||
"defaultView": "View 1", | ||
"views": { | ||
"View 1": {} | ||
} | ||
}, | ||
"method": "formMethod" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,69 @@ | ||
{ | ||
"dependencies": { | ||
"UI": {} | ||
"UI": {}, | ||
"4DPop": { | ||
"github": "vdelachaux/4DPop", | ||
"version": "latest" | ||
}, | ||
"4DPop AppMaker": { | ||
"github": "vdelachaux/4DPop-AppMaker", | ||
"version": "latest" | ||
}, | ||
"4DPop Git": { | ||
"github": "vdelachaux/4DPop-Git", | ||
"version": "latest" | ||
}, | ||
"4DPop Macros": { | ||
"github": "vdelachaux/4DPop-Macros", | ||
"version": "latest" | ||
}, | ||
"4DPop QuickOpen": { | ||
"github": "vdelachaux/4DPop-QuickOpen", | ||
"version": "latest" | ||
}, | ||
"4DPop XLIFF Pro": { | ||
"github": "vdelachaux/4DPop-XLIFF-Pro", | ||
"version": "latest" | ||
}, | ||
"4DPop Bookmarks": { | ||
"github": "vdelachaux/4DPop-Bookmarks", | ||
"version": "latest" | ||
}, | ||
"4DPop ColorChart": { | ||
"github": "vdelachaux/4DPop-ColorChart", | ||
"version": "latest" | ||
}, | ||
"4DPop Commands": { | ||
"github": "vdelachaux/4DPop-Commands", | ||
"version": "latest" | ||
}, | ||
"4DPop Constants Editor": { | ||
"github": "vdelachaux/4DPop-Constants-Editor", | ||
"version": "latest" | ||
}, | ||
"4DPop Image Buddy": { | ||
"github": "vdelachaux/4DPop-Image-Buddy", | ||
"version": "latest" | ||
}, | ||
"4DPop KeepIt": { | ||
"github": "vdelachaux/4DPop-KeepIt", | ||
"version": "latest" | ||
}, | ||
"4DPop Pasteboard": { | ||
"github": "vdelachaux/4DPop-Pasteboard", | ||
"version": "latest" | ||
}, | ||
"4DPop Rulers": { | ||
"github": "vdelachaux/4DPop-Rulers", | ||
"version": "latest" | ||
}, | ||
"4DPop sqlSchemas": { | ||
"github": "vdelachaux/4DPop-sqlSchemas", | ||
"version": "latest" | ||
}, | ||
"4DPop Window": { | ||
"github": "vdelachaux/4DPop-Window", | ||
"version": "latest" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.