Browse code

cleanup repo, spinner and makefile error

lorglas authored onWed/Feb/2020 22:0:th • GitHub committed onWed/Feb/2020 22:0:th
Showing100 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,60 @@
1
+doc Draw some nice 3D curves
2
+doc Original by Martin Lehmann for QBasic
3
+doc
4
+doc change the function func for different curves
5
+doc try smaller values of i for a lower resolution
6
+doc try z = 1 for less dots
7
+doc
8
+doc Note: this demo shows one thing: yab is slow :)
9
+doc The cleanup of the drawing takes alot of time too,
10
+doc you can simply break the program if you don't want to wait
11
+doc
12
+
13
+window open 100,100 to 739,579, "Win", "3D Curve"
14
+
15
+bitmap 640,480, "DoubleBuffer"
16
+canvas 0,0 to 639,479, "MyCanvas", "Win"
17
+
18
+i = 128  // resolution
19
+z = 0.5  // dot frequency
20
+xk = 40
21
+yk = 30
22
+
23
+draw set "highcolor", 0,0,0, "DoubleBuffer"
24
+draw rect 0,0 to 639,479, "DoubleBuffer"
25
+draw bitmap 0,0, "DoubleBuffer", "copy",  "MyCanvas"
26
+
27
+for t = -144 to 144 step(288/i)
28
+	if(t=0) t=0.1
29
+	r = int(0.5 + sqrt(20736 - t^2))
30
+	for j = -r to r step z
31
+		p = func(sqrt(j^2 + t^2) * 0.0327) * 20
32
+		x = int(1.7 * (j + (t/2.25) + 160)) + xk
33
+		y = int(1.8 * (199 - (p - t/2.25 + 90))) + yk
34
+		draw set "highcolor", 255-r,j+r,255-p, "DoubleBuffer"
35
+		draw line x,y to x,y, "DoubleBuffer"
36
+		draw set "highcolor", 0,0,0, "DoubleBuffer"
37
+		draw line x,y+1 to x,480, "DoubleBuffer"
38
+	next j
39
+	draw bitmap 0,0, "DoubleBuffer", "copy",  "MyCanvas"
40
+next t
41
+
42
+while(not instr(message$, "Quit"))
43
+wend
44
+
45
+window close "Win"
46
+
47
+// Choose one of the functions below, comment out all others
48
+sub func(n)
49
+	return cos(n) + cos(2*n) +cos(5*n)
50
+//	return -abs(1/n)
51
+//	return -abs(1/(n + j))
52
+//	return sin(n) + sin(2*n) +sin(5*n)
53
+//	return cos(sin(n))
54
+//	return cos(2*n) + cos((n+j)/16)
55
+//	return sqrt(abs(0.5*(16 - n^2))) + 1/(n*4)
56
+//	return cos(4*n) + 20/(n^2 + 3)
57
+//	return cos(1/n) + cos(2/n) + cos(5/n) - 3
58
+//	return cos(sin(j/n))
59
+//	return 1/sqrt(n) - 3
60
+end sub
0 61
new file mode 100644
... ...
@@ -0,0 +1,202 @@
1
+// This example demonstrates all widgets
2
+
3
+// open the window
4
+window open 100,100 to 640,500, "Win", "yab Demo"
5
+window set "Win", "Flags", "Not-Resizable, Not-Zoomable"
6
+
7
+// set the title
8
+view 10,10 to 530,50, "Title", "Win"
9
+draw set "bgcolor", 50,50,200, "Title"
10
+draw set "lowcolor", 50,50,200, "Title"
11
+draw set "highcolor", 255,255,255, "Title"
12
+if(peek$("os") = "Haiku") then
13
+	draw set "DejaVu Sans,Condensed Bold,32", "Title"
14
+else
15
+	draw set "Zurich,Bold,32", "Title"
16
+endif
17
+draw text 10,32, "yab Widgets and Views", "Title"	
18
+
19
+// make the tabview
20
+tabview 10,60 to 530,390, "Box", "top", "Win"
21
+tabview add "Box", "Widgets"
22
+tabview add "Box", "Views and More"
23
+
24
+// button
25
+button 10,10 to 100,30, "Button", "Button", "Box1"
26
+tooltip "Button", "BUTTON"
27
+
28
+// button image
29
+button image 10,40, "ButtonImage", "img/button_pressed.png", "img/button_norm.png", "", "Box1"
30
+tooltip "ButtonImage", "BUTTON IMAGE"
31
+
32
+// checkbox
33
+checkbox 10,70, "Check", "Checkbox", true, "Box1"
34
+tooltip "Check", "CHECKBOX"
35
+
36
+// checkbox image
37
+checkbox image 10,92, "CheckImage", "img/checkbutton_enabledOn.png", "img/checkbutton_enabledOff.png", "", "", true, "Box1"
38
+tooltip "CheckImage", "CHECKBOX IMAGE"
39
+
40
+// radiobutton
41
+radiobutton 10,130, "Radio1", "1. Radiobutton", true, "Box1"
42
+tooltip "Radio1", "RADIOBUTTON"
43
+radiobutton 10,150, "Radio2", "2. Radiobutton", false, "Box1"
44
+tooltip "Radio2", "RADIOBUTTON"
45
+
46
+// dropbox
47
+dropbox 10,175 to 120,195, "Drop", "Dropbox", "Box1"
48
+dropbox add "Drop", "---"
49
+dropbox add "Drop", "Foo"
50
+dropbox add "Drop", "Bar"
51
+tooltip "Drop", "DROPBOX"
52
+
53
+// listbox
54
+listbox 10,210 to 100,290, "List", 1, "Box1"
55
+listbox add "List", "Foo"
56
+listbox add "List", "Bar"
57
+tooltip "List", "LISTBOX"
58
+
59
+// columnbox
60
+columnbox 130,10 to 270,150, "Column", 1, "", "Box1"
61
+columnbox column "Column", " ", 1, 30,30,30, "align-center"
62
+columnbox column "Column", "Column", 2, 90,90,90, "align-center"
63
+columnbox add "Column", 1,1, 25, "__Icon__=img/yab.png"
64
+columnbox add "Column", 2,1, 20, "Foo"
65
+columnbox add "Column", 2,2, 20, "Bar"
66
+tooltip "Column", "COLUMNBOX"
67
+
68
+// treebox
69
+treebox 130,160 to 270,290, "Tree", 1, "Box1"
70
+treebox add "Tree", "Root"
71
+treebox add "Tree", "Root", "Foo", true
72
+treebox add "Tree", "Root", "Bar", true
73
+tooltip "Tree", "TREEBOX"
74
+
75
+// text
76
+text 300,10, "Text", "Text (cannot be flushed)", "Box1"
77
+tooltip "Text", "TEXT"
78
+
79
+// texturl
80
+texturl 300,33, "TextURL", "Team MAUI", "http://www.team-maui.de", "Box1"
81
+tooltip "TextURL", "TEXTURL"
82
+
83
+// textcontrol
84
+textcontrol 300,50 to 500,70, "TextCtrl", "TextControl", "", "Box1"
85
+tooltip "TextCtrl", "TEXTCONTROL"
86
+
87
+// spincontrol
88
+spincontrol 300,80, "Spin", "Spincontrol", 0,100,1, "Box1"
89
+tooltip "Spin", "SPINCONTROL"
90
+
91
+// calendar
92
+calendar 300,120, "Cal", "DDMMYYYY.", "01.01.1970", "Box1"
93
+tooltip "Cal", "CALENDAR"
94
+
95
+// textedit
96
+textedit 300,150 to 500,215, "TextEd", 3, "Box1"
97
+textedit add "TextEd", "Simply edit your text..."
98
+tooltip "TextEd", "TEXTEDIT"
99
+
100
+// slider
101
+slider 300,225 to 500,245, "Slider", "Slider", 1, 23, "Box1"
102
+tooltip "Slider", "SLIDER"
103
+
104
+// statusbar
105
+statusbar 300,265 to 500,290, "Status", "Start", "Finish", "Box1"
106
+statusbar set "Status", "Start", "Finish", 66
107
+tooltip "Status", "STATUSBAR"
108
+
109
+// view
110
+view 10,10 to 100,100, "View", "Box2"
111
+draw set "bgcolor", "jan-favorite-color", "View"
112
+draw text 20,35, "Plain View", "View"
113
+tooltip "View", "VIEW"
114
+
115
+// canvas
116
+canvas 10,110 to 100,195, "Canvas", "Box2"
117
+draw text 20,35, "Canvas", "Canvas"
118
+tooltip "Canvas", "CANVAS"
119
+
120
+// boxview
121
+boxview 10,205 to 100,290, "Boxview", "Boxview", 2, "Box2"
122
+tooltip "Boxview", "BOXVIEW"
123
+
124
+// tabview
125
+tabview 120,10 to 260,100, "Tab", "top", "Box2"
126
+tabview add "Tab", "First"
127
+tabview add "Tab", "Second"
128
+tooltip "Tab", "TABVIEW"
129
+
130
+// splitview
131
+splitview 120,110 to 260,195, "Split", true, false, "Box2"
132
+draw set "bgcolor", "Panel-Background-Color, Darken-1-Tint", "Split1"
133
+draw set "bgcolor", "Panel-Background-Color, Lighten-1-Tint", "Split2"
134
+tooltip "Split", "SPLITVIEW"
135
+
136
+// colorcontrol
137
+colorcontrol 120,203, "Color", "Box2"
138
+tooltip "Color", "COLORCONTROL"
139
+
140
+// popupmenu (only button, code in messageloop)
141
+button 120,270 to 245,290, "Popup", "Popupmenu", "Box2"
142
+tooltip "Popup", "POPUPMENU"
143
+
144
+// filepanel (only button, code in messageloop)
145
+button 255,270 to 350,290, "File", "Filepanel", "Box2"
146
+tooltip "File", "FILEPANEL"
147
+
148
+// menu
149
+view 280,10 to 500,100, "Menu", "Box2"
150
+menu "Menu", "Foo", "", "Menu"
151
+menu "Menu", "--", "", "Menu"
152
+menu "Menu", "Bar", "", "Menu"
153
+draw set "bgcolor", "Panel-Background-Color, Darken-1-Tint", "Menu"
154
+draw text 20,35, "View with menu", "Menu"
155
+tooltip "Menu", "MENU"
156
+
157
+// scrollbar
158
+view 280,110 to 500-peek("scrollbarwidth"),195-peek("scrollbarwidth"), "ScrollView", "Box2"
159
+scrollbar "Scroll", 3, "ScrollView"
160
+scrollbar set "Scroll", "horizontal-range", 0,100
161
+scrollbar set "Scroll", "vertical-range", 0,50
162
+if(peek$("os") = "Haiku") then
163
+	draw set "DejaVu Sans,Condensed Bold,32", "ScrollView"
164
+else
165
+	draw set "Zurich,Bold,32", "ScrollView"
166
+endif
167
+draw text 130,90, "Foobar", "ScrollView"
168
+tooltip "Scroll", "SCROLLBAR"
169
+
170
+// stackview
171
+stackview 420,205 to 500,260, "StackView", 2, "Box2"
172
+button 360,270 to 425,290, "Stack1", "Stack1", "Box2"
173
+button 435,270 to 500,290, "Stack2", "Stack2", "Box2"
174
+draw set "bgcolor", 200,200,255, "StackView1"
175
+draw text 10,20, "First view", "StackView1"
176
+draw set "bgcolor", 200,255,255, "StackView2"
177
+draw text 10,20, "Second view", "StackView2"
178
+tooltip "StackView", "STACKVIEW"
179
+
180
+// messageloop
181
+while(not quitting)
182
+	msg$ = message$
183
+	if(instr(msg$, "Popup")) then
184
+		// popupmenu
185
+		select$ = popupmenu 120,270, "Foo|--|Bar", "Box2"
186
+	elsif(instr(msg$, "File")) then
187
+		// filepanel
188
+		select$ = filepanel "Load-File", "Example Filepanel", "/boot/home"
189
+	elsif(instr(msg$, "Stack1")) then
190
+		// set stackview
191
+		stackview set "StackView", 1
192
+	elsif(instr(msg$, "Stack2")) then
193
+		// set stackview
194
+		stackview set "StackView", 2
195
+	elsif(instr(msg$, "Quit")) then
196
+		// exit
197
+		quitting = true
198
+	endif
199
+wend
200
+
201
+window close "Win"
202
+
0 203
new file mode 100644
... ...
@@ -0,0 +1,64 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 100,100 to 380,410,"MainView","BoxWorld.yab"
4
+
5
+window set "MainView", "flags", "not-zoomable, not-h-resizable, not-v-resizable"
6
+
7
+layout "none", "MainView"
8
+
9
+view 0,0 to 110,30, "CheckboxView","MainView"
10
+checkbox 10,10, "checkbox1", "Please select", 0, "CheckboxView"
11
+
12
+view 0,31 to 110,120, "RadioView1","MainView"
13
+	radiobutton 10,10, "Radio11", "Radio 11", 0, "RadioView1"
14
+	radiobutton 10,30, "Radio12", "Radio 12", 0, "RadioView1"
15
+	radiobutton 10,50, "Radio13", "Radio 13", 1, "RadioView1"
16
+
17
+view 0,130 to 110,190,"RadioView2","MainView"
18
+	radiobutton 10,10, "Radio21", "Radio 21", 1, "RadioView2"
19
+	radiobutton 10,30, "Radio22", "Radio 22", 0, "RadioView2"
20
+
21
+view 0,195 to 110,280,"RadioView3","MainView"
22
+	radiobutton 10,5, "Radio31", "Radio 31", 0, "RadioView3"
23
+	radiobutton 10,25, "Radio32", "Radio 32", 0, "RadioView3"
24
+	radiobutton 10,45, "Radio33", "Radio 33", 1, "RadioView3"
25
+	radiobutton 10,65, "Radio34", "Radio 34", 0, "RadioView3"
26
+
27
+view 0, 285 to 280, 310, "CommandView","MainView"
28
+
29
+layout "leftright", "MainView"
30
+
31
+listbox 120,10 to 255,110, "List1", 1, "MainView"
32
+
33
+layout "standard", "MainView"
34
+
35
+listbox 120,120 to 255,230, "List2", 3, "MainView"
36
+
37
+listbox add "List1","Hello"
38
+listbox add "List1","World"
39
+
40
+for i=1 to 20
41
+ 	listbox add "List2","Number "+str$(i)
42
+next i
43
+
44
+dropbox 120,250 to 265,270, "drop1", "MyDrop:", "MainView"
45
+dropbox add "drop1", "Hello World"
46
+dropbox add "drop1", "Foo Bar"
47
+dropbox add "drop1", "--"
48
+dropbox add "drop1", "Acme Ltd"
49
+dropbox add "drop1", "Bobejaan" 
50
+
51
+alert "BoxWorld shows how to use Radiobuttons, Checkboxes, Listboxes and Dropboxes.","Ok","idea"
52
+
53
+inloop = true
54
+while(inloop)
55
+	a$ = message$
56
+	if(a$<>"") then
57
+		print a$
58
+		draw flush "CommandView"
59
+		draw text 5,15, left$(a$,len(a$)-1), "CommandView"
60
+	endif	
61
+	if(instr(a$,"_QuitRequested|")) inloop = false
62
+wend
63
+
64
+window close "MainView"
0 65
new file mode 100644
... ...
@@ -0,0 +1,64 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 400,400 to 550,500, "MainView1", "ButtonWorld1"
4
+window open 600,400 to 750,500, "MainView2", "ButtonWorld2"
5
+
6
+mainview1 = true
7
+
8
+layout "left, right", "MainView1"
9
+button 30,10 to 120,30, "EmptyAlert_", "Empty Alert", "MainView1"
10
+layout "bottom, right", "MainView1"
11
+button 30,40 to 120,60, "InfoAlert_", "Info Alert", "MainView1"
12
+button 30,70 to 120,90, "IdeaAlert_", "Idea Alert", "MainView1"
13
+
14
+button 30,10 to 120,30, "WarningAlert_", "Warning Alert", "MainView2"
15
+button 30,40 to 120,60, "StopAlert_", "Stop Alert", "MainView2"
16
+button 30,70 to 120,90, "Quit_", "Quit", "MainView2"
17
+
18
+alert "ButtonWorld demonstrates how Buttons and Alerts can be used easily!", "Ok", "idea"
19
+
20
+inloop = true
21
+while(inloop)
22
+	msg$ = message$
23
+	switch msg$
24
+		case "EmptyAlert_|":
25
+			alert "This is an empty alert!", "Dooh", "none"
26
+			break
27
+
28
+		case "InfoAlert_|"
29
+			alert "This is an info alert!", "Dooh", "info"
30
+			break
31
+
32
+		case "IdeaAlert_|"	
33
+			alert "This is an idea alert!", "Dooh", "idea"
34
+			break
35
+
36
+		case "WarningAlert_|"
37
+			alert "This is a warning alert!", "Dooh", "warning"
38
+			break
39
+
40
+		case "StopAlert_|"
41
+			alert "This is a stop alert!", "Dooh", "stop"
42
+			break
43
+
44
+		case "Quit_|"
45
+			inloop = false
46
+			if (mainview1) window close "MainView1"
47
+			window close "MainView2"
48
+			break
49
+
50
+		case "MainView1:_QuitRequested|"
51
+			window close "MainView1"
52
+			mainview1 = false
53
+			break
54
+
55
+		case "MainView2:_QuitRequested|"
56
+			window close "MainView2"
57
+			break
58
+
59
+	end switch
60
+	
61
+	if(window count<1) inloop = false
62
+	
63
+wend
64
+
0 65
new file mode 100644
... ...
@@ -0,0 +1,166 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+localize
4
+window open 100,50 to 320,320, "Calc", "CalcView"
5
+
6
+draw set "bgcolor", 100, 150, 220, "Calc"
7
+draw set "lowcolor", 100, 150, 220, "Calc"
8
+draw set "highcolor", 255, 255, 255, "Calc"
9
+window set "Calc", "minimumto", 220, 260
10
+window set "Calc", "maximumto", 250, 300
11
+
12
+layout "all", "Calc"
13
+
14
+menu "File", "Reset", "R", "Calc"
15
+menu "File", "--", "", "Calc"
16
+menu "File", "Quit", "Q", "Calc"
17
+menu "Help", "Help...", "H", "Calc"
18
+menu "Help", "--", "", "Calc"
19
+menu "Help", "About...", "", "Calc"
20
+
21
+button 20,70 to 55,105,"b7", "7", "Calc"
22
+button 65,70 to 100,105,"b8", "8", "Calc"
23
+button 110,70 to 145,105,"b9", "9", "Calc"
24
+button 155,70 to 190,105,"b/", "/", "Calc"
25
+button 20,115 to 55,150,"b4", "4", "Calc"
26
+button 65,115 to 100,150,"b5", "5", "Calc"
27
+button 110,115 to 145,150,"b6", "6", "Calc"
28
+button 155,115 to 190,150,"b*", "*", "Calc"
29
+button 20,160 to 55,195,"b1", "1", "Calc"
30
+button 65,160 to 100,195,"b2", "2", "Calc"
31
+button 110,160 to 145,195,"b3", "3", "Calc"
32
+button 155,160 to 190,195,"b-", "-", "Calc"
33
+button 20,205 to 55,240,"b0", "0", "Calc"
34
+button 65,205 to 100,240,"b.", ".", "Calc"
35
+button 110,205 to 145,240,"bC", "C", "Calc"
36
+button 155,205 to 190,240,"b+/=", "+=", "Calc"
37
+
38
+draw text 20,50,"0","Calc"
39
+
40
+display$ = "0"
41
+result = 0
42
+type$ = "+"
43
+
44
+dim msgbuffer$(1)
45
+inloop = true
46
+while(inloop)
47
+	msgnumber = split(message$, msgbuffer$(), "|")
48
+	for i=0 to msgnumber
49
+		switch msgbuffer$(i)
50
+			case "b."
51
+			case "b0"
52
+			case "b1"
53
+			case "b2"
54
+			case "b3"
55
+			case "b4"
56
+			case "b5"
57
+			case "b6"
58
+			case "b7"
59
+			case "b8"
60
+			case "b9"
61
+				if(len(display$)<10) display$ = display$ + right$(msgbuffer$(i),1)
62
+				while(left$(display$,1)="0")
63
+					display$ = right$(display$,len(display$)-1)
64
+				wend
65
+				if(display$="") display$="0"
66
+				draw rect 20,30 to 170,60, "Calc"
67
+				draw flush "Calc"
68
+				draw text 20,50, display$,"Calc"
69
+				break
70
+			case "b-"
71
+				result = calculate(result, type$, val(display$))
72
+				type$ = "-"
73
+				draw rect 20,30 to 170,60, "Calc"
74
+				draw flush "Calc"
75
+				draw text 20,50, str$(result),"Calc"
76
+				display$="0"
77
+				break
78
+			case "b+/="
79
+				result = calculate(result, type$, val(display$))
80
+				type$ = "+"
81
+				draw rect 20,30 to 170,60, "Calc"
82
+				draw flush "Calc"
83
+				draw text 20,50, str$(result),"Calc"
84
+				display$="0"
85
+				break
86
+			case "b*"
87
+				result = calculate(result, type$, val(display$))
88
+				type$ = "*"
89
+				draw rect 20,30 to 170,60, "Calc"
90
+				draw flush "Calc"
91
+				draw text 20,50, str$(result),"Calc"
92
+				display$="0"
93
+				break
94
+			case "b/"
95
+				result = calculate(result, type$, val(display$))
96
+				type$ = "/"
97
+				draw rect 20,30 to 170,60, "Calc"
98
+				draw flush "Calc"
99
+				draw text 20,50, str$(result),"Calc"
100
+				display$="0"
101
+				break
102
+			case "bC"
103
+			case translate$("Calc:File:Reset")
104
+				result=0
105
+				draw rect 20,30 to 170,60, "Calc"
106
+				draw flush "Calc"
107
+				draw text 20,50, str$(result),"Calc"
108
+				display$="0"
109
+				type$ = "+"
110
+				break
111
+			case translate$("Calc:File:Quit")
112
+			case translate$("Calc:_QuitRequested")
113
+				 window close "Calc"
114
+				break
115
+			case translate$("Calc:Help:Help...")
116
+				alert "Calc demonstrates how to program\n a calculator in yab.\n\n", "Ok", "info"
117
+				break
118
+			case translate$("Calc:Help:About...")
119
+				window open 250,100 to 570,291, "About", "About"
120
+				window set "About", "look", "bordered"
121
+				window set "About", "feel", "modal-app"
122
+				draw set "BGColor", 255,255,255, "About"
123
+				window set "About", "minimumto", 320, 191
124
+				window set "About", "maximumto", 320, 191
125
+
126
+				err = draw image 0,0, "img/image.png", "About"
127
+				if(err>0) then
128
+					alert "Error loading image.png!"+str$(err), "Close", "warning"
129
+					window close "About"
130
+				else
131
+					button 20,163 to 300,183,"b", "Close", "About"
132
+				endif
133
+
134
+				break
135
+			case translate$("b")
136
+			case translate$("About:_QuitRequested")
137
+				window close "About"
138
+				break
139
+			default
140
+				break
141
+		end switch
142
+	next i
143
+	
144
+	if(window count = 0) inloop = false
145
+	sleep 0.1
146
+wend
147
+
148
+sub calculate(a,type$,b)
149
+	ret = 0
150
+	switch(type$)
151
+		case "+"
152
+			ret = a + b
153
+			break
154
+		case "-"
155
+			ret = a - b
156
+			break
157
+		case "*"
158
+			ret = a * b
159
+			break
160
+		case "/"
161
+			ret = a / b
162
+			break
163
+	end switch
164
+	return ret
165
+end sub
166
+
0 167
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+dim Part$(1)
4
+window open 100, 100, 240, 300, "A", "Checkboxes"
5
+window set "A", "flags", "not-h-resizable, not-v-resizable, not-zoomable"
6
+
7
+// create the checkboxes
8
+// with layout for left top
9
+layout "left, top", "A"
10
+for NP = 1 to 5
11
+	Y = Y+25
12
+	checkbox 10, Y, "CheckMe:"+str$(NP), "OFF", 0, "A"
13
+next NP
14
+
15
+button 10, 170 to 130, 190, "Button_", "Check them", "A"
16
+
17
+while (not instr(msg$, "Quit"))
18
+	msg$ = message$
19
+	if (split(msg$, Part$(), ":|") < 3) dim Part$(3)
20
+
21
+	// if one of the checkboxes was used
22
+	if (msg$ = "CheckMe:"+Part$(2)+":"+Part$(3)+"|") then
23
+		option set "CheckMe:"+Part$(2), "label", Part$(3)
24
+	fi
25
+
26
+	// if the button was pressed
27
+	if (msg$ = "Button_|") then
28
+		if (check$ = "ON") then
29
+			check$ = "OFF"
30
+			option set "Button_", "label", "Check them"
31
+		else
32
+			check$ = "ON"
33
+			option set "Button_", "label", "Uncheck them"
34
+		fi
35
+		for NP = 1 to 5
36
+			checkbox set "CheckMe:"+str$(NP), (check$ = "ON")
37
+			option set "CheckMe:"+str$(NP), "label", check$
38
+//			sleep 0.05
39
+		next NP
40
+	fi
41
+
42
+wend
43
+exit
0 44
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 100,100 to 200,150, "MainView", "Clock"  
4
+window set "MainView", "flags", "Not-Zoomable"
5
+window set "MainView", "minimumto", 100,50
6
+window set "MainView", "maximumto", 100,50
7
+layout "left, top, right", "MainView"
8
+view 0,0 to 100,50, "clockview", "MainView"
9
+
10
+inloop = true
11
+while(inloop)
12
+	msg$ = message$
13
+	if(msg$<>"") print msg$
14
+	if(instr(msg$,"_QuitRequested")) inloop = false
15
+	if(instr(msg$,"Quit")) inloop = false
16
+	draw_time_and_date()
17
+sleep 0.01
18
+wend
19
+
20
+window close "MainView"
21
+exit
22
+
23
+sub time_and_date()
24
+	zeit$ = left$(time$,2) + ":" + mid$(time$,4,2) + ":" + mid$(time$,7,2)
25
+	datum$ = mid$(date$,14,3) + ", " + mid$(date$,6,2) + "." + mid$(date$,3,2) + "." + mid$(date$,11,2)
26
+end sub	
27
+
28
+sub draw_time_and_date()
29
+	time_and_date()
30
+	draw flush "clockview"
31
+	draw text 10,20, datum$ ,"clockview"
32
+	draw text 10,35, zeit$ + "         ","clockview"
33
+	wait 0.25
34
+end sub
0 35
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+DOCU ColorDemo, Color select and show
4
+DOCU by Stargater
5
+
6
+window open 100,100 to 420,420, "MainView", "ColorDemo"
7
+window set "MainView", "flags", "not-zoomable, not-h-resizable, not-v-resizable"
8
+view 20,20 to 300,220, "ViewColor", "MainView"
9
+r = 140  
10
+g = 140  
11
+b = 240
12
+draw set "bgcolor", r,g,b, "ViewColor"  
13
+
14
+colorcontrol 10,240, "Colorcontrol", "MainView"
15
+colorcontrol set "Colorcontrol", 140,140,240
16
+
17
+
18
+while(not instr(message$,"_QuitRequested"))
19
+		r = colorcontrol get "Colorcontrol", "red"
20
+		g = colorcontrol get "Colorcontrol", "green"
21
+		b = colorcontrol get "Colorcontrol", "blue"
22
+		draw set "bgcolor", r,g,b, "ViewColor" 
23
+wend
24
+
25
+window close "MainView"
26
+
0 27
new file mode 100644
... ...
@@ -0,0 +1,202 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 100,100 to 700,500, "MainView", "DrawWorld"
4
+
5
+// MainView
6
+draw set "highcolor", 0,0,0, "MainView"
7
+draw set "lowcolor", 235,235,235, "MainView"
8
+draw set "bgcolor", 235,235,235, "MainView"
9
+
10
+draw set 0, "HighSolidFill"
11
+if(peek$("os") = "Haiku") then
12
+        draw set "DejaVu Sans,Condensed Bold,48", "MainView"
13
+else
14
+	draw set "Zurich,Bold,48", "MainView"
15
+endif
16
+draw text 175,50, "DrawWorld", "MainView"
17
+
18
+button 510,370 to 590,390, "NextButton", "Next", "MainView"
19
+
20
+// Our drawing pad
21
+view 100,60 to 500,390, "DrawView", "MainView"
22
+draw set "highcolor", 0,0,0, "DrawView"
23
+draw set "lowcolor", 255,255,255, "DrawView"
24
+draw set "bgcolor", 255,255,255, "DrawView"
25
+
26
+// Dot and line
27
+draw set "Zurich,Bold,18", "DrawView"
28
+draw text 135,20, "Dot and Line", "DrawView"
29
+
30
+xold = 40
31
+yold = 260
32
+for a=10 to 720 step 10
33
+	x = 10+a*180/360
34
+	y = 230+60*sin(a*pi/180) 
35
+	draw line xold,yold to x,y, "DrawView"
36
+	xold = x + 30
37
+	yold = y + 30
38
+next a 
39
+
40
+for a = 0 to 720 step 10
41
+	x = 10+a*180/360
42
+	y = 100+60*sin(a*pi/180) 
43
+	draw dot x,y, "DrawView"
44
+next a 
45
+
46
+while(not instr(msg$,"NextButton"))
47
+	msg$ = message$
48
+	if(instr(msg$, "Quit")) then
49
+		window close "MainView"
50
+		end
51
+	endif
52
+	sleep 0.1
53
+wend
54
+msg$ = ""
55
+
56
+draw rect 0,0 to 400,330, "DrawView"
57
+draw flush "DrawView"
58
+draw set 1, "HighSolidFill"
59
+
60
+// Circle and ellipse
61
+draw set "Zurich,Bold,18", "DrawView"
62
+draw text 135,20, "Circle and Ellipse", "DrawView"
63
+
64
+// draw set 1, "LowSolidFill"
65
+draw circle 70,70, 36, "DrawView"
66
+draw set "highcolor", 0,0,245, "DrawView"
67
+draw set 0, "HighSolidFill"
68
+draw circle 80,80, 36, "DrawView"
69
+draw set "highcolor", 50,0,245, "DrawView"
70
+draw set 0, "HighSolidFill"
71
+
72
+draw dot 70,70, "DrawView"
73
+draw line 72,70 to 105,70, "DrawView"
74
+draw line 105,70 to 100,65, "DrawView"
75
+draw line 105,70 to 100,75, "DrawView"
76
+draw text 85,68, "r", "DrawView"
77
+
78
+draw set "highcolor", 0,0,0, "DrawView"
79
+draw ellipse 210,70, 72, 36, "DrawView"
80
+draw set "highcolor", 0,0,245, "DrawView"
81
+draw dot 210,70, "DrawView"
82
+draw line 212,70 to 282,70, "DrawView"
83
+draw line 282,70 to 277,65, "DrawView"
84
+draw line 282,70 to 277,75, "DrawView"
85
+draw line 210,68 to 210,34, "DrawView"
86
+draw line 210,34 to 215,39, "DrawView"
87
+draw line 210,34 to 205,39, "DrawView"
88
+draw text 235,68, "rx", "DrawView"
89
+draw text 192,57, "ry", "DrawView"
90
+
91
+for i = 0 to 255 step 5
92
+	draw set "highcolor", i,0,0, "DrawView"
93
+	draw ellipse i+90, 230, 72-i/5, 36+i/5, "DrawView"
94
+next i
95
+draw set "highcolor", 0,0,0, "DrawView"
96
+
97
+
98
+while(not instr(msg$,"NextButton"))
99
+	msg$ = message$
100
+	if(instr(msg$, "Quit")) then
101
+		window close "MainView"
102
+		end
103
+	endif
104
+	sleep 0.1
105
+wend
106
+msg$ = ""
107
+
108
+draw rect 0,0 to 400,330, "DrawView"
109
+draw flush "DrawView"
110
+draw set "lowcolor", 255,255,255, "DrawView"
111
+draw set 1, "HighSolidFill"
112
+
113
+// Bezier curve
114
+draw set "Zurich,Bold,18", "DrawView"
115
+draw text 135,20, "Bezier Curve", "DrawView"
116
+
117
+draw set "highcolor", 50,50,250, "DrawView"
118
+draw circle 30,100, 3, "DrawView"
119
+draw circle 70,60, 3, "DrawView"
120
+draw circle 100,40, 3, "DrawView"
121
+draw circle 140,90, 3, "DrawView"
122
+draw line 30,100 to 70,60, "DrawView"
123
+draw line 70,60 to 100,40, "DrawView"
124
+draw line 100,40 to 140,90, "DrawView"
125
+draw set "highcolor", 0,0,0, "DrawView"
126
+draw curve 30,100, 70,60, 100,40, 140,90, "DrawView"
127
+
128
+draw set "highcolor", 50,50,250, "DrawView"
129
+draw circle 170,100, 3, "DrawView"
130
+draw circle 190,40, 3, "DrawView"
131
+draw circle 250,40, 3, "DrawView"
132
+draw circle 265,90, 3, "DrawView"
133
+draw line 170,100 to 190,40, "DrawView"
134
+draw line 190,40 to 250,40, "DrawView"
135
+draw line 250,40 to 265,90, "DrawView"
136
+draw set "highcolor", 0,0,0, "DrawView"
137
+draw curve 170,100, 190,40, 250,40, 265,90, "DrawView"
138
+
139
+draw set "highcolor", 50,50,250, "DrawView"
140
+draw circle 350,40, 3, "DrawView"
141
+draw circle 300,10, 3, "DrawView"
142
+draw circle 290,200, 3, "DrawView"
143
+draw circle 350,140, 3, "DrawView"
144
+draw line 350,40 to 300,10, "DrawView"
145
+draw line 300,10 to 290,200, "DrawView"
146
+draw line 290,200 to 350,140, "DrawView"
147
+draw set "highcolor", 0,0,0, "DrawView"
148
+draw set 0, "HighSolidFill"
149
+draw curve 350,40, 300,10, 290,200, 350,140, "DrawView"
150
+
151
+draw set 1, "HighSolidFill"
152
+draw curve 10,300, 120,100, 170,100, 390,300, "DrawView"
153
+
154
+while(not instr(msg$,"NextButton"))
155
+	msg$ = message$
156
+	if(instr(msg$, "Quit")) then
157
+		window close "MainView"
158
+		end
159
+	endif
160
+	sleep 0.1
161
+wend
162
+msg$ = ""
163
+
164
+draw rect 0,0 to 400,330, "DrawView"
165
+draw flush "DrawView"
166
+
167
+// Pattern
168
+draw set "Zurich,Bold,18", "DrawView"
169
+draw text 165,20, "Pattern", "DrawView"
170
+
171
+draw text 47,40, "HighSolidFill", "DrawView"
172
+draw text 247,40, "LowSolidFill", "DrawView"
173
+draw text 43,190, "CheckeredFill", "DrawView"
174
+draw text 247,190, "Userdefined", "DrawView"
175
+draw set "highcolor", 50,50,250, "DrawView"
176
+draw set "lowcolor", 250,50,50, "DrawView"
177
+draw set 0, "HighSolidFill"
178
+draw rect 40,50 to 160,130, "DrawView"
179
+draw set 0, "LowSolidFill"
180
+draw rect 240,50 to 360,130, "DrawView"
181
+draw set 0, "CheckeredFill"
182
+draw rect 40,200 to 160,280, "DrawView"
183
+pattern$ = "255239171199001199171239"
184
+draw set 0, pattern$
185
+draw rect 240,200 to 360,280, "DrawView"
186
+draw set 0, "255255255255255255255255"
187
+draw rect 40,50 to 160,130, "DrawView"
188
+
189
+draw set "highcolor", 0,0,0, "DrawView"
190
+draw set "lowcolor", 255,255,255, "DrawView"
191
+
192
+while(not instr(msg$,"NextButton"))
193
+	msg$ = message$
194
+	if(instr(msg$, "Quit")) then
195
+		window close "MainView"
196
+		end
197
+	endif
198
+	sleep 0.1
199
+wend
200
+
201
+window close "MainView"
202
+
0 203
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 100,100 to 300,300, "WView", "DropWorld"
4
+
5
+text 20,5, "Txt1", "Drop any file here:", "WView"
6
+view 20,20 to 180,180, "DropView", "WView"
7
+draw set "highcolor", 0,0,0, "DropView"
8
+draw set "lowcolor", 255,255,0, "DropView"
9
+pattern$ = "240225195135015030060120"
10
+draw set 0, pattern$
11
+draw rect 0,0 to 160,160, "DropView"
12
+draw set 0, "lowsolid"
13
+view dropzone "DropView"
14
+
15
+dim msg$(1)
16
+inloop = true
17
+while(inloop)
18
+	n = split(message$, msg$(), "|:")
19
+	for i = 0 to n
20
+		if(msg$(i) = "_Dropped") then
21
+			draw rect 20,181 to 290,200, "WView"
22
+			draw flush "WView"
23
+			draw text 20,195, msg$(i+1), "WView"
24
+		endif
25
+		if(msg$(i) = "_QuitRequested") inloop = false
26
+	next i
27
+	
28
+	if(msg$<>"") print msg$
29
+	sleep 0.1
30
+wend
31
+
32
+window close "WView"
0 33
new file mode 100644
... ...
@@ -0,0 +1,18 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 100,100 to 400, 200, "WView", "EvenMoreControls"
4
+layout "none", "WView"
5
+colorcontrol 10,10, "CC", "WView"
6
+colorcontrol set "CC", 213,123,43
7
+
8
+textcontrol 10,70 to 150,90, "TC", "Enter Password:","","WView"
9
+textcontrol set "TC",1
10
+
11
+inloop = true
12
+while(inloop)
13
+	msg$ = message$
14
+	if(msg$<>"") print msg$
15
+	if(instr(msg$,"Quit")) inloop = false
16
+wend
17
+
18
+window close "WView"
0 19
new file mode 100644
... ...
@@ -0,0 +1,58 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+SCREEN_W = peek("desktopwidth")
4
+SCREEN_H = peek("desktopheight")
5
+
6
+W = 400
7
+H = 200
8
+
9
+X = (SCREEN_W/2) - (W/2)
10
+Y = (SCREEN_H/2) - (H/2)
11
+
12
+THE_TEXT$ = "HELLO"
13
+
14
+screenshot 0, 0 to SCREEN_W-1, SCREEN_H-1, "BMP_screen_"
15
+
16
+window open -10-W, 0 to -10, H, "Main_", "PAPA"
17
+	window set "Main_", "look", "modal"
18
+	window set "Main_", "flags", "not-h-resizable, not-v-resizable, not-zoomable"
19
+
20
+canvas 0, 0 to W, H, "CV_main_", "Main_"
21
+if(peek$("os") = "Haiku") then
22
+        draw set "DejaVu Sans,Condensed Bold,122", "CV_main_"
23
+else
24
+	draw set "Swis721 BT, Bold, 122", "CV_main_"
25
+endif
26
+
27
+th = draw get "max-text-height", "CV_main_"
28
+tw = draw get "text-width", THE_TEXT$, "CV_main_"
29
+
30
+tx = (W/2)-(tw/2)
31
+ty = (H/3)*2
32
+
33
+draw bitmap -X, -Y, "BMP_screen_", "copy", "CV_main_"
34
+draw text tx, ty, THE_TEXT$, "CV_main_"
35
+
36
+window set "Main_", "moveto", X, Y
37
+
38
+dim m$(1)
39
+while (not instr(msg$, "Quit"))
40
+	msg$ = message$
41
+
42
+	if (X <> window get "Main_", "position-x") then
43
+		X = window get "Main_", "position-x"
44
+		Moved = true
45
+	fi
46
+	if (Y <> window get "Main_", "position-y") then
47
+		Y = window get "Main_", "position-y"
48
+		Moved = true
49
+	fi
50
+
51
+	if (Moved) then
52
+		draw bitmap -X, -Y, "BMP_screen_", "alpha", "CV_main_"
53
+		draw text tx, ty, THE_TEXT$, "CV_main_"
54
+		Moved = false
55
+	fi
56
+
57
+wend
58
+exit
0 59
new file mode 100644
... ...
@@ -0,0 +1,97 @@
1
+// Filebox is a library to have an easy access to a list of files.
2
+// This is easier than poking around with columnboxes yourself.
3
+
4
+// Open a new filebox from (x1,y1) to (x2,y2)
5
+// with the id ID$, the type of scrollbar ScrollbarType on View$
6
+export sub Filebox(x1,y1,x2,y2, ID$, ScrollbarType, View$)
7
+	local myscrollbar
8
+	columnbox x1,y1 to x2,y2, ID$, ScrollbarType, "resizable", View$
9
+	columnbox column ID$, " ", 1, 20, 20, 20, "align-center"
10
+	if(scrollbarType=1 or scrollbarType=3) myscrollbar = peek("scrollbarwidth")
11
+	columnbox column ID$, "Name", 2, 1000, 21, x2-x1-24-myscrollbar, "align-left"
12
+	columnbox color ID$, "Selection-Active", 220,220,250
13
+        columnbox color ID$, "Row-Divider", 255,255,255 
14
+	return
15
+end sub
16
+
17
+// Easy interface to a Filebox, simply name a directory
18
+export sub FileboxDirectorySimple(ID$, dir$)
19
+	FileboxDirectory(ID$,dir$,false)
20
+	return
21
+end sub
22
+
23
+// return the name of the row position
24
+export sub FileboxName$(ID$, position)
25
+	return columnbox get$ ID$, 2, position
26
+end sub
27
+
28
+// return true, if the row position is a directory
29
+export sub FileboxIsDirectory(ID$, position)
30
+	local t$
31
+	t$ = columnbox get$ ID$, 1, position
32
+	if(t$ = "__Mime__=application/x-vnd.Be-directory") return true
33
+	return false
34
+end sub
35
+
36
+// Give a directory and the following options:
37
+// showDot: set this to true to show hidden (dot) files
38
+export sub FileboxDirectory(ID$, dir$, showDot)
39
+	local t$
40
+	local i
41
+	local n
42
+	local arraysizeDir
43
+	local arraysizeFiles
44
+
45
+	dim directories$(1)
46
+	dim files$(1)
47
+
48
+	arraysizeDir = 0
49
+	arraysizeFiles = 0
50
+
51
+	columnbox clear ID$
52
+	if(showDot) then
53
+		t$ = system$("ls --format=single-column --color=none -a "+dir$+" |sort -f")
54
+	else
55
+		t$ = system$("ls --format=single-column --color=none "+dir$+" |sort -f")
56
+	endif
57
+
58
+	dim splitdir$(1)
59
+
60
+	n = split(t$, splitdir$(), "\n")
61
+	for i=1 to n-1
62
+               if(system("test -d \""+ dir$+splitdir$(i)+"\"") = 0) then
63
+                        // comment the if clause out if you want to have the direcotries "." and ".." listed
64
+                        if(splitdir$(i)<>"." and splitdir$(i)<>"..") then
65
+                                arraysizeDir = arraysizeDir + 1
66
+                                dim directories$(arraysizeDir)
67
+                                directories$(arraysizeDir-1) = splitdir$(i)
68
+                        endif
69
+                // handle files
70
+                else
71
+                        arraysizeFiles = arraysizeFiles + 1
72
+                        dim files$(arraysizeFiles)
73
+                        files$(arraysizeFiles-1) = splitdir$(i)
74
+                endif 
75
+	next i
76
+	for i=0 to arraysizeDir-1
77
+		FileboxAdd(ID$, directories$(i), true)
78
+	next i
79
+	for i=0 to arraysizeFiles-1
80
+		FileboxAdd(ID$, files$(i), false)
81
+	next i
82
+	return
83
+end sub
84
+
85
+sub FileboxAdd(ID$, Name$, IsFolder)
86
+	local maxpos
87
+
88
+	maxpos = (columnbox count ID$) + 1
89
+
90
+	if(IsFolder) then
91
+		columnbox add ID$, 1, maxpos, 18, "__Mime__=application/x-vnd.Be-directory"
92
+	else
93
+		columnbox add ID$, 1, maxpos, 18, "__Mime__=application/octet-stream"
94
+	endif
95
+	columnbox add ID$, 2, maxpos, 20, Name$
96
+	return
97
+end sub
0 98
new file mode 100644
... ...
@@ -0,0 +1,46 @@
1
+import Filebox
2
+
3
+
4
+dir$ = "/boot/home/"
5
+
6
+window open 100,100 to 500,500, "Demo","Demo"
7
+Filebox(10,10,350,390,"Filebox", 1, "Demo")
8
+FileboxDirectory("Filebox", dir$, false)
9
+button 360,10,390,30, "DirUp", "..", "Demo"
10
+
11
+dim msg$(1)
12
+inloop = true
13
+while(inloop)
14
+        n = split(message$, msg$(), "|")
15
+	for i=1 to n
16
+		// Quit
17
+		if(msg$(i) = "Demo:_QuitRequested") inloop = false
18
+
19
+		// Button pressed and we are not in the root directory
20
+		if(msg$(i) = "DirUp" and dir$<>"/") then
21
+			t = len(dir$)-1
22
+			while(mid$(dir$,t,1)<>"/") 
23
+				t = t - 1
24
+			wend
25
+			dir$ = left$(dir$,t)
26
+			FileboxDirectory("Filebox", dir$, false)
27
+		endif
28
+
29
+		// An item is invoked
30
+		if(instr(msg$(i),"Filebox:_Invoke:")) then
31
+			position = val(right$(msg$(i),len(msg$(i))-16))
32
+
33
+			// if the item is a directory, then update the filebox else print the filename
34
+			if(FileboxIsDirectory("Filebox", position)) then
35
+				dir$ = dir$ + FileboxName$("Filebox", position) + "/"
36
+				FileboxDirectory("Filebox", dir$, false)
37
+			else
38
+				print FileboxName$("Filebox", position)
39
+			endif
40
+		endif
41
+	next i
42
+	
43
+        sleep 0.01
44
+wend
45
+
46
+window close "Demo"
0 47
new file mode 100644
... ...
@@ -0,0 +1,444 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+// Set Backgroundcolors as variables.
4
+bgr = 216 : bgg = 216 : bgb = 226
5
+
6
+window open 100, 100 to 610, 400, "MainView" ,"GUI - World"
7
+	window set "MainView", "flags", "not-h-resizable"
8
+	draw set "bgcolor", bgr, bgg, bgb, "MainView"
9
+	draw set "lowcolor", bgr, bgg, bgb, "MainView"
10
+	draw set "highcolor", 0, 0, 0, "MainView"
11
+	draw set "Zurich, Bold, 16", "MainView"
12
+	draw text 10, 20, "GUI - World", "MainView"
13
+
14
+listbox 200, 5 to 505, 235, "SourceView", 1, "MainView"
15
+
16
+view 5, 241 to 505, 265, "LineView", "MainView"
17
+	draw set "bgcolor", bgr-16, bgg-16, bgb-16, "LineView"
18
+	draw set "lowcolor", bgr-16, bgg-16, bgb-16, "LineView"
19
+	draw set "highcolor", 155, 0, 0, "LineView"
20
+	draw set "Zurich, Bold, 14", "LineView"
21
+
22
+view 0, 270 to 510, 300, "ButtonView", "MainView"
23
+	draw set "bgcolor", bgr, bgg, bgb, "ButtonView"
24
+
25
+button 10, 0 to 70, 20, "Quit_", "Quit", "ButtonView"
26
+button 205, 0 to 500, 20, "Step_", "Next step", "ButtonView"
27
+
28
+layout "left, top", "MainView"
29
+view 5, 25 to 190, 240, "StatusView", "MainView"
30
+	draw set "bgcolor", bgr, bgg, bgb, "StatusView"
31
+	draw set "Zurich, Roman, 10", "StatusView"
32
+
33
+NextStep(0)
34
+option set "Step_", "focus", true
35
+
36
+dim choice$(1)
37
+inloop = true
38
+while (inloop)
39
+	msg$ = message$
40
+	if (split(msg$, choice$(), ":|") > 2) btn$ = choice$(3)
41
+	if (msg$ <> "") print msg$
42
+
43
+	switch msg$
44
+
45
+		case "Step_|"
46
+			stp = stp+1
47
+			NextStep(stp)
48
+			L = 0
49
+			option set "Step_", "focus", true
50
+			break
51
+
52
+		case "SourceView:_Invoke:"+btn$+"|"
53
+			if (L = 0) stp = stp-1
54
+			L = 1
55
+			NextStep(val(btn$))
56
+			break
57
+
58
+		case "Quit_|":
59
+		case "MainView:_QuitRequested|":
60
+			inloop = false
61
+			break
62
+
63
+	end switch
64
+	sleep 0.01
65
+wend
66
+exit
67
+
68
+sub NextStep(n)
69
+	draw flush "StatusView"
70
+	m = n
71
+	if (n = 0) then
72
+		draw text 5, 20, "With GUI-World you can", "StatusView"
73
+		draw text 5, 35, "create a window with a few", "StatusView"
74
+		draw text 5, 50, "contents, as examples.", "StatusView"
75
+		draw text 5, 75, "The currently executed line will be", "StatusView"
76
+		draw text 5, 90, "shown down above the buttons.", "StatusView"
77
+		draw text 5, 115, "The complete source will be", "StatusView"
78
+		draw text 5, 130, "collected in the right list.", "StatusView"
79
+		draw text 5, 200, "Click on 'Next step' to start ...", "StatusView"
80
+		ShowLine("Welcome to GUI-World!")
81
+	fi	
82
+
83
+	if (n = 1) then
84
+		draw text 5, 20, "At first, we need to create the window.", "StatusView"
85
+		draw text 5, 35, "We will create a window", "StatusView"
86
+		draw text 5, 60, "with a size of 400, 300 (x, y)", "StatusView"
87
+		draw text 5, 75, "at the position 200x200", "StatusView"
88
+		draw text 5, 90, "of your monitor.", "StatusView"
89
+		draw text 5, 110, "The name of the window is ''New App''.", "StatusView"
90
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
91
+		ShowLine("window open 200, 200 to 600, 500, ''View1'', ''New App''")
92
+	fi
93
+
94
+	if (n = 2) then
95
+		if (L = 0) window open 200, 450 to 600, 750, "View1", "New App"
96
+		if (L = 0) listbox add "SourceView", "window open 200, 200 to 600, 500, ''View1'', ''New App''"
97
+		
98
+		draw text 5, 20, "The window should be opened now.", "StatusView"
99
+		draw text 5, 45, "It has no function yet,", "StatusView"
100
+		draw text 5, 60, "so we'll change that.", "StatusView"
101
+		draw text 5, 85, "But first let us define the", "StatusView"
102
+		draw text 5, 100, "background color of the window.", "StatusView"
103
+		draw text 5, 125, "We'll choose white for background.", "StatusView"
104
+		draw text 5, 140, "Red 255 + Green 255 + Green 255", "StatusView"
105
+		draw text 5, 155, " = white.", "StatusView"
106
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
107
+		ShowLine("draw set ''bgcolor'', 255, 255, 255, ''View1''")
108
+	fi
109
+
110
+	if (n = 3) then
111
+		if (L = 0) draw set "bgcolor", 255, 255, 255, "View1"
112
+		if (L = 0) listbox add "SourceView", "draw set ''bgcolor'', 255, 255, 255, ''View1''"
113
+		if (L = 0) listbox add "SourceView", ""
114
+		
115
+		draw text 5, 20, "Ok, white. But still no function!!", "StatusView"
116
+		draw text 5, 45, "We can now drop in some widgets,", "StatusView"
117
+		draw text 5, 60, "such as buttons, checkboxes, etc.", "StatusView"
118
+		draw text 5, 85, "Let's start with a simple button.", "StatusView"
119
+		draw text 5, 100, "The button will be named 'Quit'", "StatusView"
120
+		draw text 5, 115, "and will appear down-right.", "StatusView"
121
+		draw text 5, 140, "Its ID is 'Button1' so it would return", "StatusView"
122
+		draw text 5, 155, "'Button1' if is pressed.", "StatusView"
123
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
124
+		ShowLine("button 330, 270 to 390, 270, ''Button1'', ''Quit'', ''View1''")
125
+	fi
126
+
127
+	if (n = 4) then
128
+		if (L = 0) button 330, 270 to 390, 270, "Button1", "Quit", "View1"
129
+		if (L = 0) listbox add "SourceView", "button 330, 270 to 390, 270, ''Button1'', ''Quit'', ''View1''"
130
+		if (L = 0) listbox add "SourceView", ""
131
+		
132
+		draw text 5, 20, "Creating views.", "StatusView"
133
+		draw text 5, 45, "For further widgets, we should create", "StatusView"
134
+		draw text 5, 60, "extra views inside the View1", "StatusView"
135
+		draw text 5, 85, "The name of the view is 'View2'", "StatusView"
136
+		draw text 5, 100, "and we want it in the upper-left corner", "StatusView"
137
+		draw text 5, 115, "inside the Window (View1).", "StatusView"
138
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
139
+		ShowLine("view 5, 5 to 150, 60, ''View2'', ''View1''")
140
+	fi		
141
+
142
+	if (n = 5) then
143
+		if (L = 0) view 5, 5 to 150, 60, "View2", "View1"
144
+		if (L = 0) listbox add "SourceView", "view 5, 5 to 150, 60, ''View2'', ''View1''"
145
+		
146
+		draw text 5, 60, "We'd like to change the background", "StatusView"
147
+		draw text 5, 75, "color of that new view...", "StatusView"
148
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
149
+		ShowLine("draw set ''bgcolor'', 216, 230, 250, ''View2''")
150
+	fi
151
+
152
+	if (n = 6) then
153
+		if (L = 0) draw set "bgcolor", 216, 230, 250, "View2"
154
+		if (L = 0) listbox add "SourceView", "    draw set ''bgcolor'', 216, 230, 250, ''View2''"
155
+		if (L = 0) listbox add "SourceView", ""
156
+		
157
+		draw text 5, 20, "Radiobuttons.", "StatusView"
158
+		draw text 5, 45, "Now we drop a radiobutton", "StatusView"
159
+		draw text 5, 60, "in the new view.", "StatusView"
160
+		draw text 5, 85, "Note that we have to use the", "StatusView"
161
+		draw text 5, 100, "coordinates of 'View2' for everything", "StatusView"
162
+		draw text 5, 115, "we want to put into it!", "StatusView"
163
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
164
+		ShowLine("radiobutton 5, 10, ''rb1'', ''Radiobutton 1'', 0, ''View2''")
165
+	fi
166
+
167
+	if (n = 7) then
168
+		draw text 5, 20, "Our radiobutton should", "StatusView"
169
+		draw text 15, 45, "appear at 5, 10 on 'View2',", "StatusView"
170
+		draw text 15, 60, "be named 'RadioButton 1'", "StatusView"
171
+		draw text 15, 75, "have the ID 'rb1'", "StatusView"
172
+		draw text 15, 90, "not be activated (activated = 0)", "StatusView"
173
+		draw text 5, 115, "It will return the ID and if", "StatusView"
174
+		draw text 5, 130, "not activated = 0", "StatusView"
175
+		draw text 5, 145, "activated = 1", "StatusView"
176
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
177
+	fi
178
+
179
+	if (n = 8) then
180
+		if (L = 0) radiobutton 5, 10, "rb1", "Radiobutton 1", 0, "View2"
181
+		if (L = 0) listbox add "SourceView", "radiobutton 5, 10, ''rb1'', ''Radiobutton 1'', 0, ''View2''"
182
+		
183
+		draw text 5, 20, "What about another one?", "StatusView"
184
+		draw text 5, 45, "This time activated.", "StatusView"
185
+		draw text 5, 60, "Because they are on the same view,", "StatusView"
186
+		draw text 5, 85, "you can switch between them.", "StatusView"
187
+		draw text 5, 100, "Just try it out...", "StatusView"
188
+		draw text 5, 205, "Click on 'Next step' to go on...", "StatusView"
189
+		ShowLine("radiobutton 5, 30, ''rb2'', ''Radiobutton 2'', 1, ''View2''")
190
+	fi
191
+
192
+	if (n = 9) then
193
+		if (L = 0) radiobutton 5, 30, "rb2", "Radiobutton 2", 1, "View2"
194
+		if (L = 0) listbox add "SourceView", "radiobutton 5, 30, ''rb2'', ''Radiobutton 2'', 1, ''View2''"
195
+		if (L = 0) listbox add "SourceView", ""
196
+
197
+		draw text 5, 20, "Checkbuttons.", "StatusView"
198
+		draw text 5, 45, "Let's make checkbuttons!", "StatusView"
199
+		draw text 5, 60, "This time placed on 'View1' again.", "StatusView"
200
+		draw text 5, 85, "It is named 'Checkbox 1',", "StatusView"
201
+		draw text 5, 100, "has the ID 'cb1' and is", "StatusView"
202
+		draw text 5, 115, "not activated.", "StatusView"
203
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
204
+		ShowLine("checkbox 10, 70, ''cb1'', ''Checkbox 1'', 0, ''View1''")
205
+	fi
206
+
207
+	if (n = 10) then
208
+		if (L = 0) checkbox 10, 70, "cb1", "Checkbox 1", 0, "View1"
209
+		if (L = 0) listbox add "SourceView", "checkbox 10, 60, ''cb1'', ''Checkbox 1'', 0, ''View1''"
210
+		
211
+		draw text 5, 20, "And another one for switching...", "StatusView"
212
+		draw text 5, 45, "This time activated.", "StatusView"
213
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
214
+		ShowLine("checkbox 10, 90, ''cb2'', ''Checkbox 2'', 1, ''View1''")
215
+	fi
216
+
217
+	if (n = 11) then
218
+		if (L = 0) checkbox 10, 90, "cb2", "Checkbox 2", 1, "View1"
219
+		if (L = 0) listbox add "SourceView", "checkbox 10, 60, ''cb2'', ''Checkbox 2'', 1, ''View1''"
220
+		if (L = 0) listbox add "SourceView", ""
221
+		
222
+		draw text 5, 20, "Textcontrol - Input from the user.", "StatusView"
223
+		draw text 5, 45, "This shows a text inputfield with a", "StatusView"
224
+		draw text 5, 60, "short text before it.", "StatusView"
225
+		draw text 5, 85, "It has the ID 'tc1' and returns it, if", "StatusView"
226
+		draw text 5, 100, "a user pressed enter after typing", "StatusView"
227
+		draw text 5, 115, "in the textfield.", "StatusView"
228
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
229
+		ShowLine("textcontrol 10, 120 to 180, 130, ''tc1'', ''Tell me:'', ''Text...'', ''View1''")
230
+	fi
231
+
232
+	if (n = 12) then
233
+		if (L = 0) textcontrol 10, 120 to 180, 130, "tc1", "Tell me:", "Text...", "View1"
234
+		if (L = 0) listbox add "SourceView", "textcontrol 10, 120 to 180, 130, ''tc1'', ''Tell me:'', ''Text...'', ''View1''"
235
+		
236
+		draw text 5, 20, "And now a listbox.", "StatusView"
237
+		draw text 5, 45, "It's a list, where dropboxs can be added to.", "StatusView"
238
+		draw text 5, 60, "It has the ID 'list1' and returns it,", "StatusView"
239
+		draw text 5, 85, "followed by the chosen dropbox.", "StatusView"
240
+		draw text 5, 100, "The '1' in here affects the scrollbars", "StatusView"
241
+		draw text 15, 115, "0 = no scrollbar", "StatusView"
242
+		draw text 15, 130, "1 = vertikal scrollbar", "StatusView"
243
+		draw text 15, 145, "2 = horizontal scrollbar", "StatusView"
244
+		draw text 15, 160, "3 = both scrollbars", "StatusView"
245
+		draw text 5, 185, "We'll take just the vertikal one.", "StatusView"
246
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
247
+		ShowLine("listbox 200, 10 to 380, 260, ''list1'', 1, ''View1''")
248
+	fi
249
+
250
+	if (n = 13) then
251
+		if (L = 0) listbox 200,10 to 380,260,"list1",1, "View1"
252
+		if (L = 0) listbox add "SourceView", "listbox 200, 10 to 380, 260, ''list1'', 1, ''View1''"
253
+		
254
+		draw text 5, 20, "Add items to the list.", "StatusView"
255
+		draw text 5, 45, "Now let's put some items into it.", "StatusView"
256
+		draw text 5, 60, "We will add 3 entries in the list.", "StatusView"
257
+		draw text 5, 85, "Look on the line and then watch out", "StatusView"
258
+		draw text 5, 100, "what happens.", "StatusView"
259
+		draw text 5, 125, "At first we enter 'Hello World'.", "StatusView"
260
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
261
+		ShowLine("listbox add ''list1'', ''Hello world!'''")
262
+	fi
263
+
264
+	if (n = 14) then
265
+		if (L = 0) listbox add "list1", "Hello world!"
266
+		if (L = 0) listbox add "SourceView", "listbox add ''list1'', ''Hello world!''"
267
+
268
+		draw text 5, 20, "Just another entry.", "StatusView"
269
+		draw text 5, 60, "Now we enter 'How are you?'.", "StatusView"
270
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
271
+		ShowLine("listbox add ''list1'', ''How are you?''")
272
+	fi
273
+
274
+	if (n = 15) then
275
+		if (L = 0) listbox add "list1", "How are you?"
276
+		if (L = 0) listbox add "SourceView", "listbox add ''list1'', ''How are you?''"
277
+		
278
+		draw text 5, 20, "The third and last entry.", "StatusView"
279
+		draw text 5, 45, "Last but not least, we enter", "StatusView"
280
+		draw text 5, 60, "'I am fine' to the listbox.", "StatusView"
281
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
282
+		if (L = 0) ShowLine("listbox add ''list1'', ''I am fine!''")
283
+	fi
284
+
285
+	if (n = 16) then
286
+		if (L = 0) listbox add "list1", "I am fine!"
287
+		if (L = 0) listbox add "SourceView", "''dropbox add ''list1'', ''I am fine!''"
288
+		if (L = 0) listbox add "SourceView", ""
289
+		
290
+		draw text 5, 20, "Selfexplaining...", "StatusView"
291
+		draw text 5, 45, "You see everything what differs them", "StatusView"
292
+		draw text 5, 60, "is the text for the entry.", "StatusView"
293
+		draw text 5, 85, "So it is important, where you place", "StatusView"
294
+		draw text 5, 100, "the entries in the sourcecode.", "StatusView"
295
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
296
+		ShowLine("...")
297
+	fi
298
+
299
+	if (n = 17) then
300
+		if (L = 0) draw set "highcolor", 0, 0, 0, "View1"
301
+		if (L = 0) listbox add "SourceView", "draw set ''highcolor'', 0, 0, 0, ''View1''"
302
+
303
+		draw text 5, 20, "Change highcolor.", "StatusView"
304
+		draw text 5, 45, "If you'd like to draw something", "StatusView"
305
+		draw text 5, 60, "e.g. a rectangle, you should control", "StatusView"
306
+		draw text 5, 75, "the background color of the view", "StatusView"
307
+		draw text 5, 90, "which shall appear in.", "StatusView"
308
+		draw text 5, 115, "We chose black (0, 0, 0).", "StatusView"
309
+		draw text 5, 130, "(see sourcecode)", "StatusView"
310
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
311
+		ShowLine("draw set ''highcolor'', 0, 0, 0, ''View1''")
312
+	fi
313
+
314
+	if (n = 18) then
315
+		draw text 5, 20, "Now we set the color, we can draw.", "StatusView"
316
+		draw text 5, 45, "A rectangle will now be drawn", "StatusView"
317
+		draw text 5, 60, " with the previously chosen color", "StatusView"
318
+		draw text 5, 75, "in the window.", "StatusView"
319
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
320
+		ShowLine("draw rect 10, 150 to 180, 190, ''View1''")
321
+	fi
322
+
323
+	if (n = 19) then
324
+		if (L = 0) draw rect 10, 150 to 180, 190, "View1"
325
+		if (L = 0) listbox add "SourceView", "draw rect 10, 150 to 180, 190, ''View1''"
326
+		if (L = 0) listbox add "SourceView", ""
327
+
328
+		draw text 5, 20, "Draw text on the rectangle.", "StatusView"
329
+		draw text 5, 45, "Now we'll do some writing but", "StatusView"
330
+		draw text 5, 60, "first we should control the color.", "StatusView"
331
+		draw text 5, 85, "The highcolor is the color the", "StatusView"
332
+		draw text 5, 100, "text will be in.", "StatusView"
333
+		draw text 5, 125, "We chose red here.", "StatusView"
334
+		draw text 5, 205, "Click on 'Next step' to go on ...", "StatusView"
335
+		ShowLine("draw set ''highcolor'', 255, 0, 0, ''View1''")
336
+	fi
337
+
338
+	if (n = 20) then
339
+		if (L = 0) draw set "highcolor", 255, 0, 0, "View1"
340
+		if (L = 0) draw set "lowcolor", 0, 0, 0, "View1"
341
+		if (L = 0) listbox add "SourceView", "draw set ''highcolor'', 255, 0, 0, ''View1''"
342
+
343
+		draw text 5, 20, "Font -type and -size.", "StatusView"
344
+		draw text 5, 45, "Next we have to define the", "StatusView"
345
+		draw text 5, 60, "fonttype and its size.", "StatusView"
346
+		draw text 5, 85, "You can see the font-idents best", "StatusView"
347
+		draw text 5, 100, "in GoBe productive or something", "StatusView"
348
+		draw text 5, 115, "like that.", "StatusView"
349
+		draw text 5, 200, "Click on 'Next step' to go on ...", "StatusView"
350
+		ShowLine("draw set ''Zurich, Bold, 24'', ''View1''")
351
+	fi
352
+
353
+	if (n = 21) then
354
+		if (L = 0) draw set "Zurich, Bold, 24", "View1"
355
+		if (L = 0) listbox add "SourceView", "draw set ''Zurich, Bold, 24'', ''View1''"
356
+
357
+		draw text 5, 20, "Let's go writing.", "StatusView"
358
+		draw text 5, 45, "The text shall appear in red", "StatusView"
359
+		draw text 5, 60, "right on the rectangle.", "StatusView"
360
+		draw text 5, 85, "We will write the word", "StatusView"
361
+		draw text 5, 100, "'easy", "StatusView"
362
+		draw text 5, 115, "", "StatusView"
363
+		draw text 5, 200, "Click on 'Next step' to go on ...", "StatusView"
364
+		ShowLine("draw text 40, 180, ''easy'', ''View1''")
365
+	fi
366
+
367
+	if (n = 22) then
368
+		if (L = 0) draw text 40, 180, "easy", "View1"
369
+		if (L = 0) listbox add "SourceView", "draw text 40, 180, ''easy'', ''View1''"
370
+
371
+		draw text 5, 20, "Dropboxes.", "StatusView"
372
+		draw text 5, 45, "If you want to provide the user a selection", "StatusView"
373
+		draw text 5, 60, "on a small room, take a dropbox!", "StatusView"
374
+		draw text 5, 85, "This dropbox has the ID ''db1'' and returns", "StatusView"
375
+		draw text 5, 100, "it, if there are entries in it, together with", "StatusView"
376
+		draw text 5, 115, "that entry.", "StatusView"
377
+		draw text 5, 200, "Click on 'Next step' to go on ...", "StatusView"
378
+		ShowLine("dropbox 10, 200 to 180, 220, ''db1'', ''Choose'', ''View1''")
379
+	fi
380
+
381
+	if (n = 23) then
382
+		if (L = 0) dropbox 10, 200 to 180, 220, "db1", "Choose", "View1"
383
+		if (L = 0) listbox add "SourceView", "dropbox 10, 200 to 180, 220, ''db1'', ''Choose'', ''View1''"
384
+
385
+		draw text 5, 20, "Add items to the dropbox.", "StatusView"
386
+		draw text 5, 45, "Adding items to a dropbox is the same", "StatusView"
387
+		draw text 5, 60, "procedure as for listboxes.", "StatusView"
388
+		draw text 5, 85, "We give the ID of the dropbox", "StatusView"
389
+		draw text 5, 100, "which is 'db1' and the name, the", "StatusView"
390
+		draw text 5, 115, "dropbox should have, followed by the", "StatusView"
391
+		draw text 5, 130, "view the dropbox is on.", "StatusView"
392
+		draw text 5, 155, "We'll make three entries again and", "StatusView"
393
+		draw text 5, 170, "start with that line below. ", "StatusView"
394
+		draw text 5, 200, "Click on 'Next step' to go on ...", "StatusView"
395
+		ShowLine("dropbox add ''db1'', ''yab interpreter''")
396
+	fi
397
+
398
+	if (n = 24) then
399
+		if (L = 0) dropbox add "db1", "yab interpreter"
400
+		if (L = 0) listbox add "SourceView", "dropbox add ''db1'', ''yab interpreter''"
401
+		ShowLine("dropbox add ''db1'', ''yet another''")
402
+		sleep 0.5
403
+		if (L = 0) dropbox add "db1", "yet another"
404
+		if (L = 0) listbox add "SourceView", "dropbox add ''db1'', ''yet another''"
405
+		ShowLine("dropbox add ''db1'', ''basic''")
406
+		sleep 0.5
407
+		if (L = 0) dropbox add "db1", "basic"
408
+		if (L = 0) listbox add "SourceView", "dropbox add ''db1'', ''basic''"
409
+
410
+		draw text 5, 20, "That's it for today, man!", "StatusView"
411
+		draw text 5, 45, "More help do you get from the file", "StatusView"
412
+		draw text 5, 60, "DONE_AND_TODO", "StatusView"
413
+		draw text 5, 85, "", "StatusView"
414
+		draw text 5, 100, "To be continued...", "StatusView"
415
+		draw text 5, 115, "", "StatusView"
416
+		draw text 5, 200, "Click on 'Next step' to go insane...", "StatusView"
417
+		ShowLine("Nothing more to tell ...")
418
+	fi
419
+
420
+	if (n = 25) then
421
+
422
+
423
+		draw text 5, 20, "That's it for today, man!", "StatusView"
424
+		draw text 5, 45, "More help do you get from the file", "StatusView"
425
+		draw text 5, 60, "DONE_AND_TODO", "StatusView"
426
+		draw text 5, 85, "", "StatusView"
427
+		draw text 5, 100, "To be continued...", "StatusView"
428
+		draw text 5, 115, "", "StatusView"
429
+		draw text 5, 200, "Click on 'Next step' to go insane...", "StatusView"
430
+		ShowLine("Nothing more to tell ...")
431
+
432
+		stp = stp-1
433
+	fi
434
+
435
+	return
436
+end sub
437
+
438
+sub ShowLine(CurrLine$)
439
+
440
+	draw flush "LineView"
441
+	draw text 10, 17, CurrLine$, "LineView"
442
+	
443
+	return
444
+end sub
0 445
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 100,100 to 600,600, "Main", "IconWorld"
4
+
5
+systempath$ = "/boot/system/apps/Mail"
6
+
7
+draw text 70,30, "bitmap get \"BMP_icon\", \"path\", \"" + systempath$ +"\"", "Main"
8
+bitmap get "BMP_icon", "path", systempath$
9
+draw bitmap 10, 10, "BMP_icon", "alpha", "Main"
10
+bitmap remove "BMP_icon"
11
+ 
12
+draw text 70,70, "bitmap get \"BMP_icon\", \"mime16\", \"application/x-vnd.Be-MAIL\"", "Main"
13
+bitmap get "BMP_icon", "mime16", "application/x-vnd.Be-MAIL"
14
+draw bitmap 10, 60, "BMP_icon", "alpha", "Main"
15
+bitmap remove "BMP_icon"
16
+
17
+draw text 70,110, "bitmap get \"BMP_icon\", \"mime32\", \"application/x-vnd.Be-MAIL\"", "Main"
18
+bitmap get "BMP_icon", "mime32", "application/x-vnd.Be-MAIL"
19
+draw bitmap 10, 90, "BMP_icon", "alpha", "Main"
20
+bitmap remove "BMP_icon"
21
+
22
+draw text 70,150, "bitmap get 32, \"BMP_icon\", \"" + systempath$ + "\"", "Main"
23
+bitmap get 32, "BMP_icon", systempath$
24
+draw bitmap 10, 130, "BMP_icon", "alpha", "Main"
25
+bitmap remove "BMP_icon"
26
+
27
+while(not instr(message$, "Quit"))
28
+wend
29
+
30
+window close "Main"
0 31
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 200,200 to 520,391, "MainView", "ImageWorld"
4
+button 50,163 to 270,183, "Ok_", "Ok", "MainView"
5
+
6
+err = draw image 0,0, "img/image.png", "MainView"
7
+
8
+if(err = 1) then
9
+	alert "Problem while loading image.png!", "Quit", "stop"
10
+	window close "MainView"
11
+	exit 1
12
+endif
13
+
14
+alert "This shows how to show Images in your windows.", "Ok", "idea"
15
+
16
+inloop = true
17
+while(inloop)
18
+	msg$ = message$
19
+
20
+	switch msg$
21
+		case "Ok_|":
22
+		case "MainView:_QuitRequested|":
23
+			inloop = false
24
+			break
25
+		
26
+	end switch
27
+	
28
+wend
29
+
30
+exit
31
+
32
+
0 33
new file mode 100644
... ...
@@ -0,0 +1,69 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+// JDemo - just a smiley
4
+// by DasJott
5
+
6
+window open 300,100 to 800,500,"mainview","Smiley - DEMO"
7
+window set "mainview", "flags","not-zoomable, not-h-resizable, not-v-resizable"
8
+draw set "bgcolor", 0,0,0,"mainview"  
9
+draw set "highcolor",255,255,0,"mainview"
10
+draw circle 250,200,180,"mainview"
11
+
12
+// Eyes
13
+draw set "highcolor",0,0,0,"mainview"
14
+draw circle 170,110,20,"mainview"
15
+view 310,90 to 350,130,"twinkleview","mainview"
16
+draw set "bgcolor",255,255,0,"twinkleview"
17
+draw set "highcolor",0,0,0,"twinkleview"
18
+draw circle 20,20,20,"twinkleview"
19
+
20
+// Smiling mouth
21
+view 140,220 to 360,320,"mouthview","mainview"
22
+draw set "bgcolor",255,255,0,"mouthview"
23
+draw set "highcolor",0,0,0,"mouthview"
24
+draw set 1, "HighSolidFill"
25
+draw circle 110,-11, 110,"mouthview"
26
+draw set 0, "HighSolidFill"
27
+
28
+button 450,370 to 490,390,"Exit","Quit","mainview"
29
+
30
+
31
+
32
+inloop = true
33
+while (inloop = true)
34
+	msg$ = message$	
35
+ 
36
+	if (t < 20) then
37
+		draw flush "twinkleview"
38
+		draw ellipse 20,20, 20, 20-t,"twinkleview"
39
+	fi
40
+
41
+	if (t > 20 and t < 41) then
42
+		draw flush "twinkleview"
43
+		draw ellipse 20,20, 20, t-20,"twinkleview"
44
+	fi
45
+
46
+	if (t = 100) t = 0
47
+	
48
+	t = t+1
49
+	n = n+1
50
+	
51
+	if(n = 200) then
52
+		draw flush "mouthview"
53
+		draw circle 110,-11, 110,"mouthview"
54
+		n = 0
55
+		sleep 1
56
+	fi
57
+	
58
+	if(n = 0) then	
59
+		draw flush "mouthview"
60
+		draw set 1, "HighSolidFill"
61
+		draw circle 110,-11, 110,"mouthview"
62
+		draw set 0, "HighSolidFill"
63
+	fi
64
+		
65
+    if (msg$ = "Exit|") inloop = false
66
+	if (msg$ = "mainview:_QuitRequested|") inloop = false
67
+wend
68
+
69
+window close "mainview"
0 70
new file mode 100644
... ...
@@ -0,0 +1,115 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+window open 200, 200 to 710, 600, "MainView" ,"YAB-Keyboard"
4
+window set "MainView", "flags", "not-h-resizable, not-v-resizable"
5
+
6
+view 10,10 to 500, 180, "TextView", "MainView"
7
+	draw set "bgcolor", 0, 50, 0, "TextView"
8
+	draw set "lowcolor", 0, 50, 0, "TextView"
9
+	draw set "highcolor", 245, 245, 245, "TextView"
10
+	draw set "Zurich, Bold, 20", "TextView"
11
+
12
+button 10, 200 to 50, 240, "Button:Q", "Q", "MainView"
13
+button 60, 200 to 100, 240, "Button:W", "W", "MainView"
14
+button 110, 200 to 150, 240, "Button:E", "E", "MainView"
15
+button 160, 200 to 200, 240, "Button:R", "R", "MainView"
16
+button 210, 200 to 250, 240, "Button:T", "T", "MainView"
17
+button 260, 200 to 300, 240, "Button:Z", "Z", "MainView"
18
+button 310, 200 to 350, 240, "Button:U", "U", "MainView"
19
+button 360, 200 to 400, 240, "Button:I", "I", "MainView"
20
+button 410, 200 to 450, 240, "Button:O", "O", "MainView"
21
+button 460, 200 to 500, 240, "Button:P", "P", "MainView"
22
+
23
+button 20, 250 to 60, 290, "Button:A", "A", "MainView"
24
+button 70, 250 to 110, 290, "Button:S", "S", "MainView"
25
+button 120, 250 to 160, 290, "Button:D", "D", "MainView"
26
+button 170, 250 to 210, 290, "Button:F", "F", "MainView"
27
+button 220, 250 to 260, 290, "Button:G", "G", "MainView"
28
+button 270, 250 to 310, 290, "Button:H", "H", "MainView"
29
+button 320, 250 to 360, 290, "Button:J", "J", "MainView"
30
+button 370, 250 to 410, 290, "Button:K", "K", "MainView"
31
+button 420, 250 to 460, 290, "Button:L", "L", "MainView"
32
+button 465, 250 to 500, 340, "Enter_", "Enter", "MainView"
33
+
34
+button 30, 300 to 70, 340, "Button:Y", "Y", "MainView"
35
+button 80, 300 to 120, 340, "Button:X", "X", "MainView"
36
+button 130, 300 to 170, 340, "Button:C", "C", "MainView"
37
+button 180, 300 to 220, 340, "Button:V", "V", "MainView"
38
+button 230, 300 to 270, 340, "Button:B", "B", "MainView"
39
+button 280, 300 to 320, 340, "Button:N", "N", "MainView"
40
+button 330, 300 to 370, 340, "Button:M", "M", "MainView"
41
+button 380, 300 to 415, 340, "Button:,", ",", "MainView"
42
+button 425, 300 to 460, 340, "Button:.", ".", "MainView"
43
+
44
+button 10, 350 to 60, 390, "About_", "About", "MainView"
45
+button 70, 350 to 430, 390, "Spacebar_", "", "MainView"
46
+button 440, 350 to 500, 390, "Clear_", "Clear all", "MainView"
47
+
48
+a = 10 : b = 25
49
+dim choice$(1)
50
+inloop = true
51
+while (inloop)
52
+	msg$ = message$
53
+	if (split(msg$, choice$(), ":|") >= 2) btn$ = choice$(2)
54
+	if (msg$ <> "") print msg$
55
+
56
+	switch msg$
57
+
58
+		case "MainView:_QuitRequested|"
59
+			inloop = false
60
+			break
61
+
62
+		case "Button:"+btn$+"|"
63
+			draw text a, b, btn$, "TextView"
64
+				if (btn$ = "J" ) then
65
+					a = a+10
66
+				elsif (btn$ = "I" or btn$ = "," or btn$ = ".") then
67
+					a = a+6
68
+				elsif (btn$ = "W") then
69
+					a = a+20
70
+				elsif (btn$ = "F" or btn$ = "T") then
71
+					a = a+12
72
+				elsif (btn$ = "M") then
73
+					a = a+18
74
+				elsif (btn$ = "N" or btn$ = "G" or btn$ = "Q" or btn$ = "O") then
75
+					a=a+15
76
+				else
77
+					a = a+14
78
+				fi
79
+			break
80
+
81
+		case "Enter_|"
82
+			a = 10 : b = b+25
83
+			break
84
+
85
+		case "Spacebar_|"
86
+			a = a+12
87
+			break
88
+
89
+		case "Clear_|"
90
+			draw flush "TextView"
91
+			a = 10 : b = 25
92
+			break
93
+
94
+		case "About_|"
95
+			ShowAbout()
96
+			break
97
+
98
+	end switch
99
+	sleep 0.01
100
+wend
101
+exit
102
+
103
+sub ShowAbout()
104
+	for i = 0 to 215
105
+		msg$ = message$
106
+		draw flush "TextView"
107
+		draw text 200, 190-i, "This is:", "TextView"
108
+		draw text 160, 215-i, "YAB - Keyboard", "TextView"
109
+		if (msg$ = "About_|") break
110
+		sleep 0.01
111
+	next i
112
+	a = 10 : b = 25
113
+	draw flush "TextView"
114
+	return
115
+end sub
0 116
new file mode 100644
... ...
@@ -0,0 +1,401 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+// Main background colors:
4
+r = 206 : g = 226 : b = 236
5
+
6
+// Open main window:
7
+window open 100, 250 to 600, 650, "MainView", "Loop-World"
8
+	window set "MainView", "flags","not-zoomable"
9
+	window set "MainView", "minimumto",500,400
10
+	window set "MainView", "maximumto",500,400
11
+	draw set "bgcolor", r, g, b, "MainView"
12
+	draw set "lowcolor", r-75, g-75, b-75, "MainView"
13
+	draw line 10, 365 to 490, 365, "MainView"
14
+	draw set "lowcolor", r+40, g+40, b+40, "MainView"
15
+	draw line 10, 366 to 490, 366, "MainView"
16
+	draw set "lowcolor", r, g, b, "MainView"
17
+	draw set "Swis721 BT, Bold, 14", "MainView"
18
+	draw text 10, 20, "Loop-World", "MainView"
19
+	draw text 200, 20, "Sourcecode:", "MainView"
20
+
21
+
22
+
23
+// make views inside the main window:
24
+view 0, 30 to 190, 360, "ExplainView", "MainView"
25
+	draw set "bgcolor", r, g, b, "ExplainView"
26
+	draw set "Swis721 BT, Roman, 10", "ExplainView"
27
+
28
+view 200, 30 to 490, 360, "SourceView", "MainView"
29
+	draw set "bgcolor", r+39, g+39, b+39, "SourceView"
30
+	draw set "Swis721 BT, Roman, 10", "SourceView"
31
+
32
+//draw text 10, 265, "Choose a kind of loop:", "MainView"
33
+button 10, 370 to 60, 390, "For_Loop_", "for/next", "MainView"
34
+button 65, 370 to 115, 390, "While_Loop_", "while", "MainView"
35
+button 120, 370 to 170, 390, "Do_Loop_", "do/loop", "MainView"
36
+button 175, 370 to 225, 390, "Sub_Loop_", "sub m(n)", "MainView"
37
+button 230, 370 to 280, 390, "Other_Loop_", "Other", "MainView"
38
+//button 285, 370 to 335, 390, "None_", "None", "MainView"
39
+button 345, 370 to 395, 390, "None_", "Back", "MainView"
40
+button 405, 370 to 490, 390, "Exec_", "Execute", "MainView"
41
+
42
+dim SourceLine$(20)
43
+ShowSource("none")
44
+
45
+// mainloop of the program:
46
+dim cmd$(1)
47
+inloop = true
48
+while (inloop)
49
+	msg$ = message$
50
+	if (split(msg$, cmd$(), ":|")  > 2) item$ = cmd$(2)
51
+
52
+	if (msg$ <> "") print msg$
53
+
54
+	switch msg$
55
+
56
+		case "For_Loop_|"
57
+			if (CurrentSource$ = "For_Loop") break
58
+			ShowSource("For_Loop")
59
+			break
60
+
61
+		case "While_Loop_|"
62
+			if (CurrentSource$ = "While_Loop") break
63
+			ShowSource("While_Loop")
64
+			break
65
+
66
+		case "Do_Loop_|"
67
+			if (CurrentSource$ = "Do_Loop") break
68
+			ShowSource("Do_Loop")
69
+			break
70
+
71
+		case "Sub_Loop_|"
72
+			if (CurrentSource$ = "Sub_Loop") break
73
+			ShowSource("Sub_Loop")
74
+			break
75
+
76
+		case "Other_Loop_|"
77
+			if (CurrentSource$ = "Other_Loop") break
78
+			ShowSource("Other_Loop")
79
+			break
80
+
81
+		case "None_|"
82
+			if (CurrentSource$ = "none") break
83
+			ShowSource("none")
84
+			break
85
+
86
+		case "Exec_|"
87
+			if (DemoWin = true) break
88
+			if (CurrentSource$ = "none") break
89
+			ExecSource(CurrentSource$)
90
+			break
91
+
92
+		case "Quit_|"
93