Skip to content

Commit 062472c

Browse files
committed
Merge pull request #30 from chrisws/0_11_20
0 12 0
2 parents 3e10553 + a4e8c2b commit 062472c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+892
-343
lines changed

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2015-10-20
2+
Fix LET when assigning a value to a MAP/ARRAY field
3+
4+
2015-09-15
5+
SDL Update PEN(3) to work more like FLTK
6+
Fix display output before PEN
7+
Fix BOLD and ITALIC font display
8+
Context menu edit keyword completion
9+
Updated program icon
10+
Editor line number widget can be used for scrolling
11+
Updated editor help display
12+
Fix TSAVE with try/catch
13+
114
2015-08-26
215
Editor fixes:
316
- now displays an i-beam/edit cursor

Makefile.am

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,14 @@
11
# SmallBASIC
2-
# Copyright(C) 2001-2012 Chris Warren-Smith.
2+
# Copyright(C) 2001-2015 Chris Warren-Smith.
33
#
44
# This program is distributed under the terms of the GPL v2.0 or later
55
# Download the GNU Public License (GPL) from www.gnu.org
66
#
77

88
SUBDIRS = @BUILD_SUBDIRS@
99

10-
EXTRA_DIST = \
11-
AUTHORS \
12-
ChangeLog \
13-
configure.in \
14-
NEWS \
15-
README \
16-
autogen.sh \
17-
documentation/export_csv.bas \
18-
documentation/sbasic_ref.csv \
19-
documentation/HOWTO/HOWTO-DOCUMENT.TXT \
20-
documentation/HOWTO/HOWTO-PORT.TXT \
21-
documentation/HOWTO/DEVELOP.TXT \
22-
documentation/LICENSE \
23-
documentation/README \
24-
documentation/README.UNIX \
25-
images/logo.gif \
26-
images/sb16x16.png \
27-
images/sb32x32.png \
28-
images/sb-desktop-16x16.png \
29-
images/sb-desktop-32x32.png \
30-
ide/smallbasic.lang \
31-
ide/small-basic-mode.el \
32-
ide/smallbasic.syn \
33-
rpm/README \
34-
rpm/SPECS/opensuse.spec
35-
36-
install-exec-hook:
37-
(mkdir -p $(DESTDIR)$(pkgdatadir) && \
38-
mkdir -p $(DESTDIR)$(pkgdatadir)/plugins && \
39-
mkdir -p $(DESTDIR)$(pkgdatadir)/ide && \
40-
mkdir -p $(DESTDIR)$(pkgdatadir)/samples && \
41-
cp documentation/sbasic_ref.csv $(DESTDIR)$(pkgdatadir) && \
42-
cp plugins/*.* $(DESTDIR)$(pkgdatadir)/plugins && \
43-
cp ide/*.* $(DESTDIR)$(pkgdatadir)/ide)
44-
4510
deb:
46-
fakeroot dpkg-buildpackage
11+
fakeroot dpkg-buildpackage -b
4712

4813
test:
4914
(cd @TEST_DIR@ && make test)

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, and graphic commands along with structured programming syntax
22

33
## Building the SDL version
4+
5+
Initial setup on linux
6+
```
7+
$ sudo apt-get install git autotools-dev automake gcc g++ libsdl2-dev libfreetype6-dev libfontconfig1-dev
8+
$ git clone https://github.com/smallbasic/SmallBASIC.git
9+
$ cd SmallBASIC
10+
$ sh autogen.sh
11+
```
12+
Build in linux
413
```
514
$ ./configure --enable-sdl
615
$ make

configure.ac

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
dnl
22
dnl Configure script for SmallBASIC
33
dnl
4-
dnl Copyright(C) 2001-2014 Chris Warren-Smith.
4+
dnl Copyright(C) 2001-2015 Chris Warren-Smith.
55
dnl
66
dnl This program is distributed under the terms of the GPL v2.0
77
dnl Download the GNU Public License (GPL) from www.gnu.org
88
dnl
99

10-
AC_INIT([smallbasic], [0.11.20])
10+
AC_INIT([smallbasic], [0.12.0])
1111
AC_CONFIG_SRCDIR([configure.ac])
1212

1313
AC_CANONICAL_TARGET
@@ -204,9 +204,24 @@ function buildSDL() {
204204
dnl do not depend on cygwin.dll under cygwin build
205205
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -mms-bitfields"
206206
PACKAGE_LIBS="${PACKAGE_LIBS} -lwsock32 -lws2_32 -static-libgcc -static-libstdc++"
207+
PACKAGE_LIBS="-Wl,-Bstatic ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
207208
AC_DEFINE(_Win32, 1, [Windows build])
208209
;;
209210

211+
*darwin*)
212+
# OSX Check fontconfig configuration
213+
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
214+
AC_SUBST(FONTCONFIG_CFLAGS)
215+
AC_SUBST(FONTCONFIG_LIBS)
216+
217+
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${FONTCONFIG_CFLAGS}"
218+
219+
dnl backlinking support for modules
220+
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
221+
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
222+
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `freetype-config --libs`"
223+
;;
224+
210225
*)
211226
# Unix - Check fontconfig configuration
212227
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
@@ -218,17 +233,10 @@ function buildSDL() {
218233
dnl backlinking support for modules
219234
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
220235
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
236+
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
221237
esac
222238

223239
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `freetype-config --cflags` -fno-exceptions"
224-
case "${host_os}" in
225-
*mingw*)
226-
PACKAGE_LIBS="-Wl,-Bstatic ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
227-
;;
228-
229-
*)
230-
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `freetype-config --libs`"
231-
esac
232240

233241
dnl preconfigured values for SDL build
234242
AC_DEFINE(_SDL, 1, [Defined when building SDL version])
@@ -339,19 +347,7 @@ function buildConsole() {
339347
AC_SUBST(BUILD_SUBDIRS)
340348
}
341349

342-
function buildDist() {
343-
TARGET="Building source code release."
344-
defaultConditionals
345-
BUILD_SUBDIRS="src/common src/platform/gtk/src src/platform/gtk/data src/platform/gtk/icons"
346-
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/fltk"
347-
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/sdl"
348-
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/unix"
349-
AC_SUBST(BUILD_SUBDIRS)
350-
}
351-
352-
if test x$ac_build_dist = xyes; then
353-
buildDist
354-
elif test x$ac_build_fltk = xyes; then
350+
if test x$ac_build_fltk = xyes; then
355351
buildFLTK
356352
elif test x$ac_build_sdl = xyes; then
357353
buildSDL

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
smallbasic (0.12.0) unstable; urgency=low
2+
* Various - see web site
3+
4+
-- Chris Warren-Smith <cwarrensmith@gmail.com> Sat, 17 Sept 2015 09:45:25 +1000
5+
16
smallbasic (0.11.17) unstable; urgency=low
27
* Fix compiler ignoring unused assignment values
38
* Implement IMAGE

debian/rules

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endif
2828
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
2929
cp -f /usr/share/misc/config.guess config.guess
3030
endif
31-
./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --enable-fltk
31+
./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-sdl
3232

3333
build: build-stamp
3434

@@ -69,17 +69,11 @@ binary-indep: build install
6969
binary-arch: build install
7070
dh_testdir
7171
dh_testroot
72-
dh_installchangelogs ChangeLog
73-
dh_installdocs
74-
dh_installexamples
75-
dh_install --exclude=".git" documentation/sbasic_ref.csv plugins samples/distro-examples usr/share/smallbasic
76-
dh_installman
7772
dh_link
7873
dh_strip
7974
dh_compress
8075
dh_fixperms
8176
dh_installdeb
82-
dh_shlibdeps
8377
dh_gencontrol
8478
dh_md5sums
8579
dh_builddeb

documentation/build_kwp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ int main(int argc, char *argv[]) {
236236
}
237237

238238
fprintf(stdout, "/* automagicaly generated file */\n");
239-
fprintf(stdout, "struct KEYWORD_HELP {\n");
239+
fprintf(stdout, "static struct KEYWORD_HELP {\n");
240240
fprintf(stdout, " const char *package;\n");
241241
fprintf(stdout, " const char *keyword;\n");
242242
fprintf(stdout, " const char *signature;\n");

documentation/sbasic_ref.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Language,keyword,SUB,657,"SUB foo (a, b)","Declare a sub procedure. Sub's do not
149149
Language,keyword,THEN,658,"THEN","foo = 1: if foo==1 THEN: ? ""one"": fi"
150150
Language,keyword,UNIT,659,"UNIT name","Units are a set of procedures, functions and/or variables that can be used by another program or unit."
151151
Language,keyword,UNTIL,660,"UNTIL","a = 0: repeat: a++: ? a: UNTIL a = 10"
152-
Language,keyword,USE,661,"USE","Used with various commands for passing a user-defined expression. eg SPLIT s," ",v USE TRIM(x). Trim each element of v."
152+
Language,keyword,USE,661,"USE","Used with various commands for passing a user-defined expression. eg SPLIT s,"" "",v USE TRIM(x). Trim each element of v."
153153
Language,operator,AND,662,"a AND b","Logical AND. Right side is not evaluated if left side evaluates to False."
154154
Language,operator,BAND,663,"a BAND b","Bitwise AND."
155155
Language,operator,BOR,664,"a BOR b","Bitwise OR."

ide/android/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
package="net.sourceforge.smallbasic"
44
android:installLocation="preferExternal"
55
android:versionCode="15"
6-
android:versionName="0.11.19">
6+
android:versionName="0.12.0">
77
<!-- This is the platform API where NativeActivity was introduced. -->
88
<uses-sdk android:minSdkVersion="9"/>
99

ide/android/assets/main.bas

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func mk_bn(value, lab, fg)
2121
bn.value = value
2222
bn.label = lab
2323
bn.color = fg
24-
bn.backgroundColor = 0
2524
mk_bn = bn
2625
end
2726

@@ -56,7 +55,7 @@ sub do_about()
5655
print "(_ ._ _ _.|||_) /\ (_ |/ "
5756
print "__)| | |(_||||_)/--\__)|\_"
5857
print
59-
print "Version 0.11.20"
58+
print "Version 0.12.0"
6059
print
6160
print "Copyright (c) 2002-2015 Chris Warren-Smith"
6261
print "Copyright (c) 1999-2006 Nic Christopoulos" + chr(10)
@@ -82,6 +81,40 @@ sub do_about()
8281
cls
8382
end
8483

84+
sub do_newfile()
85+
color 3, 0
86+
cls
87+
print boldOn + "Create new program."
88+
print boldOff + "To enable editing, display the menu then select Editor [ON]."
89+
print "Press <enter> to leave this screen without making any changes."
90+
print
91+
local valid_file = false
92+
while (!valid_file)
93+
input "Enter file name: ", file
94+
if (len(file) == 0) then
95+
exit loop
96+
endif
97+
if (leftoflast(file, ".bas") == 0) then
98+
file += ".bas"
99+
endif
100+
try
101+
if (exist(file)) then
102+
print "File " + file + " already exists"
103+
else
104+
dim text
105+
text << "REM SmallBASIC"
106+
text << "REM created: " + date
107+
tsave file, text
108+
valid_file = true
109+
endif
110+
catch e
111+
print "Error creating file: " e
112+
end try
113+
wend
114+
color 7, 0
115+
cls
116+
end
117+
85118
sub do_setup()
86119
color 3, 0
87120
cls
@@ -177,13 +210,14 @@ end
177210

178211
sub main
179212
local basList, dirList, path
180-
local frm, bn_about, bn_online
213+
local frm, bn_about, bn_online, bn_new
181214
local do_intro
182215

183216
dim basList
184217
dim dirList
185218

186219
bn_setup = mk_menu("_setup", "Setup", -1)
220+
bn_new = mk_menu("_new", "New", -1)
187221
bn_about = mk_menu("_about", "About", -1)
188222
bn_online = mk_menu(onlineUrl, "Online", 0)
189223
bn_online.isExit = true
@@ -194,6 +228,7 @@ sub main
194228
if (osname != "SDL") then
195229
frm.inputs << bn_setup
196230
endif
231+
frm.inputs << bn_new
197232
frm.inputs << bn_about
198233

199234
if (welcome) then
@@ -202,7 +237,6 @@ sub main
202237

203238
listFiles frm, path, basList, dirList
204239
frm.color = 10
205-
frm.backgroundColor = 0
206240
rect 0, 0, xmax, lineSpacing COLOR 1 filled
207241
at 0, 0
208242
make_ui = form(frm)
@@ -249,6 +283,10 @@ sub main
249283
frm.close()
250284
do_setup()
251285
frm = make_ui(path, false)
286+
elif frm.value == "_new" then
287+
frm.close()
288+
do_newfile()
289+
frm = make_ui(path, false)
252290
elif frm.value == "_back" then
253291
frm.close()
254292
go_back

0 commit comments

Comments
 (0)