WxBasic

Last updated
wxBasic
Developer(s) David Cuny
Initial release2002;22 years ago (2002)
Stable release
2.8.12.43 [1] / November 13, 2016;7 years ago (2016-11-13) [1]
Operating system Cross-platform
License GNU Lesser General Public License
Website wxbasic.net

wxBasic is a free software / open-source software, cross-platform BASIC 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 and Linux with minimal effort. wxBasic is a bytecode based language, like Perl or Java. It is licensed under the LGPL, so proprietary software's source code can be linked against it.

Contents

It can create stand-alone executables by binding together source code with the interpreter. In contrast with executables created by similar commercial programs like Visual Basic, executables produced by wxBasic do not require any external DLL file, 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 using native controls, and on Linux and macOS using the GTK+ library. [2] 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 wxBasicdimAppName="Text Viewer"fileName=""' Main windowdimframe=newwxFrame(Nothing,-1,AppName&" - Untitled Document")' Text edit controldimcontrol=newwxTextCtrl(frame,-1,"",wxPoint(0,0),wxSize(100,100),wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH)' Status bar - The one at the bottom of the windowdimstatus=frame.CreateStatusBar(1)frame.SetStatusText("Ready")'' Dialog used for OpendimfileDialog=newwxFileDialog(frame)'' add menubar to the framedimmBar=newwxMenuBar()frame.SetMenuBar(mBar)'' build the "File" dropdown menudimmFile=newwxMenu()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")SubonFileOpen(event)fileDialog.SetMessage("Open File")fileDialog.SetStyle(wxOPEN)IffileDialog.ShowModal()=wxID_OKThenfileName=fileDialog.GetPath()Ext=fileDialog.GetFilename()control.Clear()control.LoadFile(fileName)frame.SetTitle(AppName&" - "&fileName)frame.SetStatusText(Ext)EndIfEndSub'Connect(frame,wxID_OPEN,wxEVT_COMMAND_MENU_SELECTED,"onFileOpen")SubonFileExit(event)frame.Close(True)EndSub'Connect(frame,wxID_EXIT,wxEVT_COMMAND_MENU_SELECTED,"onFileExit")' build the "Help" dropdown menudimmHelp=newwxMenu()mBar.Append(mHelp,"&Help")mHelp.Append(wxID_HELP,"&About\tF1","About this program")'SubonHelpAbout(event)Dimmsg="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)EndSubConnect(frame,wxID_HELP,wxEVT_COMMAND_MENU_SELECTED,"onHelpAbout")frame.Show(True)

Related Research Articles

<span class="mw-page-title-main">PureBasic</span>

PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, and macOS. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source. The first public release of PureBasic for Windows was on 17 December 2000. It has been continually updated ever since.

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system automation tools. The term "AppleScript" may refer to the language itself, to an individual script written in the language, or, informally, to the macOS Open Scripting Architecture that underlies the language.

Object Linking and Embedding (OLE) is a proprietary technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control Extension (OCX), a way to develop and use custom user interface elements. On a technical level, an OLE object is any object that implements the IOleObject interface, possibly along with a wide range of other interfaces, depending on the object's needs.

<span class="mw-page-title-main">Visual IRC</span> Open source Internet Relay Chat client

Visual IRC (ViRC) is an open-source Internet Relay Chat client for the Windows operating system. Unlike many other IRC clients, nearly all of the functionality in ViRC is driven by the included IRC script, with the result that the program's behavior can be extended or changed without altering the source code.

<span class="mw-page-title-main">Menu (computing)</span> List of options or commands within a computer program

In user interface design, a menu is a list of options presented to the user.

<span class="mw-page-title-main">Graphical widget</span> Element of interaction in a graphical user interface

A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, Qt, GTK, and Cocoa, contain a collection of controls and the logic to render these.

<span class="mw-page-title-main">Fox toolkit</span>

The FOX toolkit is an open-source, cross-platform widget toolkit, i.e. a library of basic elements for building a graphical user interface (GUI). FOX stands for Free Objects for X.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

Microsoft WinHelp is a proprietary format for online help files that can be displayed by the Microsoft Help browser winhelp.exe or winhlp32.exe. The file format is based on Rich Text Format (RTF). It remained a popular Help platform from Windows 3.0 through Windows XP. WinHelp was removed in Windows Vista purportedly to discourage software developers from using the obsolete format and encourage use of newer help formats. Support for WinHelp files would eventually be removed entirely in Windows 10.

<span class="mw-page-title-main">Tkinter</span> Python binding to the Tk GUI toolkit

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.

The Windows shell is the graphical user interface for the Microsoft Windows operating system. Its readily identifiable elements consist of the desktop, the taskbar, the Start menu, the task switcher and the AutoPlay feature. On some versions of Windows, it also includes Flip 3D and the charms. In Windows 10, the Windows Shell Experience Host interface drives visuals like the Start Menu, Action Center, Taskbar, and Task View/Timeline. However, the Windows shell also implements a shell namespace that enables computer programs running on Windows to access the computer's resources via the hierarchy of shell objects. "Desktop" is the top object of the hierarchy; below it there are a number of files and folders stored on the disk, as well as a number of special folders whose contents are either virtual or dynamically created. Recycle Bin, Libraries, Control Panel, This PC and Network are examples of such shell objects.

<span class="mw-page-title-main">Task Manager (Windows)</span> Task manager application included with the Windows NT family of operating systems

Task Manager, previously known as Windows Task Manager, is a task manager, system monitor, and startup manager included with Microsoft Windows systems. It provides information about computer performance and running software, including names of running processes, CPU and GPU load, commit charge, I/O details, logged-in users, and Windows services. Task Manager can also be used to set process priorities, processor affinity, start and stop services, and forcibly terminate processes.

<span class="mw-page-title-main">Workbench (AmigaOS)</span> Graphical user interface for the Amiga computer

Workbench is the desktop environment and graphical file manager of AmigaOS developed by Commodore International for their Amiga line of computers. Workbench provides the user with a graphical interface to work with file systems and launch applications. It uses a workbench metaphor for representing file system organisation.

<span class="mw-page-title-main">Tk (software)</span> GUI toolkit or framework

Tk is a cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages. It is free and open-source software released under a BSD-style software license.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternative to the non-interactive interface available with punched cards.

Microsoft Office shared tools are software components that are included in all Microsoft Office products.

wxPHP is an extension the programming language PHP that wraps the wxWidgets library, which allows writing cross-platform software desktop applications that make use of the native graphical components available to the different platforms. It supports the three major operating systems: Windows, Linux, and macOS by using PHP. Applications are written in PHP, which is an interpreted language. Thus, it needs no intermediate compiling step to run an application, if the PHP interpreter has the extension available.

References

  1. 1 2 "News, November 2016". wxbasic.net. Retrieved 25 September 2017.
  2. "Download". wxbasic.net. Retrieved 25 September 2017.