Skip to content

Conversation

chrisws
Copy link
Contributor

@chrisws chrisws commented Mar 15, 2015

Android:

  1. Now uses the Light Holo theme to display menus and messages.
  2. Fixed exit crash with android 5 devices.
  3. Updated to freetype version 2.5.5 and NDK version r10d

Desktop: new SDL2 port is completed

General:

  1. Improved graphics and runtime performance.

  2. Source code view displays line numbers

  3. Line drawing now uses antialiasing to produce smoother looking lines. You can turn this feature off by placing the following statement at the start of your program:

    Option Predef Antialias OFF

  4. Improved syntax error messages

  5. Updated the PAUSE statement to allow waiting until a system event has occurred. This allows you to pause execution until there is a touch or mouse event, without any CPU usage overhead. To use this feature, pass TRUE as the PAUSE argument, i.e. PAUSE TRUE.

  6. Improved INPUT widget including clipboard handling.

  7. Update INKEY to return ALT, CTRL, ALT+CTRL key information

  8. Added timer func support. When called as a function, the TIMER keyword accepts two arguments: a timeout value (in milliseconds) and the name of a call back FUNC. Note the timeout value only provides approximate millisecond precision.

Sub timer_func
print "Timer called: ", Timer
End

Timer(5000, timer_func)
Print "Starting..."

While 1
Pause 1
Print "paused..."
Wend

  1. Refactor FORM handling to use system object

REM create a form widget
input1.x = n
input1.y = n
input1.width = n
input1.height = n
input1.value
input1.label
input1.type - [label|link|listbox|choice|text|button|image
input1.name - file name for image button type
input1.backgroundColor
input1.color
input1.visible
input1.selectedIndex
input1.length
input1.noFocus
input1.onclick = func

REM creates a form object
f.input << input1
var f = form(f)

REM
f.value = "text"
f.focusColor = "green"

REM push messages through the system event queue
f.doEvents()

REM close the form
f.close()

Please refer to examples: memoryTest.bas, calc.bas, sokoban.bas

  1. Update IMAGE handling.

There are two supported image formats PNG and XPM. PNG images can to be
loaded using the OPEN command, or by passing the filename string as an argument
to the Image creator function. XPM images can also optionally be passed as a string
argument to the Image creator function.

REM Use the OPEN statement to open the image file
Open "1234.png" as #1

REM create an IMAGE object
i = Image(#1)

REM Display the image - passing optional x, y, zindex, opacity attributes
i.Show([x, y [, zindex [, opacity]]])

REM change the image attributes
i.x = 100
i.y = 10
i.offsetTop = 1
i.offsetLeft = 1
i.width = 100
i.height = 100
i.zindex = 0
i.opacity = 0

REM display the image with current attributes
i.Show()

REM hide the image
i.Hide()

... print the image details
PRINT i

REM create an XPM image
ar << "30 30 770 2"
ar << " c None"
ar << ". c #5B3015"
...
ar << ". + @ # $ @ % & * = - ; > , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 "
...
i2 = image(ar)
i2.x=15
i2.y=15
i2.zindex=1
i2.show()

  1. Added WINDOW system object to control the ansiwidget

REM create a window object
w = Window()

REM Create a status message
w.status("Hello")

REM draw into an inset screen
w = window()
w.insetTextScreen(5,10,90,90)
for i = 0 to 200
? "This is in the text screen"
next i

REM display in the text based screen
w.textScreen()
print "This is the text mode screen"

REM switch between graphics screens
w = window()
print "on screen1... pausing"
pause
w.graphicsScreen2()
print "on screen 2.... pausing..."
pause
w.graphicsScreen1()
print "back to 1"

REM display an alert
local wnd = window()
local msg = "You must restart SmallBASIC for this change to take effect"
wnd.alert(msg, "Restart required")

REM Display a menu
local w = window()
w.menu("one", "two", "three")

REM Display the keypad
local w = window()
w.showKeypad()

chrisws added a commit that referenced this pull request Mar 15, 2015
COMMON: Improved performance. Updated FORM, IMAGE, INKEY, TIMER commands
@chrisws chrisws merged commit da0df12 into smallbasic:master Mar 15, 2015
@chrisws chrisws deleted the 0_11_17a branch July 18, 2015 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant