Android 上的 Rebol GUI 显示太小
Rebol GUI on Android Displays Too Small
所以我发现了 Rebol,并且很高兴它能在 Android 上运行。但是,当我创建 GUI 时,GUI 首先弹出屏幕中央的左上角,我无法移动或调整 window 的大小。如果我将我的 phone 旋转到水平显示,window 会适当地调整自身大小以适应屏幕。然后我将 phone 旋转到垂直显示,window 正确填充屏幕。
但是 window 上的所有内容都是微不足道的——几乎无法通过手指点击进行交互。
我还没有看到其他人抱怨这个问题。我该如何解决?我希望小部件显示与在我的 phone 上运行的所有其他应用程序中相同的大小。当然,让 window 正确打开,这样我就不必旋转我的 phone 两次来让它正确显示,这也很好。
我为 Android (r3-droid.apk) here.
下载了 Rebol
然后我下载了 GUI 支持 here。
Phone 规格:
- 三星 Galaxy Note 3
- Android 版本 5.0
生成GUI的代码:
REBOL [title: "Widgets on Screen"]
do %r3-gui.r3
view [
field
area
check
radio
text-list
text-table
drop-down
button
]
查看演示。在底部字段中键入 demo 并 运行 以查看如何调整面孔以适应屏幕尺寸。但正如 giuliolunati 所说,这个版本已经超过 2 年并且没有公开维护。
在我的 HP 21" Android 平板上,面的尺寸正确,但 运行 非常缓慢。
您最好的选择可能是观看红色 Android 分支,它很快就会提供 GUI。
REBOL []
site: http://development.saphirion.com/experimental/
load-gui
;do site/r3-gui.r3
dpi: gui-metric 'screen-dpi
gui-metric/set 'unit-size dpi / 96
scr: round/floor (gui-metric 'work-size) - gui-metric 'title-size
stylize [
but: button [
facets: [
init-size: 100x48
max-size: 260x48
min-size: 24x34
align: 'center
]
]
]
view/options [
title "R3/Droid demos"
vpanel [
but "R3GUI widgets" on-action [
if request/custom/options "R3GUI widgets" [
vtight [
vgroup [
prg: progress 50%
sld: slider 50% attach 'prg options [min-size: 100x22]
button "button"
toggle "toggle"
drop-down [
"Select an option"
"Option 1"
"Option 2"
"Option 3"
"Option 4"
"Option 5"
]
htight [
vtight [
radio "radio 1"
radio "radio 2"
radio "radio 3"
]
vtight [
check "check 1"
check "check 2"
check "check 3"
]
]
field "Some input text"
area "more text here"
text-list [
"text list"
"line 2"
"line 3"
"line 4"
"line 5"
"line 6"
"line 7"
"line 8"
"line 9"
"last line"
]
text-table ["1" 80 "2" 50 "3"][
["text table" "a" "10"]
["line 2" "b" "9"]
["line 3" "c" "8"]
["line 4" "d" "7"]
["line 5" "e" "6"]
["line 6" "f" "5"]
["line 7" "g" "4"]
["line 8" "h" "3"]
["line 9" "i" "2"]
["last line" "j" "1"]
] options [show-header: false]
] options [max-hint: [480 auto] box-model: 'frame]
] options [max-hint: guie/max-pair pane-align: 'center]
when [rotate] on-action [
win: arg/gob/data
bg: first faces? win
win/facets/max-hint:
bg/facets/max-hint:
as-pair arg/offset/x guie/max-coord
update-face/no-show/content bg
]
]["I like that!" "Close"][offset: 0x0 max-hint: reduce [scr/x guie/max-coord]]
[browse http://development.saphirion.com/donations/ ]
]
but "tile game" on-action [
request/custom "Downloading files..." [
title "Loading game..."
when [enter] on-action [
game: load/all site/tile-game.r
unview/all
gui-metric/set 'unit-size 1x1
do game
]
]["" "Close"]
]
but "graphics test" on-action [
request/custom "Downloading files..." [
title "Loading script..."
when [enter] on-action [
script: load/all site/draw-test.r
unview/all
gui-metric/set 'unit-size 1x1
do script
]
]["" "Close"]
]
but "performace survey" on-action [
request/custom "Downloading files..." [
title "Loading test..."
when [enter] on-action [
app: load/all site/dt-01.r
unview/all
gui-metric/set 'unit-size 1x1
do app
]
]["" "Close"]
]
pad
] options [box-model: 'frame]
hpanel [
button "I want donate" on-action [browse http://development.saphirion.com/donations/ ]
button "close" on-action [
close-window face
]
] options [align: 'right]
when [rotate] on-action [
win: arg/gob/data
bg: first faces? win
win/facets/max-hint:
bg/facets/max-hint:
as-pair arg/offset/x max arg/offset/y win/facets/intern/min-heights/1
update-face/no-show/content bg
]
][
offset: 0x0
max-hint: scr
]
此外,对于未来的观众,您可能需要调整 gui-metric
dpi。我发现 128 在 Android Note3 上工作。
gui-metric/set 'unit-size dpi / 128
所以我发现了 Rebol,并且很高兴它能在 Android 上运行。但是,当我创建 GUI 时,GUI 首先弹出屏幕中央的左上角,我无法移动或调整 window 的大小。如果我将我的 phone 旋转到水平显示,window 会适当地调整自身大小以适应屏幕。然后我将 phone 旋转到垂直显示,window 正确填充屏幕。
但是 window 上的所有内容都是微不足道的——几乎无法通过手指点击进行交互。
我还没有看到其他人抱怨这个问题。我该如何解决?我希望小部件显示与在我的 phone 上运行的所有其他应用程序中相同的大小。当然,让 window 正确打开,这样我就不必旋转我的 phone 两次来让它正确显示,这也很好。
我为 Android (r3-droid.apk) here.
下载了 Rebol然后我下载了 GUI 支持 here。
Phone 规格:
- 三星 Galaxy Note 3
- Android 版本 5.0
生成GUI的代码:
REBOL [title: "Widgets on Screen"]
do %r3-gui.r3
view [
field
area
check
radio
text-list
text-table
drop-down
button
]
查看演示。在底部字段中键入 demo 并 运行 以查看如何调整面孔以适应屏幕尺寸。但正如 giuliolunati 所说,这个版本已经超过 2 年并且没有公开维护。
在我的 HP 21" Android 平板上,面的尺寸正确,但 运行 非常缓慢。
您最好的选择可能是观看红色 Android 分支,它很快就会提供 GUI。
REBOL []
site: http://development.saphirion.com/experimental/
load-gui
;do site/r3-gui.r3
dpi: gui-metric 'screen-dpi
gui-metric/set 'unit-size dpi / 96
scr: round/floor (gui-metric 'work-size) - gui-metric 'title-size
stylize [
but: button [
facets: [
init-size: 100x48
max-size: 260x48
min-size: 24x34
align: 'center
]
]
]
view/options [
title "R3/Droid demos"
vpanel [
but "R3GUI widgets" on-action [
if request/custom/options "R3GUI widgets" [
vtight [
vgroup [
prg: progress 50%
sld: slider 50% attach 'prg options [min-size: 100x22]
button "button"
toggle "toggle"
drop-down [
"Select an option"
"Option 1"
"Option 2"
"Option 3"
"Option 4"
"Option 5"
]
htight [
vtight [
radio "radio 1"
radio "radio 2"
radio "radio 3"
]
vtight [
check "check 1"
check "check 2"
check "check 3"
]
]
field "Some input text"
area "more text here"
text-list [
"text list"
"line 2"
"line 3"
"line 4"
"line 5"
"line 6"
"line 7"
"line 8"
"line 9"
"last line"
]
text-table ["1" 80 "2" 50 "3"][
["text table" "a" "10"]
["line 2" "b" "9"]
["line 3" "c" "8"]
["line 4" "d" "7"]
["line 5" "e" "6"]
["line 6" "f" "5"]
["line 7" "g" "4"]
["line 8" "h" "3"]
["line 9" "i" "2"]
["last line" "j" "1"]
] options [show-header: false]
] options [max-hint: [480 auto] box-model: 'frame]
] options [max-hint: guie/max-pair pane-align: 'center]
when [rotate] on-action [
win: arg/gob/data
bg: first faces? win
win/facets/max-hint:
bg/facets/max-hint:
as-pair arg/offset/x guie/max-coord
update-face/no-show/content bg
]
]["I like that!" "Close"][offset: 0x0 max-hint: reduce [scr/x guie/max-coord]]
[browse http://development.saphirion.com/donations/ ]
]
but "tile game" on-action [
request/custom "Downloading files..." [
title "Loading game..."
when [enter] on-action [
game: load/all site/tile-game.r
unview/all
gui-metric/set 'unit-size 1x1
do game
]
]["" "Close"]
]
but "graphics test" on-action [
request/custom "Downloading files..." [
title "Loading script..."
when [enter] on-action [
script: load/all site/draw-test.r
unview/all
gui-metric/set 'unit-size 1x1
do script
]
]["" "Close"]
]
but "performace survey" on-action [
request/custom "Downloading files..." [
title "Loading test..."
when [enter] on-action [
app: load/all site/dt-01.r
unview/all
gui-metric/set 'unit-size 1x1
do app
]
]["" "Close"]
]
pad
] options [box-model: 'frame]
hpanel [
button "I want donate" on-action [browse http://development.saphirion.com/donations/ ]
button "close" on-action [
close-window face
]
] options [align: 'right]
when [rotate] on-action [
win: arg/gob/data
bg: first faces? win
win/facets/max-hint:
bg/facets/max-hint:
as-pair arg/offset/x max arg/offset/y win/facets/intern/min-heights/1
update-face/no-show/content bg
]
][
offset: 0x0
max-hint: scr
]
此外,对于未来的观众,您可能需要调整 gui-metric
dpi。我发现 128 在 Android Note3 上工作。
gui-metric/set 'unit-size dpi / 128