-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgui.bas
More file actions
80 lines (69 loc) · 2.24 KB
/
gui.bas
File metadata and controls
80 lines (69 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import raylib as rl
import raylibc as c
import debug
const screenWidth = 450
const screenHeight = 450
'rl.SetWindowState(0x00000800)
rl.InitWindow(screenWidth, screenHeight, "SmallBASIC raylib gui")
rl.SetWindowPosition(rl.GetMonitorWidth(0) - screenWidth - 20, (rl.GetMonitorHeight(0) - screenHeight) / 2)
rl.SetTargetFPS(60)
'run("xdotool windowactivate `xdotool search --onlyvisible --name \"Emacs\"`")
'rl.UsndecorateWindow()
cp = c.YELLOW
text = "input text"
while (!rl.WindowShouldClose() && !debug.IsSourceModified())
rl.BeginDrawing()
rl.ClearBackground(c.RAYWHITE)
x = 10: y = 10: h = 39
if (rl.GuiButton([x, y, 80, 35], "My Button")) then
showAlert=true
endif
if (showAlert) then
select case rl.GuiMessageBox([100, 100, 280, 235], "Close Window", "Do you really want to quit?", "Yes;No")
case -1
case 0
showAlert = false
case 1
pbv = 50
showAlert = false
case 2
pbv = 0
showAlert = false
end select
else
y += h + 5: h = 15
checked1 = rl.GuiCheckbox([x, y, h, h], "My Check", checked1)
y += h + 5
alpha = rl.guicolorbaralpha([x, y, 140, h], "", alpha)
y += h + 5: h = 50
hue = rl.guicolorbarhue([x, y, h, h], "", hue)
y += h + 5: h = 110
cp = rl.guicolorpicker([x, y, w, h], "", cp)
y += h + 5: h = 30
cba = rl.GuiComboBox([10, y, 120, h], "one;two;three;four;five", cba)
y += h + 5
if (rl.guidropdownbox([10, y, 120, h], "one;two;three;four;five", cbx, is_open)) then
is_open = !is_open
endif
x = 180: y = 10: h = 100
n = rl.guigrid([x, y, h, h], "", 20, 5)
y += h + 5: h = 20
n = rl.GuiLabelButton([x, y, 100, h], "hello!")
y += h + 5: h = 80
if (rl.GuiListView([x, y, 100, h], "list1;list2", scrollindex, listopen)) then
listopen = true
endif
y += h + 5: h = 20
'pbv = iff(pbv == 100, 0, pbv + 1)
pv = rl.GuiProgressBar([x, y, 100, h], "L", "R", pbv, 0, 100)
y += h + 5: h =120
obj = rl.GuiTextInputBox([x, y, 200, 130], "Title", "Message", "Okay;well;okay", text, secret)
text = obj.text
secret = obj.secret
if (obj.result == 1) then showAlert = true
if (obj.result == 0) then text = "don't press x"
endif
rl.EndDrawing()
rl.WaitEvents(800)
wend
rl.CloseWindow()