WxBasic
   HOME

TheInfoList



OR:

wxBasic is a
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
/
open-source software Open-source software (OSS) is Software, computer software that is released under a Open-source license, license in which the copyright holder grants users the rights to use, study, change, and Software distribution, distribute the software an ...
,
cross-platform Within computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several Computing platform, computing platforms. Some ...
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
. As it is based on syntax of the BASIC language, it is designed to be simple to learn and understand, and allow novice programmers to write applications for graphical environments like
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
and
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
with minimal effort. wxBasic is a
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normal ...
based language, like
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
or
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
. It is licensed under the
LGPL The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
, so
proprietary software Proprietary software is computer software, software that grants its creator, publisher, or other rightsholder or rightsholder partner a legal monopoly by modern copyright and intellectual property law to exclude the recipient from freely sharing t ...
's source code can be linked against it. It can create stand-alone
executable In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), in ...
s by binding together
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
with the
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
. In contrast with executables created by similar commercial programs like
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic (.NET), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic (classic), the original Visual Basic suppo ...
, executables produced by wxBasic do not require any external DLL file, resource file, or
installer Installation (or setup) of a computer program (including device drivers and plugins), is the act of making the program ready for execution. Installation refers to the particular configuration of software or hardware with a view to making it usabl ...
to run. The executable is distributed alone and can be run immediately by
end-user In product development, an end user (sometimes end-user) is a person who ultimately uses or is intended to ultimately use a product. The end user stands in contrast to users who support or maintain the product, such as sysops, system administrato ...
s. As with programs written in any
interpreted language In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An inter ...
, wxBasic programs may also be run straight from the source code on any platform, if wxBasic is present. wxBasic is written primarily in C, with some C++ linking it to the
wxWidgets wxWidgets (formerly wxWindows) is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with no s ...
library. wxWidgets supplies the cross-platform features. It runs on
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
using native controls, and on
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
and
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
using the
GTK+ GTK (formerly GIMP ToolKit and GTK+) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary s ...
library. wxBasic is also the basis for the
SdlBasic SdlBasic is a multiplatform interpreter for BASIC, using the SDL libraries. Its interpreter core is based on wxBasic. The interpreter can be very useful for people who are familiar with ANSI-BASIC interpreters and are curious or needing SDL libr ...
project.


Example

The following program implements a text viewer: ' from http://wxbasic.sourceforge.net/phpBB2/viewtopic.php?t=554 ' Simple Text Viewer written in wxBasic dim AppName = "Text Viewer" fileName = "" ' Main window dim frame = new wxFrame( Nothing, -1, AppName & " - Untitled Document" ) ' Text edit control dim control = new wxTextCtrl( frame, -1, "", wxPoint( 0, 0 ), wxSize( 100, 100 ), wxTE_MULTILINE , wxTE_READONLY , wxTE_RICH) ' Status bar - The one at the bottom of the window dim status = frame.CreateStatusBar( 1 ) frame.SetStatusText("Ready") ' ' Dialog used for Open dim fileDialog = new wxFileDialog( frame ) ' ' add menubar to the frame dim mBar = new wxMenuBar() frame.SetMenuBar(mBar) ' ' build the "File" dropdown menu dim mFile = new wxMenu() mBar.Append(mFile, "&File") ' make it ' mFile.Append( wxID_OPEN, "&Open...", "Loads an existing file from disk" ) ' mFile.AppendSeparator() mFile.Append( wxID_EXIT, "E&xit\tAlt-X", "Exit Application" ) Sub onFileOpen( event ) fileDialog.SetMessage("Open File") fileDialog.SetStyle( wxOPEN ) If fileDialog.ShowModal() = wxID_OK Then fileName = fileDialog.GetPath() Ext = fileDialog.GetFilename() control.Clear() control.LoadFile( fileName ) frame.SetTitle( AppName & " - " & fileName ) frame.SetStatusText(Ext) End If End Sub ' Connect( frame, wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, "onFileOpen" ) Sub onFileExit( event ) frame.Close(True) End Sub ' Connect( frame, wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, "onFileExit" ) ' build the "Help" dropdown menu dim mHelp = new wxMenu() mBar.Append(mHelp, "&Help") mHelp.Append( wxID_HELP, "&About\tF1", "About this program" ) ' Sub onHelpAbout( event ) Dim msg = "Text View allows any text file\n" & "to be viewed regardless of its extension.\n" & "If the file being opened isn't a text file\n" & "then it won't be displayed. There will be a\n" & "little garbage shown and that's all." wxMessageBox( msg, "About Text View", wxOK + wxICON_INFORMATION, frame ) End Sub Connect( frame, wxID_HELP, wxEVT_COMMAND_MENU_SELECTED, "onHelpAbout" ) frame.Show(True)


References


External links


WxBasic website
*
WxBasic ForumWxBasic tutorial
{{wxWidgets Free and open source interpreters Free computer libraries WxWidgets Software that uses wxWidgets Software using the GNU Lesser General Public License BASIC interpreters