Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

wxBasic

From Wikipedia, the free encyclopedia
Open-source BASIC interpretation software
icon
This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources.
Find sources: "WxBasic" – news ·newspapers ·books ·scholar ·JSTOR
(November 2014) (Learn how and when to remove this message)
wxBasic
DeveloperDavid Cuny
Initial release2002; 24 years ago (2002)
Stable release
3.2.2.51 / July 26, 2024; 18 months ago (2024-07-26)[1]
Operating systemCross-platform
LicenseGNU Lesser General Public License
Websitewxbasic.net

wxBasic is afree software /open-source software,cross-platformBASICinterpreter. 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 likeWindows andLinux with minimal effort. wxBasic is abytecode based language, likePerl orJava. It is licensed under theLGPL, soproprietary software's source code can be linked against it.

It can create stand-aloneexecutables by binding togethersource code with theinterpreter. In contrast with executables created by similar commercial programs likeVisual Basic, executables produced by wxBasic do not require any externalDLL file,resource file, orinstaller to run. The executable is distributed alone and can be run immediately byend-users. As with programs written in anyinterpreted language, wxBasic programs may also be run straight from the source code on any platform, if wxBasic is present.

wxBasic is written primarily inC, with someC++ linking it to thewxWidgets library. wxWidgets supplies the cross-platform features. It runs onMicrosoft Windows using native controls, and onLinux andmacOS using theGTK+ library.[2] wxBasic is also the basis for theSdlBasic project.

Example

[edit]

The following program implements a text viewer:

' from https://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)

References

[edit]
  1. ^"News, August 2024". wxbasic.net. Retrieved15 February 2026.
  2. ^"Download". wxbasic.net. Retrieved25 September 2017.

External links

[edit]
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
Technologies
RAD,GUI
builders
Free software
Proprietary software
Libraries
Bindings
Retrieved from "https://en.wikipedia.org/w/index.php?title=WxBasic&oldid=1338386350"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp