WxBasic
   HOME

TheInfoList



OR:

wxBasic is a
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
/
open-source software Open-source software (OSS) is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code to anyone and for any purpose. Op ...
,
cross-platform In 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 platforms. Some cross-platform software r ...
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
interpreter. 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 group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
and
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
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 (norma ...
based language, like
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offici ...
or
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
. 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 software that is deemed within the free and open-source software to be non-free because its creator, publisher, or other rightsholder or rightsholder partner exercises a legal monopoly afforded by modern copyright and int ...
's source code can be linked against it. It can create stand-alone
executable In computing, 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), instructi ...
s by binding together
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the wo ...
with the interpreter. 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 (now simply referred to as "Visual Basic"), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic (cl ...
, executables produced by wxBasic do not require any external
DLL file Dynamic-link library (DLL) is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries usually have the file extension DLL, OCX (for libraries containing ActiveX controls), or ...
, resource file, or installer to run. The executable is distributed alone and can be run immediately by end-users. As with programs written in any interpreted language, 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 library. wxWidgets supplies the cross-platform features. It runs on
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
using native controls, and on
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
and
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
using the
GTK+ GTK (formerly GIMP ToolKit and GTK+) is a free and open-source 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 proprie ...
library. wxBasic is also the basis for the SdlBasic 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 Forum (link errado)WxBasic tutorial
{{wxWidgets Free compilers and interpreters Free computer libraries WxWidgets Software that uses wxWidgets Software using the LGPL license BASIC interpreters