Welcome to wxBasic
wxBasic is an Basic Interpreter that brings the easy to learn programming language Basic together with the power of the wide used wxWidget library.
wxBasic comes in two different version. The Console version (bvmc) allows to write simple Basic applications for Console mode and looks a lot like QBasic. The enhanced Windows version is linked to the powerful wxWidget library. Creating and calling the wxWidgets code closely parallels the wxWidgets C++ API.
It is possible to write applications very quickly and to create stand-alone executables.
At the moment we have three supported plattforms: Windows, MaxOSX and Linux. The Linux version is a little out dated.
News
A new version of wxBasic is available now. The new version is linked against
the wxWidget 2.8.10 library and support the most important classes. New
wxAuiToolbar classes is integrated.
Is was compiled with gcc and do not depend on any external runtimes or
libraries.
Now we started a MacOSX Version. You can use the dmg image and drag & drop wxBasic into your Program folder.
Samples
The best way to meet wxBasic is to look at some simple lines of code.
To write a simple "Hello, World" on the screen, this is enough:
wxMessageBox("Hello, World")
Minimal sample
Even a more or less complete Windows application with a
frame, menu items and a status bar is very simple and quick to write.
The "Minimal sample" is taken from the samples of wxWidgets translated to wxBasic.
The Source Code
' minimal wxBasic sample
' based on code by Julian Smart
option explicit
' create the main application window
dim frame as wxFrame = new wxFrame( Nothing, wxID_ANY, "Minimal wxBasic App" )
' create a "File" menu and append an item
dim mFile = new wxMenu()
mFile.Append( wxID_EXIT, "E&xit\tAlt-X", "Quit this program" )
' create an "About" menu and append an item
dim mHelp = new wxMenu()
mHelp.Append( wxID_ABOUT, "&About...\tCtrl-A", "Show about dialog" )
' now append the freshly created menu to the menu bar...
dim menuBar = new wxMenuBar()
menuBar.Append(mFile, "&File")
menuBar.Append(mHelp, "&Help")
' ... and attach this menu bar to the frame
frame.SetMenuBar(menuBar)
' create a status bar
frame.CreateStatusBar(2)
frame.SetStatusText("Welcome to wxBasic!")
' callback for the Quit menu option
function OnQuit( event ) handles frame.menuSelected(wxID_EXIT)
' TRUE is to force the frame to close
frame.Close(True)
end function
' callback for the About menu option
function OnAbout( event ) handles frame.menuSelected(wxID_ABOUT)
dim msg = "This is the \"About\" dialog of the Minimal sample.\n" &
"Welcome to wxBasic!"
wxMessageBox( msg, "About Minimal", wxOK + wxICON_INFORMATION, frame )
end function
' frames, unlike simple controls, are not shown when created
frame.Show(True)