Number control (#282)
This commit is contained in:
1 parent
f3aeb58b38
commit
74082f406a
9 files changed
+203
-5
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/components/Navigation/ScrollTo.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
@@ -9,9 +10,9 @@ function Init()
|
||||
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
|
||||
m.viewport = {
|
||||
x: 150
|
||||
y: 96
|
||||
y: 50
|
||||
width: 1920
|
||||
height: 550
|
||||
height: 620
|
||||
}
|
||||
end function
|
||||
|
||||
@@ -126,6 +127,8 @@ function CreateControl(item as object, container as object, startX as integer, s
|
||||
control = CreateRadioControl(item, container)
|
||||
else if item.type = "string"
|
||||
control = CreateStringControl(item, container)
|
||||
else if item.type = "number"
|
||||
control = CreateNumberComponent(item, container)
|
||||
else if item.rokuComponent <> invalid
|
||||
control = CreateRokuComponent(item, container)
|
||||
end if
|
||||
@@ -169,6 +172,19 @@ function CreateStringControl(item as object, container as object) as object
|
||||
return node
|
||||
end function
|
||||
|
||||
function CreateNumberComponent(item as object, container as object) as object
|
||||
node = container.createChild("NumberControl")
|
||||
node.displayText = item.displayText
|
||||
node.description = item.description
|
||||
if IsInt(item.min)
|
||||
node.min = item.min
|
||||
end if
|
||||
if IsInt(item.max)
|
||||
node.max = item.max
|
||||
end if
|
||||
return node
|
||||
end function
|
||||
|
||||
function CreateRokuComponent(item as object, container as object) as object
|
||||
node = container.createChild(item.rokuComponent)
|
||||
if node.hasField("displayText")
|
||||
|
||||
Reference in new issue
Block a user