You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _build/pages/android.markdown
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ All of the above UI elements are written in SmallBASIC, see [main.bas](https://g
37
37
38
38
To use the following services, your program must start with the following two lines:
39
39
40
-
```
40
+
```smallbasic
41
41
option predef load modules
42
42
import android
43
43
```
@@ -48,23 +48,23 @@ The first line tell SmallBASIC to dynamically load runtime modules. The second l
48
48
49
49
GPS_ON
50
50
51
-
```
51
+
```smallbasic
52
52
android.gps_on()
53
53
```
54
54
55
55
Instructs the system to commence recording location information. Note: This relies on the device location services being enabled by the user.
56
56
57
57
GPS_OFF
58
58
59
-
```
59
+
```smallbasic
60
60
android.gps_off()
61
61
```
62
62
63
63
Turns off recording of location information.
64
64
65
65
LOCATION
66
66
67
-
```
67
+
```smallbasic
68
68
l = android.location()
69
69
```
70
70
@@ -86,7 +86,7 @@ For more details, see: <https://developer.android.com/reference/android/location
86
86
87
87
SENSOR_ON
88
88
89
-
```
89
+
```smallbasic
90
90
const SensorAccelerometer = 0
91
91
const SensorMagneticField = 1
92
92
const SensorGyroscope = 2
@@ -99,15 +99,15 @@ Enables the given sensor (currently only one may be enabled at a time). Throws a
99
99
100
100
SENSOR_OFF
101
101
102
-
```
102
+
```smallbasic
103
103
android.sensor_off()
104
104
```
105
105
106
106
Disables any active sensor.
107
107
108
108
SENSOR
109
109
110
-
```
110
+
```smallbasic
111
111
s = android.sensor()
112
112
```
113
113
@@ -131,39 +131,39 @@ Notes:
131
131
132
132
TTS_PITCH
133
133
134
-
```
134
+
```smallbasic
135
135
android.tts_pitch(n)
136
136
```
137
137
138
138
Sets the voice pitch (default is 1.0).
139
139
140
140
TTS_RATE
141
141
142
-
```
142
+
```smallbasic
143
143
android.tts_rate(n)
144
144
```
145
145
146
146
Sets the rate of speaking (default is 1.0)
147
147
148
148
TTS_LANG
149
149
150
-
```
150
+
```smallbasic
151
151
android.tts_lang(s)
152
152
```
153
153
154
154
Sets the locale, for example "en", "de", "fr" for English, German, France. May cause the system to download the language codec if not already installed.
Copy file name to clipboardExpand all lines: _build/pages/network.markdown
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Network programming
7
7
8
8
Use the prefix "HTTP:" with the OPEN command to open a network HTTP connection. You can then use the file number with the TLOAD command to read the data.
9
9
10
-
```
10
+
```smallbasic
11
11
print "DuckDuckGo Search"
12
12
while 1
13
13
print '<=== when cycle around need to isolate input prompt
@@ -43,7 +43,7 @@ wend
43
43
44
44
Use the prefix "HTTP:" with the OPEN command to open an image file over the network. You can then pass the file number to the IMAGE command. This returns an system object which can then be used to manipulate images in the graphical version of SmallBASIC.
45
45
46
-
```
46
+
```smallbasic
47
47
' open some random image I found on the net
48
48
open "http://img2.wikia.nocookie.net/__cb20150113215904/farmville/images/9/92/Lumberjack_Gnome-icon.png" as #1
49
49
@@ -85,7 +85,7 @@ pause true
85
85
86
86
Use the prefix "SOCL:" with the OPEN command to open a network socket. You can then use the file number with other input/output commands to interact with the connection.
87
87
88
-
```
88
+
```smallbasic
89
89
open "SOCL:192.168.178.76:8080" as #1
90
90
print #1, "time"
91
91
lineinput #1, s
@@ -95,7 +95,7 @@ close #1
95
95
96
96
If you omit the host name in the SOCL: string passed to the OPEN command, SmallBASIC will listen for connections from another host/process.
97
97
98
-
```
98
+
```smallbasic
99
99
rem Print a date string like '29 SEP 2018 09:31:49 ACST'
100
100
func get_time
101
101
local today = julian(date)
@@ -127,15 +127,15 @@ In addition to the graphical and command line versions of SmallBASIC, there is a
127
127
128
128
You launch the web SmallBASIC in a folder containing one or more SmallBASIC programs, you then point your browser to a URL formulated from the listening port number and the SmallBASIC program name. For example:
129
129
130
-
```
130
+
```smallbasic
131
131
$ ls cats.bas # program cats.bas exists in the current folder
132
132
$ sbasicw
133
133
Starting SmallBASIC web server on port:8080
134
134
```
135
135
136
136
In your Web Browser:
137
137
138
-
```
138
+
```smallbasic
139
139
http://localhost:8080/cats.bas
140
140
Output from cats.bas displayed in the web browser.
Copy file name to clipboardExpand all lines: _build/pages/plugins_nuklear.markdown
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ If you are working in Windows, then start your program with:
26
26
27
27
The following code shows how to create your first "Hello World" window.
28
28
29
-
```
29
+
```smallbasic
30
30
option predef grmode 640x480 ' Set window size
31
31
32
32
import nuklear as nk ' Import Nuklear plugin
@@ -44,7 +44,7 @@ With `nk.windowBegin()` a window will be created, if not already present. Additi
44
44
45
45
## Placing a button
46
46
47
-
```
47
+
```smallbasic
48
48
option predef grmode 640x480
49
49
50
50
import nuklear as nk
@@ -69,7 +69,7 @@ Before you can add a button, you have to define a layout which can hold the GUI
69
69
70
70
## Displaying two radio buttons
71
71
72
-
```
72
+
```smallbasic
73
73
option predef grmode 640x480
74
74
75
75
import nuklear as nk
@@ -98,7 +98,7 @@ Because `nk.layoutRow("dynamic", 90, 2)` is this time set to "2" two elements ar
98
98
99
99
## Dynamic rows vs. static rows
100
100
101
-
```
101
+
```smallbasic
102
102
option predef grmode 640x480
103
103
104
104
import nuklear as nk
@@ -133,7 +133,7 @@ If you run this example and change the size of the window with the mouse, you ca
133
133
134
134
## Show input boxes with labels - More flexible row layout
135
135
136
-
```
136
+
```smallbasic
137
137
option predef grmode 640x480
138
138
139
139
import nuklear as nk
@@ -174,7 +174,7 @@ When using `nk.layoutRowBegin(...)` the end of the definition for a row has to b
174
174
175
175
Caution: `menuItem()` is not yet working probably. This will be fixed with the next release.
176
176
177
-
```
177
+
```smallbasic
178
178
option predef grmode 640x480
179
179
180
180
import nuklear as nk
@@ -208,7 +208,7 @@ The example above will display a menu with one entry called "Menu". When clicked
208
208
209
209
### Draw basic shapes
210
210
211
-
```
211
+
```smallbasic
212
212
option predef grmode 640x480
213
213
214
214
import nuklear as nk
@@ -263,7 +263,7 @@ checkboxValue: actual value of the checkbox
263
263
264
264
Creates a checkbox with the name _Name_. State of the checkbox is stored in _checkboxValue_.
265
265
266
-
```
266
+
```smallbasic
267
267
checkA = {value: false}
268
268
...
269
269
nk.Checkbox("Checkbox A", checkA)
@@ -290,7 +290,7 @@ color: color of the colorpicker
290
290
291
291
Creates a colorpicker. The color picked by the user is stored in color.value as a string.
292
292
293
-
```
293
+
```smallbasic
294
294
colorPicker = {value: "#ff0000"}
295
295
...
296
296
nk.colorPicker(colorPicker)
@@ -305,7 +305,7 @@ comboValue (map): settings of combobox
305
305
306
306
Creates a combobox. The number of the selected combobox is stored in _comboValue.value_.
307
307
308
-
```
308
+
```smallbasic
309
309
comboA = {value: 1, items: ["A", "B", "C"]}
310
310
nk.combobox(comboA)
311
311
```
@@ -319,7 +319,7 @@ triggerX, triggerY, triggerW, triggerH: Trigger area in pixel
319
319
320
320
Creates an contextual menu. Right-click in the trigger area will open a menu.
321
321
322
-
```
322
+
```smallbasic
323
323
[x, y, w, h] = nk.widgetBounds()
324
324
if nk.contextualBegin(100, 100, x, y, w, h) then
325
325
nk.layoutRow("dynamic", 30, 1)
@@ -358,7 +358,7 @@ editValue: Stores the actual text
358
358
359
359
Creates an input box. The content of the input box is stored in _editValue.value_.
360
360
361
-
```
361
+
```smallbasic
362
362
editA = {value: ""}
363
363
...
364
364
nk.edit("field", editA)
@@ -383,7 +383,7 @@ Style (String): "", "border"
383
383
384
384
Groups several elements. The group can be surrounded by a border.
385
385
386
-
```
386
+
```smallbasic
387
387
nk.groupBegin("Group 1", "border")
388
388
nk.layoutRow("dynamic", 30, 1)
389
389
nk.label("Radio buttons:")
@@ -414,7 +414,7 @@ color (string): hex color, i.e "#ff0000"
414
414
415
415
Creates a label.
416
416
417
-
```
417
+
```smallbasic
418
418
nk.label("Left label")
419
419
nk.label("Centered label", "centered")
420
420
nk.label("Right label", "right")
@@ -523,7 +523,7 @@ modifiable: true or false (default: false)
523
523
524
524
Displays a progress bar. The length of the bar is given by _progressValue.value_. Set _modifiable_ to true, if you want to use the progress bar as a slider to change the value.
525
525
526
-
```
526
+
```smallbasic
527
527
progress.value = 5
528
528
...
529
529
nk.progress(progress, 10, false)
@@ -541,7 +541,7 @@ stepSizeByMoving: Stepsize when click + hold + moving the mouse
541
541
542
542
Displays an input box for numbers. The actual value is stored in _propertyValue.value_.
0 commit comments