Skip to content

Commit 06fbf06

Browse files
authored
Merge pull request #170 from chrisws/12_25
12 25
2 parents 0336a14 + fc659cf commit 06fbf06

File tree

39 files changed

+494
-268
lines changed

39 files changed

+494
-268
lines changed

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2022-11-13 (12.25)
2+
ANDROID: Updated file manager web UI:
3+
- Implemented delete command
4+
- Implemented upload support for non .bas files
5+
- Fixed date column sorting
6+
COMMON: SPLIT with empty input now gives zero length output #147
7+
COMMON: Fix for bug #166: Display floating point numbers with high precision (by J7M)
8+
COMMON: Fixed functions Polyarea, Polycent (by J7M)
9+
CONSOLE: vt100 (esc sequences) support for console (by J7M)
10+
11+
2022-11-06 (12.25)
12+
ANDROID: fix crash with INPUT command while scrolled #160
13+
114
2022-08-26 (12.25)
215
CONSOLE: Fixed TAB handling
316
COMMON: Only TRIM Strings

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ function buildWeb() {
345345
function buildEmscripten() {
346346
TARGET="Building Emscripten version."
347347
BUILD_SUBDIRS="src/common src/platform/emcc"
348+
AC_CHECK_PROG(have_xxd, xxd, [yes], [no])
349+
if test "${have_xxd}" = "no" ; then
350+
AC_MSG_ERROR([xxd command not installed: configure failed.])
351+
fi
348352
AC_CHECK_HEADERS([emscripten.h], [], [AC_MSG_ERROR([emscripten is not installed])])
349353
AM_CONDITIONAL(WITH_CYGWIN_CONSOLE, false)
350354
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])

samples/distro-examples/tests/split-join.bas

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,12 @@ if (9 != ubound(a)) then
6060
throw "Final empty entry was ignored"
6161
endif
6262

63+
row = ""
64+
split row, ":", fields()
65+
if (len(fields) != 0) then throw "Empty input gave non-empty output"
66+
67+
s="$$$1$2$3$4$5$$$6$7$"
68+
split s, "!@#$%^", a
69+
if (ubound(a) - lbound(a) != len(a) - 1) then throw "Dimension error"
70+
71+

src/common/blib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,10 +2249,11 @@ void cmd_wsplit() {
22492249
elem_p = v_elem(var_p, count);
22502250
if (*ps) {
22512251
v_setstr(elem_p, ps);
2252-
} else {
2252+
count++;
2253+
} else if (count) {
22532254
v_setstr(elem_p, "");
2255+
count++;
22542256
}
2255-
count++;
22562257

22572258
// final resize
22582259
v_resize_array(var_p, count);

src/lib/lodepng

src/lib/miniaudio

src/lib/stb

src/platform/android/app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
applicationId 'net.sourceforge.smallbasic'
1010
minSdkVersion 16
11-
targetSdkVersion 31
12-
versionCode 52
11+
targetSdkVersion 33
12+
versionCode 54
1313
versionName '12.25'
1414
resConfigs 'en'
1515
}
@@ -47,9 +47,10 @@ android {
4747
path '../jni/Android.mk'
4848
}
4949
}
50+
namespace 'net.sourceforge.smallbasic'
5051
}
5152

5253
dependencies {
53-
implementation 'androidx.core:core:1.8.0'
54+
implementation 'androidx.core:core:1.9.0'
5455
testImplementation 'junit:junit:4.13.2'
5556
}

src/platform/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="net.sourceforge.smallbasic">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43
<!-- support large + xlarge screens to avoid compatibility mode -->
54
<supports-screens android:largeScreens="true" />
65
<supports-screens android:xlargeScreens="true" />

src/platform/android/app/src/main/assets/main.bas

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const aboutId = "_about"
3434
const backId = "_back"
3535
const scratchId = "_scratch"
3636
const scratch_file = HOME + "/scratch.bas"
37+
const sortEnd = chr(255)
3738

3839
func mk_menu(value, lab, x)
3940
local bn
@@ -76,16 +77,20 @@ func mk_scratch()
7677
return result
7778
end
7879

79-
sub do_okay_button(bn_extra)
80+
sub do_okay_button(bn_extra1, bn_extra2)
8081
local frm, button
8182
button.label = "[Close]"
8283
button.x = (xmax - txtw(button.label)) / 2
8384
button.y = ypos * char_h
8485
button.color = colNav
8586
button.type = "link"
86-
if (ismap(bn_extra)) then
87-
frm.inputs << bn_extra
87+
if (ismap(bn_extra1)) then
88+
frm.inputs << bn_extra1
8889
endif
90+
if (ismap(bn_extra2)) then
91+
frm.inputs << bn_extra2
92+
endif
93+
8994
frm.inputs << button
9095
frm = form(frm)
9196
print
@@ -130,6 +135,17 @@ sub do_about()
130135
bn_home.color = colNav
131136
print:print
132137

138+
local bn_privacy
139+
color colNav2
140+
bn_privacy.x = 2
141+
bn_privacy.y = ypos * char_h + char_h + 2
142+
bn_privacy.type = "link"
143+
bn_privacy.isExternal = true
144+
bn_privacy.color = colNav
145+
bn_privacy.label = "https://smallbasic.github.io/pages/privacy.html"
146+
print "Privacy Policy:"
147+
print:print
148+
133149
color colText2
134150
print "SmallBASIC comes with ABSOLUTELY NO WARRANTY. ";
135151
print "This program is free software; you can use it ";
@@ -139,7 +155,7 @@ sub do_about()
139155
print
140156
color colText
141157
server_info()
142-
do_okay_button(bn_home)
158+
do_okay_button(bn_home, bn_privacy)
143159
clear_screen()
144160
end
145161

@@ -215,13 +231,17 @@ end
215231
func fileCmpFunc0(l, r)
216232
local f1 = lower(l.name)
217233
local f2 = lower(r.name)
234+
if (right(f1, 4) != ".bas") then f1 = sortEnd + f1
235+
if (right(f2, 4) != ".bas") then f2 = sortEnd + f2
218236
local n = iff(f1 == f2, 0, iff(f1 > f2, 1, -1))
219237
return iff(l.dir == r.dir, n, iff(l.dir, 1, -1))
220238
end
221239

222240
func fileCmpFunc1(l, r)
223241
local f1 = lower(l.name)
224242
local f2 = lower(r.name)
243+
if (right(f1, 4) != ".bas") then f1 = sortEnd + f1
244+
if (right(f2, 4) != ".bas") then f2 = sortEnd + f2
225245
local n = iff(f1 == f2, 0, iff(f1 > f2, -1, 1))
226246
return iff(l.dir == r.dir, n, iff(l.dir, 1, -1))
227247
end
@@ -270,7 +290,7 @@ sub loadFileList(path, byref basList)
270290
end
271291

272292
func androidWalker(node)
273-
if (node.dir == 0 && lower(right(node.name, 4)) == ".bas") then
293+
if (node.dir == 0) then
274294
basList << node
275295
endif
276296
return node.depth == 0
@@ -377,7 +397,8 @@ sub listFiles(byref frm, path, sortDir, byref basList)
377397
endif
378398
if (abbr) then
379399
bn = mk_bn(path + name, name, txtcol)
380-
bn.type = "link"
400+
bn.type = iff(lower(right(name, 4)) == ".bas", "link", "label")
401+
if (bn.type == "label") then bn.color = colText
381402
if (!node.dir) then bn.isExit = true
382403
else
383404
if (len(name) > 27) then
@@ -386,7 +407,8 @@ sub listFiles(byref frm, path, sortDir, byref basList)
386407
lab = name
387408
endif
388409
bn = mk_bn(path + name, lab, txtcol)
389-
bn.type = "link"
410+
bn.type = iff(lower(right(name, 4)) == ".bas", "link", "label")
411+
if (bn.type == "label") then bn.color = colText
390412
if (!node.dir) then bn.isExit = true
391413
frm.inputs << bn
392414
gap = 12 - len(str(node.size))
@@ -538,7 +560,7 @@ sub manageFiles()
538560
for i = 0 to len_buffer
539561
print buffer(i)
540562
next i
541-
do_okay_button(nil)
563+
do_okay_button(nil, nil)
542564
clear_screen()
543565
wnd.graphicsScreen1()
544566
f.value = selectedFile

0 commit comments

Comments
 (0)