Wxbasic
Wxbasic
David Cuny
A Word Of Thanks..
I'm not sure if there's a lot of demand for Yet Another Basic Interpreter, but here it is
anyway. A number of people are to thank (or reprimand) for this project getting this far.
First, thanks for Everett (Rett) Williams for encouraging me to port my Py programming
language to C. Somewhere along the line (much to his consternation) Py became
wxBasic. So go the best laid plans of mice and men.
This project would not have been possible without a number of fine groups and their free
software tools, including:
wxWindows for the great cross-platform wxWindows library. Hopefully wxBasic will
make the wxWindows library more accessible to people.
wxBasic owes much of it's small size to the UPX file compression program.
Thanks to Borland for their free C++ compiler. It works great with the wxWindows
library.
Thanks to Colin Laplace of Bloodshed Software for the Dev C++ IDE, and Mumit Kahn,
Jan Jaap van der Heidjen, Colin Hendrix and the other Gnu coders for the Mingw C++
compiler.
Thanks are also due to Jeffrey Kingston for the Basser Lout 2 typesetting program, which
this document was initially set in. Thanks to the Gnu and AFPL folk for the GhostScript
interpreter, and Russell Lang for GSView, the graphical GhostScript viewer which I used
to convert to document to PDF format.
I'm especially indebted to Brian Kernighan and Rob Pike for the books The Unix
Programming Environment and The Practice of Programming. The core of wxBasic
is built around the ideas they presented in these texts.
wxWindows: http://www.wxwindows.org
Borland Compiler: http://www.borland.com/bcppbuilder/freecompiler/
GNU Bison: http://www.gnu.org/software/bison/bison.html
UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
wxBasic At A Glance
wxBasic At A Glance
What is wxBasic?
wxBasic makes it easy for to write cross-platform applications. It combines the simplicity
of Basic with the rich toolkit of wxWindows.
Is wxBasic Free?
Yes. wxBasic is released under the LGPL (Lesser Gnu Public Licence ).
General Overview
Variables
By default, wxBasic will create a variable for you when it sees an assignment:
There are no types; all variables and arrays are variants. In general, wxBasic will attempt
to automatically cast a variable to the correct type. For example:
Scope Of Variables
When a variable is created, it is scoped to the current context. That is, it is visible to
anything in the current scope or greater. The widest scope is the module:
newVar = 12
Function myRoutine()
newVar = 12
End Function
Function myRoutine()
' This is declared at the routine level
Dim myVar = "routine variable"
Function myRoutine()
' use the module version of myVar
myVar = "new value"
End Function
If there is no routine or module version of the variable, one will be created in the current
scope.
Function myRoutine()
' create a variable scoped to the routine
myVar = "new value"
End Function
Variables scoped to routines are only visible within the routines that they are scoped to:
Function myRoutine()
myVar = 12
' myVar is visible here
End Function
wxBasic At A Glance
You can prevent wxBasic from creating variables with the Option Explicit statement.
With Option Explicit, you will need to declare your variables before use:
Option Explicit
Dim newVar = "create me"
If you use Option Explicit, your module level variables will be hidden from your routines
unless you specifically declare them visible with the Shared keyword:
Option Explicit
Dim myVar = "module variable"
Function myFunction()
Shared myVar
myVar = "new value"
End Function
Line Breaks
Each line can contain one or more statements. Statements can be split into multiple lines
following an operator. For example:
Arrays
Dim list[10,32]
Dynamic Arrays
In addition to the standard declared arrays, wxBasic supports dynamic arrays. If you
declare an array without listing the indexes:
Dim myArray[]
wxBasic At A Glance
wxBasic will treat it as a dynamic array. Dynamic arrays use strings as their indexes:
myArray[“cat”] = “Chester”
You can use numeric values for indexes, but they will be stored internally as strings. So
the following declarations are equivalent:
myArray[1,2,3] = 23
myArray[“1,2,3”] = 23
You can use the For Each construct to interate through dynamic arrays:
Block Structures
Functions
wxBasic borrows the return statement from C. In addition to the standard method of
returning values from functions:
Function add( a, b )
add = a + b
End Function
Function add( a, b )
Return a + b
End Function
Like C, wxBasic exits the function at the point the return statement is executed. Also like
C, you can choose to simply ignore the result of a function, and treat it like a Sub:
Len("123")
Pass By Reference
All types are passed by reference, which means changing a parameter passed to a routine
effects the value in the caller:
Function swap( a, b )
tmp = a
a = b
b = a
End Function
Any token starting with “wx” will be left alone, and any string that matches the name of a
For example:
would bind the file freecell.wx to the wxBasic binary file wxbasic.exe, creating the
wxBasic At A Glance
stand-alone binary file freecell.exe. You might want to bind your source file before
shrouding it.
Keep in mind:
This program creates a window of the class wxFrame, and then processes events until the
window is closed.
In addition to creating a wxFrame, this example also creates a wxButton called button.
A callback is an action associated with an event. Typically, the windows and controls in
the windows (often called widgets, for “window gadgets”_ are handled by the operating
system (in Windows) or a library (in Linux). A callback is the glue between the widgets
and the wxBasic application
When an event occurs in the system (such as a mouse click, window resize, and so on),
wxBasic looks to see if the application has registered a callback routine to be triggered. If
it has, wxBasic wraps that event into a wxEvent object, and then activates that callback.
wxBasic attempts to follow imitate the C++ interface with respect to wxWindows object.
wxWindows objects are created with the New keyword, which returns a handle to the new
wxBasic At A Glance
object:
Delete Frame
If an object is created without the New keyword, that object acts as if it were created “on
the stack”, and will be destroyed when the routine that created it exits. wxBasic will issue
an error if you do this to an object that inherit from wxWindow.
object.method()
For example:
frame.Show(True)
frame.SetSize( 10, 20 )
You are limited to a single level of nesting with this form. For example, you can't write
something along the lines of:
wxBasic Tutorial
wxBasic programs are written as plain text files. You can use any sort of editor, as long
as you save in plain text (. TXT) format. To run a program written in wxBasic, you only
have to have the wxBasic executable, wxbasic.exe (in Linux, wxbasic) in the current
directory, or somewhere in your path. If there are any includefiles, they must be in the
same directory as the source file.
If you use the Windows command line, you can simply type:
WXBASIC filename
or in Linux,
./wxbasic filename
where filename is the name of the file you want to run. For example, to run a program
called myprog.wx, you would write:
wxbasic myprog.wx
in Windows, or:
./wxbasic myprog.wx
in Linux.
There is no requirement that wxBasic programs end with .wx; any sort of extention
like.BAS, or even none at all, is fine.
You can also drag and drop wxBasic programs onto the wxbasic.exe interpreter.
wxBasic Tutorial
The simplest method is just to associate an extention, such as .wx or .bas with the
wxbasic.exe executable. Then you can just double-click files with that extention, and
Windows will automatically launch the wxBasic interpreter.
Installation
Bring up the text editor of your choice (for example, Notepad), and enter in the following:
Save the file as hello.wx into the wxBasic directory. If you are using Windows, be sure to
set the file type to All Files (*.*), or the editor will automatically give the file a .TXT
extention.
wxBasic Tutorial
To run the program, open the wxBasic directory and drag the file hello.wx onto the
wxBasic executable:
Bring up the text editor of your choice (for example, Notepad), and enter in the following:
Save the file as helloGui.wx into the wxBasic directory. If you are in Windows, be sure
to set the file type to All Files (*.*), or the editor will automatically give the file a .txt
extention.
wxBasic Tutorial
Drag and drop the helloGui.wx program onto the wxbasic.exe file, and the window will
appear:
What Next?
From this point, you should explore the demos that come with wxBasic. For full
documentation of the wxWindows library, download the help file at:
http://www.wxwindows.org
The wxBasic Language Reference
Keywords
Operators
Here are the operators that can be used to create expressions in wxBasic. They are listed
in order of operator precedence:
The wxBasic Language Reference
Assignment Operators
In addition to the standard assignment form:
variable = expression
wxBasic Syntax
= (Assignment)
lval = expression
'Numbers from 1 to 3
Dim a[3]
a[1] = "One"
a[2] = "Two"
a[3] = "Three"
class
object = class( arglist )
Create a wxWindows object on the stack. This is the same as creating it with New, but the
object will be destroyed when the routine it was created in is destroyed.
This form is typically used in a function call, where it is more convenient than creating a
variable to hold the result.
Always use New when creating controls and windows - never create them on the stack, or
your program will probably crash when the object is automatically destroyed.
The stack can only contain a limited number of objects. The current maximum is 1024. If
you are in a loop and might possibly create a large number of objects, you should probably
use New and explicitly Delete the objects after use.
In the following example, wxFrame and wxPoint are created "on the stack".
functionName
lval = functionName( arglist )
functionName( arglist )
functionName
'Calculate sin of .5
n = Sin(.5)
Abs
n2 = Abs(n1)
' n is 1
n = Abs( 1 )
ACos
n2 = ACos(n1)
Return an angle with cosine equal to n1. The argument must be in the range -1 to +1
inclusive.
' n is 3.141592654
n = ACos( -1 )
Argc
n2 = Argc()
Return the number of arguments passed to a routine. Used with routines that take variable
numbers of parameters. This can only be called within a Function or a Sub.
End Function
Argv
n2 = Argc(n1)
Return the value of parameter n1 passed to a routine. Used with routines that take
variable numbers of parameters.
Asc
n = Asc( string )
Return the ASCII code of the first character in string. Empty strings will return a value of
zero.
' set n to 65
n = Asc("A")
ASin
n2 = ACos(n1)
Return an angle with sine equal to n1. The argument must be in the range -1 to +1
inclusive. A value between -PI/2 and +PI/2 (radians) will be returned.
' n is -1.570796327
n = ASin( -1 )
ATan
n2 = ATan(n1)
Return an angle with sine equal to n1. A value between -PI/2 and PI/2 (radians) will be
returned.
' n is 0.785398
n = ATan( 1 )
The wxBasic Language Reference
Chr$
string = Chr$(n)
' s = "A"
s = Chr$(65)
Close
Close( file number )
Close
Common
Common name[]
Common name[ maxValue ] [[...]] [, ... ]
Common name[ minValue To maxValue ][[...]] [, ...]
Common name [ = expression ] [ , ... ]
Create a global array or variable named name. These are globally accessible, and do not
need to be declared as Shared when used in a Sub or Function.
Common can only be used outside of Sub and Function. Inside of Sub or Function, use
Dim. See Dim for further details.
Connect
Connect( control id, identifier, event type, function name )
Connect( control id, event type, function name )
Connects event type to callback function. The function function name must take a
The wxBasic Language Reference
single argument, the wxEvent. In the case menus and others where the control id is not
equal to the identifier, an identifer is required.
Const
Const name = expression [, ... ]
Creates constant \name with value of expression. Multiple constants can be declared on
one line. Constants are global, and do not have to be declared with a Shared statement.
Continue
Continue
Jump back to the top of the loop. This works only for For and While loops.
Cos
n2 = Cos(n1)
' n is 1
n = Cos( 0 )
Date$
string = Date$()
The wxBasic Language Reference
Returns date string in MM:DD:YYYY format. You can also use Date().
Declare
Declare Function functionName( arglist )
Declare Sub subName( arglist )
You still can't actually execute the routine until it is actually declared. If you need to
encounter problems with forward references that Declare won't fix, try adding Option
QBasic.
Option QBasic
Declare mySub()
Sub mySub()
Print "This is my sub"
End Sub
Delete
Delete object
Delete a wxWindows object. Only Delete objects that were created with New. Objects
created "on the stack" are automatically destroyed when the routine that created them
exits. Refer to class() for details.
Dim
Dim name[]
Dim name[ maxValue ] [[...]] [, ... ]
Dim name[ minValue To maxValue ][[...]] [, ...]
Dim name [ = expression ] [ , ... ]
The wxBasic Language Reference
Create an array or variable named name. Arrays can have up to 5 indexes, and are
initialized to zeros. Variables can optionally be assigned by Dim statements.
If no indexes are specified, a dynamic array will be created. This is an array that is similar
to those implemented in Awk. Indexes can be any value – numeric or strings – but they
will be stored internally as strings. For example:
a[1] = “one”
and
a[“1”] = “one”
are identical. You can have as many indexes as you wish, but the result is simply combined
into a single string. For example:
If you request an index from a dynamic array that has not been assigned, it will return an
empty string “”.
Dynamic arrays also differ from static arrays in that that elements can only be passed by
value, not by reference.
End
End
'Exit program
End
Erase
Erase array[]
Erase array[ ... ]
The wxBasic Language Reference
If no indexes are specified, erases all the array. For static arrays, this means resetting all
the values to zero. For dynamic arrays, this means deleting all the keys and and values. For
example:
' Initialize it
For i = 1 To 10
a[i] = i
End For
If indexes are given, only the specified index will be reset. For static arrays, this is the
same as setting the value to zero:
' Initialize it
For i = 1 To 10
a[i] = i
End For
On the other hand, if the array is dynamic, the key and value are actually removed, so the
array shrinks:
' Initialize it
For i = 1 To 10
a[i] = i
End For
Eof
n = Eof( file handle )
Fix
n2 = Fix( n1 )
' n is 3
n = Fix( 3.1415927 )
Floor
n2 = Floor( n1 )
' n is 3
n = Floor( 3.1415927 )
Iterate variable from start through finish, incrementing by increment. The commands are
executed each iteration through the loop.
Iterate through array, sequentially assigning the key from each array index to variable.
Frac
n2 = Frac( n1 )
' n is 0.1415927
n = Fix( 3.1415927 )
FreeFile
n = FreeFile()
[Exit Function]
[Return Function]
[functionName = expression]
End Function
The total number of arguments can be found by calling function Argc(), and the function
Argv() returns a particular argument passed to the caller.
Hex$
string = Hex$(n)
Returns the hexidecimal representation of the number n. Only the integer portion of the n
will be used.
' n is "c"
n = Hex$( 12 )
If...ElseIf...Else...End If
If test Then
commands
[ElseIf test Then
commands]
[Else
commands]
End If
Conditionally execute code. There can be any number of ElseIf clauses. ElseIf can also
be spelled ElsIf.
End If
In
expression In array[]
Returns True if expression is a key in the dynamic array array[]. Using a static array will
result in an error.
Include
Include filename
Insert filename into source code. This statement cannot be placed in a structure.
Indexes
count = Indexes( array[] )
Instr
n = Instr( substring, string )
' sets n to 2
n = Instr( "Basic", "wxBasic" )
The wxBasic Language Reference
Int
n2 = Int( n1 )
' set n to 12
n = Int( 12.44 )
LBound
n = LBound( array[], index )
LCase$
string2 = LCase$( string1 )
Left$
string2 = Left$( string1, n )
Len
Length
n = Len( string )
The wxBasic Language Reference
n = Length( string )
' n is set to 7
n = Len("wxBasic")
Line Input #
Line Input # file handle, string
Loc
position = Loc( file handle )
Returns position of the file being read. This only works if the file is opened in Input
mode. This is the same as Seek().
Lof
n = Lof( file handle )
Returns the length of the file. This only works if the file is opened in Input mode.
Log
n2 = Log( n1 )
LTrim$
string2 = LTrim( string1 )
Returns string1 with whitespace (spaces and tabs) removed from left side.
Mid$
string2 = Mid$( string1, start, length )
' s = "Ba"
s = Mid$("wxBasic", 3, 2 )
New
handle = New class( arglist )
Create a new instance of a wxWindows object belonging to class. Refer to the wxWindows
documentation for details of classes. Objects created with New should be destroyed with
the Delete statement.
Note that in the example, the wxPoint and wxSize objects are created "on the stack".
Refer to class() for details.
Open
Open filename For Input | Output | Append As #filenumber
Opens file filename for reading or writing. I nput opens a file for reading, Output opens a
file for writing, and Append opens an existing file for writing, appending the output.
For i = 1 to 10
Print #1, i
Next
Close #1
Option Explicit
Option Explicit
This should be placed as the first statement in your file. It effects all following statements.
Option NoConsole
Option NoConsole
Ordinarily, wxBasic will send output of the Print statement to an emulated console
window. Option NoConsole will prevent the console from appearing.
Option QBasic
Option QBasic
Ordinarily, wxBasic acts like C - each statement not in a Function or Sub is executed
when it is encountered.
Sub mySub()
Print "This is my sub"
End Sub
The wxBasic Language Reference
Sub mySub()
Print "This is my sub"
End Sub
Print
Print expression [,][;][ expression ]
Evaluate and print expressions, and send output to the console window. Expressions can
be seperated by a semicolon {;} or a comma {,}. A comma will place a tab between the
two expressions. Placing a semicolon at the very end will prevent a line return from being
printed.
Print #
Print # file handle, expression [,][;][ expression ]
Evaluate and print expressions to file number. This works the same as Print, but sends
the output to the requested file.
Randomize
Randomize( [n] )
Seeds pseudo-random number generator with n. If n is not given, it will use the current
time as the seed.
The wxBasic Language Reference
ReadByte
n = ReadByte( file handle )
Reverse$
string2 = Reverse$( string1 )
Right$
string2 = Right$( string1, n )
RInstr
n = RInstr( string, substring )
' set n to 3
n = RInstr( "wxBasic", "Basic" )
The wxBasic Language Reference
Rnd
n2 = Rnd( n1 )
Round
n2 = Round( n1 )
' Set n to 12
n = Round( 12.3 )
RTrim$
string2 = RTrim$( string1 )
Seek
position = Seek( file handle )
success = Seek( file handle, position )
Returns the current position in file handle. If the optional argument position is included,
moves to that position in the file, returning True if succeeding. See also Loc().
Case tests
commands
[Case tests
commands ]
[Case Else
commands]
End Select
Conditionally execute code, depending on if expression matches tests. Tests can be strung
together with commas, and the forms are:
lowValue To highValue
Is = expression
Is <> expression
Is > expression
Is < expression
Is <= expression
Is >= expression
Sgn
n2 = Sgn( n1 )
Shared
Shared variable [, variable...]
Sub incrementCounter()
' Make the counter shared
Shared counter
Shell
Shell( command string )
Sin( n )
n2 = Sin( n1 )
Space$
string2 = Space$( string1 )
Sqr
n2 = Sqr( n1 )
' Set n to 3
n = Sqr( 9 )
Str$
string = Str$( n )
String$
string = String$( count, char )
Returns string length count made up of char. char can also be a numeric ASCII code.
Tan
n2 = Tan( n1 )
Ticks
n = Ticks()
Returns number of ticks since beginning of program. Ticks are operating system
dependant.
Next
n = Ticks() - startTicks
Time$
string = Time$()
TypeOf$
string = TypeOf$( expression )
Returns name of datatype expression evaluates to. Types are “ number”, “string”,
“object” and “unknown”.
UBound
number = UBound( array[], index )
UCase$
string2 = UCase$( string1 )
Val
n = Val( string )
' Set n to 12
n = Val( "12" )
'Count from 1 to 10
i = 1
While i <= 10
Print i
i = i + 1
Wend
WriteByte
WriteByte( file handle, n )
Write byte n to current position in file handle. This is primarily used for writing binary
files, since strings can't contain ASCII 0.
The Lexer
The job of the lexer is to break strings of text into tokens, and feed them to the parser.
The lexer for wxBasic can be found in lexer.c.
Each token is tagged with an identifier telling what class it belongs to, as well as an
optional value.
Ignoring keywords and symbols, the following types of tokens are recognized by the lexer:
Float is a numeric value. All numbers scanned by the lexer are returned in
this format, even if they are integers.
Undefined is any token not falling into one of the prior categories.
Float, String and MethodName can all be identified by some characteristics (quotes,
digits, etc.). All other types are identified by looking them up in the Symbol table.
A token's value can be one of the following, except for node, which is used exclusively by
the parser.
%union {
int iValue; /* integer value */
Number fValue; /* float value */
char *strValue; /* string pointer */
Node *node; /* parse node */
Symbol *symbol; /* symbol */
}
The Parser
The parser attempts to match tokens against gramatical patterns. The parser is written in
Yacc1.
The grammar file for wxBasic can be found in wxbasic.y. This file is processed by Yacc
to create the parser, found in y_tab.c. The top level grammar for a wxBasic program is
recursively defined as:
program:
program statements
| /* nothing */
;
After wxBasic parses a block of statement, it evaluates it, and then frees the memory held
by the representation. The definition of statements is:
statements:
End If
1 YACC is an acronym for Yet Another Compiler Compiler, a popular tool for such tasks.
Strictly speaking, I used Bison, the free GNU clone of Yacc.
Overview of the Interpreter
| End For
| End Function
| End While
| End Select
| Next
| Wend
| sep statements
| statement statements
| /* nothing */
;
The '|' represents a logical "Or". Note that all the structure terminators are defined here.
This allows a structure to be defined as:
statement:
'~' expr '(' ')' sep
| '~' expr error
| '~' expr '(' error
| expr sep
| ConstantName Eq
| FunctionName '('
| FunctionName
etc...
For each grammatical pattern, there is a corresponding action to take when that grammar
is encountered. For example, here's the grammar for a number:
| Float
{ $$ = floatNode( OpFloat, $1, NULL, NULL ); }
The first line contains the grammar pattern, while the following lines contain the C code to
execute. The $1 refers to Float, the matched token.
In wxBasic, parse tree nodes have five elements: opcode, value, left node, right node
and trace. There is a next field defined, but it not currently being used.
right is the optional right branch of the node, pointing to another node.
If the branch is empty, it holds a NULL value.
trace points back to the source code
Readers paying attention at this point will notice that each node is simply a binary tree - a
node with two leaves. So the value
123
node->opcode = OpFloat;
node->value = 123;
node->left = NULL;
node->right = NULL;
(For the sake of space, fields that are not used will be ignored in the examples.)
Parse Trees
Expressions are essentially recursively defined. For example, here's the definition of
multiplication from the YACC file:
node->opcode = OpMul;
node->left = $1;
node->right = $4;
So writing:
12 * 42
left_node->opcode = OpFloat;
left_node->value = 12;
right_node->opcode = OpFloat;
right_node->value = 42;
parent_node->opcode = OpMul;
parent_node->left = left_node;
Overview of the Interpreter
node->right = right_node;
As wxBasic is parsed, a parse tree representing the code is created. It is the task of the
evaluator to execute that parse tree.
The Evaluator
In most languages, the parse tree structure merely serves as an intermediate structure
which is then converted into a more efficient form, such as bytecodes.
This is not the case with wxBasic. Rather than transforming the parse tree, it executes it
directly. This task is accomplished by the eval() routine. Basically, it's just a large switch
statement:
case OpAdd:
/* code for OpAdd */
break;
case OpAnd:
/* code for OpAnd */
break;
case OpArgList:
/* code for ArgList */
break;
etc...
wxBasic uses a stack to pass and store values. Here's a simplified version of the evaluator,
with only OpFloat and OpMul implemented:
switch( node->op ) {
case OpFloat:
pushNumber( node->value.fValue );
break;
case OpMul:
eval( node->left );
Overview of the Interpreter
eval( node->right );
n2 = popNumber();
n1 = popNumber();
pushNumber( n1 * n2 );
break;
}
}
12 * 42
encoded as:
left_node->opcode = OpFloat;
left_node->value = 12;
right_node->opcode = OpFloat;
right_node->value = 42;
parent_node->opcode = OpMul;
parent_node->left = left_node;
node->right = right_node;
The node passed for evaluation would be parent_node, the parent node. OpMul is
evaluated. The left hand node, left_node, is evaluated first:
eval( node->left );
This executes the OpFloat, which places the value 12 on the stack. Then right hand node
right_node is then executed, which places the value 42 on the stack.
eval( node->right );
The values are then popped off the stack and stored into local variables:
n2 = popNumber();
n1 = popNumber();
Finally, they are multiplied, and the result placed back on the stack for another operator to
process.
pushNumber( n1 * n2 );
Internal Values
Number, a C double.
String, a C char*.
Array, a pointer to a C *Array structure.
Variant, a pointer to a C *Variant structure.
The actual value is stored in the Value data structure, which is a union of the above
types. This value is placed into a Variant data structure. The possible types that a
Variant datatype can hold are:
Data is stored in wxBasic on a LIFO (Last In, First Out) stack. As items are placed on the
stack, it expands upwards, toward the top of stack:
Most operations (such as addition, subtraction, comparison, and the like) are performed
using data on the stack. For example:
123
123, 456
The addition operation would take the top items from the stack, and replace them with the
result:
579
Overview of the Interpreter
And finally, the Print statement would fetch the result from the stack for display.
Since the stack can hold Variant data, strings are the other literal values that it can hold:
In addition to holding literal values, values can be passed by reference on the stack. For
example, in the following code:
The call to grill() passes the value stored in the variable bar by reference. Instead of
placing the value of bar on the stack, the reference points back to the original value:
In the case where a reference points to a reference, each reference always points back to
the original reference. This avoids having to walk a chain of references in order to resolve
a value.
Code Blocks
a = 12
b = 33
c = a + b
command 1
command 2
command 3
n1->opcode = OpComma
n1->left = pointer to command 1
n1->right = n2
Overview of the Interpreter
n2->opcode = OpComma
n2->left = pointer to command 2
n2->right = n3
n3->opcode = OpComma
n3->left = pointer to command 3
n3->right = NULL
The implementation of OpComma in eval() uses a while statement to avoid the overhead
of recursion.
Complex Operations
Most operations are a bit more complex that the OpAdd operation, but just combinations
of data items glued together in linked list chains (via OpComma) or binary trees. For
example, here is a typical Print statement:
The left branch holds the file number to print to. NULL indicates the output will be
routed to the console. The right branch holds the printlist, which is a list of items to
print, along with their seperators.
Each element to be printed is stored in a node. The left branch of these nodes points to
the value to print. The value field of the node holds a flag indicating what type of
seperator to print after the value, PRINT, PRINT_TAB or PRINT_NEWLINE . The right
branch points to the next node in the list:
node->opcode = OpPrint
node->value = seperator flag
node-> = node containing value to print
node->right = node containing next item to print
The implementation in Yacc is straightforward. The constants are used to flag what type
of seperator to print after the data element is displayed:
Overview of the Interpreter
printlist:
';' printlist
{ $$ = $2 }
| ',' printlist
{ $$ = intNode( OpPrintValue, PRINT_TAB, NULL, $2 ); }
| expr
{ $$ = intNode( OpPrintValue, PRINT_NEWLINE, $1, NULL ); }
| /* nothing */
{ $$ = NULL; }
;
An If ... Then statement is similarly coded. The tests are chained together using
OpComma. The left leaf of the node contains the test, and the right node the action to
take if the test evaluates to true:
node->opcode = OpIf
node-> = node containing test
node->right = node containing action
Overview of the Modules
CORE.C
This is the toplevel program. The main code is placed in wxBasic, so it can optionally
compile it without wxWindows.
The code that tries to determine the current working directory isn't likely to be portable,
but it appears to work under Windows and Linux.
Also, this is where the application determines if the application is a bound executable. It
takes a look at the last 10 bytes, looking for a tag of the form:
//nnnnnnnn wxbind
where nnnnnnnn is the decimal offset into the file where the source file begins.
SHARED.H
Forward references of types, global variables. For example, NINDEX is the maximum
number of indexes an array can have.
ERROR.C
Rewrites of printf, malloc and free. There are two versions of the memory routines -
'safe' ones that check their values and abort on errors, and 'debugging' versions that check
to make sure the application isn't misusing memory.
The debugging routines basically keep a linked list of allocated memory chunks. Nothing
really fancy. #define __DEBUG__ in core.c to activate them. Debugging mode adds a
lot of overhead and slows down the program, so don't use it in production.
STACK.C
Integer LIFO stack routines, used by YACC to keep track of the control structure (For, If,
Case). So if you write something like:
Overview of the Modules
For i = 1 To 10
Wend
It's also used by YACC to track of the number of parameters passed to a routine. Some (but
not all) parameter counts are checked at compile time.
DATA.C
Number, a double.
String, a char*.
Array, a *Array.
Variant, a *Variant.
The data is stored in a Variant type, which is a union of the above types.
All data (except for arrays) is stored on the stack. Local variables are placed on the stack,
and grow upward. Global variables grow down. If the two collide, wxBasic will be forced
to shut down. It can't dynamically resize the stack because globals are stored at absolute
addresses. If I used negative values, I could fix that, but it would incur an overhead of
having to resolve offsets.
The variable localstart keeps track of where the current local data is. The layout is:
Data is retrieved from the stack via the routines popNumber() and popString(). These
routines automatically convert data to the expected types. So if a string was expected
but a number was on the top of stack, the number will be converted into a string.
SYMBOL.C
Symbols are stored in a linked list, accessed through the prior field. lastSymbol contains
the last symbol in the list. At some point, I'll probably change this to a hash table.
function foo( a, b )
c = 12
end function
would have:
foo->scope = NULL
a->scope = foo
b->scope = foo
c->scope = foo
Symbols with a NULL scope are global. Children are linked to their parents via a linked
list:
foo->child = a
a->sibling = b
b->sibling = c
c->sibling = NULL
VAR.C
This is where simple (non-array) variables are defined and accessed. All simple variables
are created on the stack. Constants are simply variables that cannot be altered. The
creation routines are:
The variables can be fetched and set via setVar() and getVar(). These routines resolve
references.
ARRAY.C
Arrays are basically just arrays of Variant data. Since arrays can be passed to routines,
they have to keep track of the number of indexes they have, as well as the upper and lower
bounds of each index. Range checking of arrays passes to routines is done at runtime.
Array indexes can be passed by reference, which leads to some of the most oblique code in
wxBasic.
You can't currently ReDim arrays, but I'll get around to fixing that. I'm a bit nervous that a
user will pass an array index, and then ReDim the array to a smaller size. Reference the
index, and *boom*. However, you can use Dynamic arrays safely, since they never return
values by reference.
NODE.C
These routines are used by YACC to build an internal represenation of the source code. This
is discussed elsewhere in the documentation, so I'll just mention that I've added (but not
implemented) a next field, which should make OpComma obsolete.
BUILTIN.C
The functions that are "built in". Numbers are passed to routines on the stack, in reverse
order. Here's a typical routine:
EVAL.C
These routines execute the internal representation of the code. The main routine is
eval(), which is a huge case statement. Not suprisingly, it's recursive.
case OpDiv:
eval( node->left );
eval( node->right );
n2 = popNumber();
n1 = popNumber();
At some point, I'll probably replace the switch case statement with a bunch of function
pointers.
LEXER.C
This implements yylex, which is the lexer used by YACC. Nothing much special here. I
could have used LEX to do the job, but I've heard that it's slow, and there are some ugly
hacks in my lexer.
Anything that starts with the character '.' is assumed to be a method name. Strings start
with a `"' character. Numbers start with a digit. Otherwise, the string is looked up in the
symbol table to be resolved.
CLASS.C
This implements the interface to C++ classes. There are four structures:
All objects are stored in the objectList array. This is currently an array with a fixed size,
so if too many objects are created, *boom*.
The routine popPointer() is used to retrieve an object pointer from the stack. Currently,
these are stored as DATA_NUMBER, but they should really be stored as DATA_OBJECT. The
popPointer() routine ensures that the pointer belongs to the expected class.
Class information is held in the fixed length classList array. Being fixed shouldn't be a
problem, since the number of wxWindows classes is known at compile time. Each
WrappedClass contains:
Each WrappedClass has a linked list of class methods, pointed to by the lastMethod field
in WrappedClass:
Because methods aren't resolved until runtime, the hash of the name is kept to make
searching the linked list faster. In theory I could use as hash table here, but I don't know
that it's any faster.
Objects that are not created by the New keyword are created `on the stack', so to speak.
This emulates the C++ behavior of being able to create an unassigned object which is
automatically destroyed when the routine exits. For example:
Overview of the Modules
creates a wxPoint object `on the stack'. The stack createStack is used to keep track of
these objects. When a routine is called, a zero is placed on the top of the createStack to
mark the start.
When an object is created `on the stack', it's index is placed on the createStack as well.
When the routine exits, it calls clearCreateStack(), which successively pops the
createStack and destroys all the objects on it until the terminating zero is reached.
CONNECT.CPP
This is the glue that connects wxWindows events to wxBasic. A pointer to a wxBasic
routine is attached to a wxWindows event via the ::Connect routine.
When an object receives an event, the routine runCallback() is activated. The event is
tagged with the appropriate class wrapper, the *Symbol pointing to the wxBasic callback
is retrieved, and the routine is executed.
Y_TAB.C
CONSOLE.CPP
This emulates a console, so the Print statement has something that can be printed to. The
printing code is implemented in the routine eConsole(), in error.c.
The console is simply a wxFrame with a wxTextCtrl in it. The only reason for defining a
class was to set up the callback to clear consoleExists when the console window is
closed.
When the console window is closed, it is destroyed. This allows wxBasic to fall out of the
main loop when the main window is closed. Otherwise, it would hang around as an
Overview of the Modules
It is possible to crash wxBasic by closing a window with an active timer, and leaving the
console window open. The application will remain running, and the timer will attempt to
run in the non-existant window.
The wxWindows Wrappers
The wrappers for wxBasic are automatically generated by a QBasic program called
wrap.bas. It's about 900 lines long - a lot of it is hacked together, and it should be
rewritten at some point. It's quite specialized, and only I'd be quite suprised if it worked
with anything other than wxWindows method prototypes.
I'm in rewriting the code in Awk, but it's on hold for the moment, as other things need to be
done first.
The Qbasic program wrap.bas reads the file text file class.i , which contains the
prototypes for the class methods. These prototypes were gathered by cutting and pasting
from the help files. If there's a better way to gather the information, I'd sure like to know
about it.
Design Decisions
Since the wrappers could accept a variable number of parameters, it seemed logical to
pass the parameters on a stack. The stack accepts only two datatypes: numbers and
strings. Values passed back from the wrappers are passed by value. This means that
methods that pass their values back through pointers in the parameter list will not wrap
well.
The routines for pushing and popping values on the stack are defined in data.c.
The parser for the wrappers takes the view that if it doesn't know what an object is, it
must be a pointer to some class. This isn't always the case: there are enums, typdefs and
structs that all look like classes. To distinguish these, the class.i file includes not only
classes, but enums, typedefs and structs. The basic file layout is:
enums
typedefs
structs
classes
Comments: //
// comment
The wxWindows Wrappers
The input file uses the C++ comment style '//', starting in the first column. For example:
// this is a comment
%{
%{
This causes all C code between the %{ and %} line to be written verbatim to the wrapper
file.
%include
%include filename
The %include statement causes the include statement to be added to the wrapper code. If
the filename is included more than one time, repeated instances are ignored.
For example:
%include "wx/calctrl.h"
%enum
%enum enum
This is used to prevent enums from being treated as classes. For example:
%enum wxSocketNotify
%typedef
%typedef name alias
%struct
%struct name
%struct wxResourceTable
%class
%class [%alias alias] name [,superclass]
where the superclass is optional. Currently, the superclass must be declared before the
subclass. For example:
%class wxPoint
void <class>_del()
{
delete (<class> *)me;
}
void wxPoint_del()
{
delete (wxPoint *)me;
}
This is the behavior assigned to the classes' Delete method. The destructor is assumed to
take no arguments, and return no values. The method is linked in with the addMethod()
routine, which takes the class index, method name, function name, minimum number of
args, and maximum number of args:
A dummy class is one that is declared so that the wrapper generator recognizes the name
The wxWindows Wrappers
as a pointer, but the actual class is never wrapped. The format is:
For example:
%class wxAcceleratorTable
%ctor
%ctor class alternateName( arglist )
Some classes have more than one constructor. Because wxBasic will coerce data to the
expected type, it can only have a single default constructor.
In order to accomodate additional constructors, the %ctor flag is used. This creates a
class that inherits the current class, and uses the alternate constructor.
For example, wxPen has several constructors. To accomodate them, they are given
seperate names, and prefixed with %ctor:
wxPen()
...
// alternate constructors
%ctor wxPenFromColour(const wxColour& colour, ... )
%ctor wxPenFromColor(const wxColour& colour, ... )
%ctor wxPenFromColourName(const wxString& colourName, ... )
%ctor wxPenFromColorName(const wxString& colourName, ... )
%ctor wxPenFromBitmap(const wxBitmap& stipple, ... )
%ctor wxPenCopy(const wxPen& pen)
%builtin
%builtin type functionName( arglist )
The %builtin declaration allows wrappers to be created for methods that don't belong to
a particular class. This declaration is done a single time, followed by all the methods that
have no class.
For example (the ... here is for brevity, and is not part of the syntax):
creates a wrapper for the wxMessageBox that can be called as it were a native wxBasic
function.
In addition to creating the standard wrapper, it creates a dictionary entry using the
addBuiltin() routine:
Simple Classes
There are a number of 'simple' classes that don't inherit from wxObject. These can safely
be created on the stack. wxPoint is a typical declaration:
%class wxPoint
wxPoint(int x, int y)
~wxPoint()
int x
int y
Currently, attributes (like wxPoint's x and y) are not supported, and are ignored.
Class Constructors
class ( arglist )
For example:
wxPoint(int x, int y)
The name of the class must match the name of the most recently declared class. There can
only be one constructor for each class. This is the method that is assigned to New.
The constructor is assumed to always return a wrapped pointer of the created classes'
object.
// wxPoint(int x, int y)
void wxPoint_new()
{
wxPoint *returns;
// pop int y
int y = (int)popNumber();
// pop int x
The wxWindows Wrappers
int x = (int)popNumber();
// call wxPoint
returns = new wxPoint(x, y);
The variable argCount contains the number of arguments that are passed. The routine
assumes that the argument count is correct (the acceptable range is stored by addMethod).
The routines popNumber() and popString() don't do type checking, since they
automatically coerce their arguments to the right type. They are then cast to the proper
types. For example:
and:
popPointer() does check to make sure the pointer belongs to the proper class, and will
generate an error if the class is wrong:
If there routine accepts a variable number of args, the code will pop the proper number
from the stack, or assign the default value:
Class Destructors
~<class> ()
For example:
~wxObject()
void class_dtor()
{
((class *)me)->~class();
pushNumber( (Number)0 );
The wxWindows Wrappers
For example:
void wxPoint_dtor()
{
// call ~wxPoint
((wxPoint *)me)->~wxPoint();
// result is ignored
pushNumber( (Number)0 );
}
Class Methods
All the statements following a %class statement not comments or starting with '%' are
assumed to be method prototypes for that class. For example:
%class wxSize
...
GetWidth()
void wxSize_GetWidth()
{
int returns;
returns = ((wxSize *)me)->GetWidth();
pushNumber( (Number)returns);
}
All method wrappers are void - parameters are passed through a stack. Values are pushed
onto the stack with pushNumber() and pushString(), and popped off with
popNumber(), popString() and popPointer(). For example:
popNumber() and popString() will attempt to coerce the value on the stack to the
proper datatype. However, popPointer() requires a number, and checks to make sure
that the class belongs to, or is derived from the specified class.
The wxWindows Wrappers
All methods return a value on the stack. Void methods push a zero on the stack, which is
typically discarded by the caller:
// result is ignored
pushNumber( (Number)0 );
class index
method name (in lower case)
routine name
minimum number of args
maximum number of args
virtual
static
const
The keyword const in the function return type causes the variable returns to be declared
as as:
instead of:
type returns;
signed/unsigned
The wxWindows Wrappers
* (pointer)
foo **bar()
foo **returns;
& (deref)
The & causes returns to be declared as a pointer and prefixes the return value with a
dereference operator. For example:
%class myClass
foo &bar()
{
return grill();
}
void myClass_bar()
{
foo *returns;
returns = &grill();
pushNumber( addObject( _foo, (int)returns ) );
}
Optional Args
An = in the arg will cause the argument to be read as optional, with the value following
the = as the value to assign. The variable argCount holds the number of values on the
stack, and controls what objects are popped off. For example:
const
The const declaration will cause the parameter to be declared as a const. For example:
The exception to the rules are arrays and wxString. They both ignore the const
declaration. For example:
wxWindows DataTypes
Any datatype that starts with "wx" is assumed to be a wxWindows datatype. Non-native
datatypes will not check the pointer type returned by popPointer. For example:
double *y
wxWindow* window
Dereferencing
Datatypes preceeded by the dereference operator & will have it removed, and take the
general form:
For example:
Non-native datatypes will not have their type checked by popPointer(). The main reason
for having to declare structs is to prevent popPointer() from flagging these as errors.
Pointers
Datatypes preceeded by the pointer operator(s) * will have them removed and take the
general form:
The code can only handle two levels of indirection. For example:
wxWindow* window
For example:
Arrays
Arrays are not currently supported. They will basically create a dummy placeholder of the
form:
popNumber();
type name[1];
For example:
popNumber();
wxPoint points[1];
The actual call to the method is fairly simple, once the proper casts have been set up.
Parameters are pushed onto the stack in reverse order (the last argument is on the top of
the stack). The variable me holds the pointer to the object, so the call is basically:
The wxWindows Wrappers
For example:
wxBrush& GetBackground()
void wxDC_GetBackground()
{
wxBrush *returns;
returns = &((wxDC *)me)->GetBackground();
pushNumber( addObject( _wxBrush, (int)returns ) );
}
wxWindows Methods
wxWindows Methods
This is an autogenerated list of classes and methods that are implemented with wxBasic.
For details on the behavior of these methods, please refer to the wxWindows
documentation.
Because wxBasic is loose with it's typecasting (converting numbers and strings to the
propert types on demand), it can't determine which constructor to select if more than one
option is available. Alternate constructors solve this problem.
wxHandleFatalExceptions(doIt)
wxIsBusy()
wxMessageBox(message, caption, style, parent, x, y)
wxNewId()
wxNow()
wxPostEvent(dest, event)
wxRegisterId(id)
wxSafeYield(win)
wxShell(command)
wxSleep(secs)
wxTrap()
wxUsleep(milliseconds)
wxWakeUpIdle()
wxYield()
wxActivateEvent
GetActive()
wxActivateEvent(eventType, active, id)
wxApp
CreateLogTarget()
Dispatch()
ExitMainLoop()
GetAppName()
GetClassName()
GetStdIcon(which)
GetTopWindow()
GetUseBestVisual()
GetVendorName()
Initialized()
MainLoop()
Pending()
SendIdleEvents()
SetAppName(name)
SetClassName(name)
SetExitOnFrameDelete(flag)
SetTopWindow(window)
SetUseBestVisual(flag)
SetVendorName(name)
wxBitmap
Create(width, height, depth)
GetDepth()
wxWindows Methods
GetHeight()
GetMask()
GetPalette()
GetSubBitmap())
GetWidth()
LoadFile(name, type)
Ok()
SaveFile(name, type, palette)
SetDepth(depth)
SetHeight(height)
SetMask(mask)
SetWidth(width)
wxBitmapCopy(bitmap) (alternate constructor)
wxEmptyBitmap(width, height, depth) (alternate constructor)
~wxBitmap()
wxBitmapButton
Create(parent, id, bitmap, pos, size, style, validator, name)
GetBitmapDisabled()
GetBitmapFocus()
GetBitmapLabel()
GetBitmapSelected()
SetBitmapDisabled(bitmap)
SetBitmapFocus(bitmap)
SetBitmapLabel(bitmap)
SetBitmapSelected(bitmap)
wxBitmapButton(parent, id, bitmap, pos, size, style, validator, name)
~wxBitmapButton()
wxBoxSizer
CalcMin()
GetOrientation()
RecalcSizes()
wxBoxSizer(orient)
wxBrush
Copy(brush) (alternate constructor)
GetColour() (alias GetColor)
GetStipple()
GetStyle()
Ok()
SetColour(colour) (alias SetColor)
SetColour(colourName)
wxWindows Methods
wxBrushList
FindOrCreateBrush(colour, style)
wxBrushList()
wxButton
Create(parent, id, label, pos, size, style, validator, name)
GetDefaultSize()
GetLabel()
SetDefault()
SetLabel(label)
wxButton(parent, id, label, pos, size, style, validator, name)
~wxButton()
wxCalculateLayoutEvent
GetFlags()
GetRect()
SetFlags(flags)
SetRect(rect)
wxCalculateLayoutEvent(id)
wxCalendarCtrl
Create(parent, id, date, pos, size, style, name)
EnableHolidayDisplay(display)
EnableMonthChange(enable)
EnableYearChange(enable)
GetAttr(day)
GetHeaderColourBg() (alias GetHeaderColorBg)
GetHeaderColourFg() (alias GetHeaderColorFg)
GetHighlightColourBg() (alias GetHighlightColorBg)
GetHighlightColourFg() (alias GetHighlightColorFg)
GetHolidayColourBg() (alias GetHolidayColorBg)
GetHolidayColourFg() (alias GetHolidayColorFg)
ResetAttr(day)
SetAttr(day, attr)
wxWindows Methods
SetDate(date)
SetHeaderColours(colFg, colBg) (alias SetHeaderColors)
SetHighlightColours(colFg, colBg) (alias SetHighlightColors)
SetHoliday(day)
SetHolidayColours(colFg, colBg) (alias SetHolidayColors)
wxCalendarCtrl(parent, id, date, pos, size, style, name)
~wxCalendarCtrl()
wxCalendarEvent
GetDate()
GetWeekDay()
wxCalendarEvent(cal, type)
wxCheckBox
Create(parent, id, label, pos, size, style, val, name)
GetValue()
SetValue(state)
wxCheckBox(parent, id, label, pos, size, style, val, name)
~wxCheckBox()
wxCheckListBox
Check(item, check)
IsChecked(item)
wxCheckListBox(parent, id, pos, size, n, choices[], style, validator, name)
~wxCheckListBox()
wxChoice
Append(item)
Clear()
Create(parent, id, pos, size, n, choices[], style, validator, name)
FindString(string)
GetClientData(n)
GetColumns()
GetSelection()
GetString(n)
GetStringSelection()
Number()
SetClientData(n, data)
SetColumns(n)
SetSelection(n)
SetStringSelection(string)
wxChoice(parent, id, pos, size, n, choices[], style, validator, name)
~wxChoice()
wxWindows Methods
wxClientDC
wxClientDC(window)
wxCloseEvent
CanVeto()
GetLoggingOff()
SetCanVeto(canVeto)
SetLoggingOff(loggingOff)
Veto(veto)
wxCloseEvent(commandEventType, id)
wxColourDialog
Create(parent, data)
GetColourData() (alias GetColorData)
ShowModal()
wxColourDialog(parent, data) (alias wxColorDialog)
~wxColourDialog()
wxComboBox
Append(item)
Clear()
Copy()
Create(parent, id, value, pos, size, n, choices[], style, validator, name)
Cut()
Delete(n)
FindString(string)
GetClientData(n)
GetInsertionPoint()
GetLastPosition()
GetSelection()
GetString(n)
GetStringSelection()
GetValue()
Number()
Paste()
Remove(from, to)
Replace(from, to, text)
SetClientData(n, data)
SetInsertionPoint(pos)
SetInsertionPointEnd()
SetMark(from, to)
SetSelection(n)
SetValue(text)
wxWindows Methods
wxCommandEvent
GetClientData()
GetExtraLong()
GetInt()
GetSelection()
GetString()
IsChecked()
IsSelection()
SetClientData(clientData)
SetExtraLong(extraLong)
SetInt(intCommand)
SetString(string)
wxCommandEvent(commandEventType, id)
wxControl
Command(event)
GetLabel()
SetLabel(label)
wxDC
BeginDrawing()
Blit(xdest, ydest, width, height, source, xsrc, ysrc, logicalFunc, useMask)
CalcBoundingBox(x, y)
Clear()
CrossHair(x, y)
DestroyClippingRegion()
DeviceToLogicalX(x)
DeviceToLogicalXRel(x)
DeviceToLogicalY(y)
DeviceToLogicalYRel(y)
DrawArc(x1, y1, x2, y2, xc, yc)
DrawBitmap(bitmap, x, y, transparent)
DrawCheckMark(x, y, width, height)
DrawCheckMarkRect(rect)
DrawEllipse(x, y, width, height)
DrawEllipticArc(x, y, width, height, start, end)
DrawIcon(icon, x, y)
DrawLine(x1, y1, x2, y2)
DrawLines(n, points[], xoffset, yoffset)
wxWindows Methods
SetFont(font)
SetOptimization(optimize)
SetPalette(palette)
SetPen(pen)
SetTextBackground(colour)
SetTextForeground(colour)
SetUserScale(xScale, yScale)
StartDoc(message)
StartPage()
wxDC_GetSizeX()
wxDC_GetSizeY()
~wxDC()
wxDialog
Centre(direction)
Create(parent, id, title, pos, size, style, name)
EndModal(retCode)
GetReturnCode()
GetTitle()
Iconize(iconize)
IsIconized()
IsModal()
SetModal(flag)
SetReturnCode(retCode)
SetTitle(title)
Show(show)
ShowModal()
wxDialog(parent, id, title, pos, size, style, name)
~wxDialog()
wxDialUpEvent
IsConnectedEvent()
IsOwnEvent()
wxDialUpEvent(isConnected, isOwnEvent)
wxDirDialog
GetMessage()
GetPath()
GetStyle()
SetMessage(message)
SetPath(path)
SetStyle(style)
ShowModal()
wxWindows Methods
wxDropFilesEvent
GetFiles()
GetNumberOfFiles()
GetPosition()
wxEraseEvent
GetDC()
wxEraseEvent(id, dc)
wxEvent
GetEventObject()
GetEventType()
GetId()
GetSkipped()
GetTimestamp()
SetEventObject(object)
SetEventType(typ)
SetId(id)
SetTimestamp(timeStamp)
Skip(skip)
wxEvent(id)
wxEvtHandler
wxEvtHandler()
~wxEvtHandler()
wxFileDialog
GetDirectory()
GetFilename()
GetFilterIndex()
GetMessage()
GetPath()
GetStyle()
GetWildcard()
SetDirectory(directory)
SetFilename(setfilename)
SetMessage(message)
SetPath(path)
SetStyle(style)
wxWindows Methods
SetWildcard(wildCard)
ShowModal()
wxFileDialog(parent, message, defaultDir, defaultFile, wildcard, style, pos)
~wxFileDialog()
wxFlexGridSizer
wxFlexGridSizer(rows, cols, vgap, hgap)
wxFocusEvent
wxFocusEvent(eventType, id)
wxFont
GetDefaultEncoding()
GetFaceName()
GetFamily()
GetPointSize()
GetStyle()
GetUnderlined()
GetWeight()
SetDefaultEncoding(encoding)
SetFaceName(faceName)
SetFamily(family)
SetPointSize(pointSize)
SetStyle(style)
SetUnderlined(underlined)
SetWeight(weight)
wxFont(pointSize, family, style, weight, underline, faceName, encoding)
~wxFont()
wxFontDialog
GetFontData()
ShowModal()
wxFontDialog(parent, data)
~wxFontDialog()
wxFrame
Centre(direction)
Command(id)
Create(parent, id, title, pos, size, style, name)
CreateStatusBar(number, style, id, name)
CreateToolBar(style, id, name)
GetClientAreaOrigin()
wxWindows Methods
GetMenuBar()
GetStatusBar()
GetTitle()
GetToolBar()
Iconize(iconize)
IsIconized()
IsMaximized()
Maximize(maximize)
SetIcon(icon)
SetMenuBar(menuBar)
SetStatusBar(statusBar)
SetStatusText(text, number)
SetStatusWidths(n, widths)
SetTitle(title)
SetToolBar(toolBar)
wxFrame(parent, id, title, pos, size, style, name)
~wxFrame()
wxGauge
Create(parent, id, range, pos, size, style, validator, name)
GetBezelFace()
GetRange()
GetShadowWidth()
GetValue()
SetBezelFace(width)
SetRange(range)
SetShadowWidth(width)
SetValue(pos)
wxGauge(parent, id, range, pos, size, style, validator, name)
~wxGauge()
wxGDIObject
wxGDIObject()
wxGrid
AppendCols(numCols, updateLabels)
AppendRows(numRows, updateLabels)
AutoSize()
AutoSizeColumn(col, setAsMin)
AutoSizeColumns(setAsMin)
AutoSizeRow(row, setAsMin)
AutoSizeRows(setAsMin)
BeginBatch()
wxWindows Methods
BlockToDeviceRect(topLeft, bottomRight)
CalcCellsExposed(reg)
CalcColLabelsExposed(reg)
CalcRowLabelsExposed(reg)
CanDragColSize()
CanDragGridSize()
CanDragRowSize()
CanEnableCellControl()
CellToRect(coords)
CellToRect(row, col)
ClearGrid()
ClearSelection()
CreateGrid(numRows, numCols, selmode)
DeleteCols(pos, numCols, updateLabels)
DeleteRows(pos, numRows, updateLabels)
DisableCellEditControl()
DisableDragColSize()
DisableDragGridSize()
DisableDragRowSize()
DrawTextRectangle(dc, wxString, wxRect, hAlign, vAlign )
EnableCellEditControl(enable)
EnableDragColSize(enable)
EnableDragGridSize(enable)
EnableDragRowSize(enable)
EnableEditing(edit)
EnableGridLines(enable)
EndBatch()
GetBatchCount()
GetCellAlignment(row, col, horiz, vert)
GetCellBackgroundColour(row, col)
GetCellFont(row, col)
GetCellHighlightColour()
GetCellTextColour(row, col)
GetCellTextFont()
GetCellValue(coords)
GetCellValue(row, col)
GetColLabelAlignment(horiz, vert)
GetColLabelSize()
GetColLabelValue(col)
GetCols()
GetColSize(col)
GetColumnWidth(col)
GetCursorColumn()
GetCursorRow()
GetDefaultCellAlignment(horiz, vert)
wxWindows Methods
GetDefaultCellBackgroundColour()
GetDefaultCellFont()
GetDefaultCellTextColour()
GetDefaultColLabelSize()
GetDefaultColSize()
GetDefaultRowLabelSize()
GetDefaultRowSize()
GetDividerPen()
GetEditable()
GetEditInPlace()
GetGridCursorCol()
GetGridCursorRow()
GetGridLineColour()
GetLabelBackgroundColour()
GetLabelFont()
GetLabelSize(orientation)
GetLabelTextColour()
GetLabelValue(orientation, pos)
GetNumberCols()
GetNumberRows()
GetRowLabelAlignment(horiz, vert)
GetRowLabelSize()
GetRowLabelValue(row)
GetRows()
GetRowSize(row)
GetScrollPosX()
GetScrollPosY()
GetSelectionBackground()
GetSelectionForeground()
GetTable()
GetTextBoxSize(dc, lines, width, height)
GetViewHeight()
GetViewWidth()
GridLinesEnabled()
HideCellEditControl()
InsertCols(pos, numCols, updateLabels)
InsertRows(pos, numRows, updateLabels)
IsCellEditControlEnabled()
IsCellEditControlShown()
IsCurrentCellReadOnly()
IsEditable()
IsInSelection(coords)
IsInSelection(row, col)
IsReadOnly(row, col)
IsSelection()
wxWindows Methods
IsVisible(coords, wholeCellVisible)
IsVisible(row, col, wholeCellVisible)
MakeCellVisible(coords)
MakeCellVisible(row, col)
MoveCursorDown(expandSelection)
MoveCursorDownBlock(expandSelection)
MoveCursorLeft(expandSelection)
MoveCursorLeftBlock(expandSelection)
MoveCursorRight(expandSelection)
MoveCursorRightBlock(expandSelection)
MoveCursorUp(expandSelection)
MoveCursorUpBlock(expandSelection)
MovePageDown()
MovePageUp()
SaveEditControlValue()
SelectAll()
SelectBlock(topLeft, bottomRight)
SelectBlock(topLeft, bottomRight, addToSelected)
SelectBlock(topRow, leftCol, bottomRow, rightCol)
SelectBlock(topRow, leftCol, bottomRow, rightCol, addToSelected)
SelectCol(col, addToSelected)
SelectRow(row, addToSelected)
SetCellAlignment(align, row, col)
SetCellAlignment(row, col, horiz, vert)
SetCellBackgroundColour(col)
SetCellBackgroundColour(colour, row, col)
SetCellBackgroundColour(row, col, ))
SetCellFont(row, col, ))
SetCellHighlightColour())
SetCellTextColour(col)
SetCellTextColour(row, col, ))
SetCellTextColour(val, row, col)
SetCellTextFont(fnt)
SetCellTextFont(fnt, row, col)
SetCellValue(coords, s)
SetCellValue(row, col, s)
SetCellValue(val, row, col)
SetColAttr(col, attr)
SetColFormatBool(col)
SetColFormatCustom(col, typeName)
SetColFormatFloat(col, width, precision)
SetColFormatNumber(col)
SetColLabelAlignment(horiz, vert)
SetColLabelSize(height)
SetColLabelValue(col, ))
wxWindows Methods
SetColMinimalWidth(col, width)
SetColSize(col, width)
SetColumnWidth(col, width)
SetDefaultCellAlignment(horiz, vert)
SetDefaultCellBackgroundColour())
SetDefaultCellFont())
SetDefaultCellTextColour())
SetDefaultColSize(width, resizeExistingCols)
SetDefaultRowSize(height, resizeExistingRows)
SetEditable(edit)
SetGridCursor(row, col)
SetGridLineColour())
SetLabelAlignment(orientation, align)
SetLabelBackgroundColour())
SetLabelFont())
SetLabelSize(orientation, sz)
SetLabelTextColour())
SetLabelValue(orientation, val, pos)
SetMargins(extraWidth, extraHeight)
SetReadOnly(row, col, isReadOnly)
SetRowAttr(row, attr)
SetRowHeight(row, height)
SetRowLabelAlignment(horiz, vert)
SetRowLabelSize(width)
SetRowLabelValue(row, ))
SetRowMinimalHeight(row, width)
SetRowSize(row, height)
SetSelectionBackground(c)
SetSelectionForeground(c)
SetSelectionMode(selmode)
SetTable(table, takeOwnership, selmode)
ShowCellEditControl()
StringToLines(value, lines)
UpdateDimensions()
wxGrid(parent, id, pos, size, style, name)
XToCol(x)
XToEdgeOfCol(x)
XYToCell(x, y, ))
YToEdgeOfRow(y)
YToRow(y)
~wxGrid()
wxGridSizer
wxGridSizer(cols, rows, vgap, hgap)
wxWindows Methods
wxIdleEvent
MoreRequested()
RequestMore(needMore)
wxIdleEvent()
wxImage
AddHandler(handler)
CleanUpHandlers()
ConvertToBitmap()
Copy()
GetBlue(x, y)
GetData()
GetGreen(x, y)
GetHandlers()
GetHeight()
GetMaskBlue()
GetMaskGreen()
GetMaskRed()
GetPalette()
GetRed(x, y)
GetSubImage(rect)
GetWidth()
HasMask()
InitStandardHandlers()
InsertHandler(handler)
LoadFile(name, type)
LoadMimeFile(name, mimetype)
Mirror(horizontally)
Ok()
RemoveHandler(name)
Replace(r1, g1, b1, r2, g2, b2)
Rotate(angle, rotationCentre, interpolating, offsetAfterRotation)
Rotate90(clockwise)
SaveFile(name, type)
SaveMimeFile(name, mimetype)
Scale(width, height)
SetData())
SetMask(hasMask)
SetMaskColour(red, blue, green)
SetPalette(palette)
SetRGB(x, y, red, green, blue)
wxEmptyImage(width, height) (alternate constructor)
wxImage(image)
wxImageFromBitmap(bitmap) (alternate constructor)
wxWindows Methods
wxIndividualLayoutConstraint
Above(otherWin, margin)
Absolute(value)
AsIs()
Below(otherWin, margin)
LeftOf(otherWin, margin)
PercentOf(otherWin, edge, per)
RightOf(otherWin, margin)
SameAs(otherWin, edge, margin)
Set(rel, otherWin, otherEdge, value, margin)
Unrained()
wxIndividualLayoutConstraint()
wxInitDialogEvent
wxInitDialogEvent(id)
wxJoystickEvent
ButtonDown(button)
ButtonIsDown(button)
ButtonUp(button)
GetButtonChange()
GetButtonState()
GetJoystick()
GetPosition()
GetZPosition()
IsButton()
IsMove()
IsZMove()
wxJoystickEvent(eventType, state, joystick, change)
wxKeyEvent
AltDown()
ControlDown()
GetKeyCode()
GetPosition()
GetX()
GetY()
HasModifiers()
wxWindows Methods
MetaDown()
ShiftDown()
wxKeyEvent(keyEventType)
wxLayoutConstraints
wxLayoutConstraints()
wxListBox
Append(item)
Clear()
Create(parent, id, pos, size, n, choices[], style, validator, name)
Delete(n)
Deselect(n)
FindString(string)
GetClientData(n)
GetSelection()
GetSelections(selections)
GetString(n)
GetStringSelection()
Number()
Selected(n)
SetClientData(n, data)
SetFirstItem(n)
SetSelection(n, select)
SetString(n, string)
SetStringSelection(string, select)
wxListBox(parent, id, pos, size, n, choices[], style, validator, name)
~wxListBox()
wxListCtrl
Arrange(flag)
ClearAll()
Create(parent, id, pos, size, style, validator, name)
DeleteAllItems()
DeleteColumn(col)
DeleteItem(item)
EditLabel(item)
EnsureVisible(item)
FindItem(start, str, partial)
FindItemAtPos(start, pt, direction)
FindItemData(start, data)
GetColumn(col, item)
GetColumnWidth(col)
wxWindows Methods
GetCountPerPage()
GetImageList(which)
GetItem(info)
GetItemCount()
GetItemData(item)
GetItemPosition(item, pos)
GetItemRect(item, rect, code)
GetItemSpacing(isSmall)
GetItemState(item, stateMask)
GetItemText(item)
GetNextItem(item, geometry, state)
GetSelectedItemCount()
GetTextColour() (alias GetTextColor)
GetTopItem()
HitTest(point, flags)
InsertColumn(col, info)
InsertColumnInfo(col, heading, format, width)
InsertImageItem(index, imageIndex)
InsertImageStringItem(index, label, imageIndex)
InsertItem(info)
InsertStringItem(index, label)
ScrollList(dx, dy)
SetBackgroundColour(col) (alias SetBackgroundColor)
SetColumn(col, item)
SetColumnWidth(col, width)
SetImageList(imageList, which)
SetItem(info)
SetItemData(item, data)
SetItemImage(item, image, selImage)
SetItemPosition(item, pos)
SetItemState(item, state, stateMask)
SetItemText(item, text)
SetSingleStyle(style, add)
SetStringItem(index, col, label, imageId)
SetTextColour(col) (alias SetTextColor)
SetWindowStyleFlag(style)
wxListCtrl(parent, id, pos, size, style, validator, name)
~wxListCtrl()
wxListEvent
Cancelled()
GetCode()
GetColumn()
GetData()
wxWindows Methods
GetImage()
GetIndex()
GetItem()
GetLabel()
GetMask()
GetOldIndex()
GetPoint()
GetText()
wxListEvent(commandType, id)
wxMDIChildFrame
Activate()
Create(parent, id, title, pos, size, style, name)
Restore()
wxMDIChildFrame(parent, id, title, pos, size, style, name)
~wxMDIChildFrame()
wxMDIParentFrame
ActivateNext()
ActivatePrevious()
ArrangeIcons()
Cascade()
Create(parent, id, title, pos, size, style, name)
GetActiveChild()
GetClientSize(width, height)
GetClientWindow()
GetToolBar()
SetToolBar(toolbar)
Tile()
wxMDIParentFrame(parent, id, title, pos, size, style, name)
~wxMDIParentFrame()
wxMemoryDC
SelectObject(bitmap)
wxMemoryDC()
wxMenu
Append(id, item, helpString, checkable)
AppendItem(menuItem)
AppendMenu(id, item, subMenu, helpString)
AppendSeparator()
Break()
Check(id, check)
wxWindows Methods
Delete(id)
DeleteItem(item)
Destroy(id)
DestroyMenuItem(item)
Enable(id, enable)
FindItem(itemString)
GetHelpString(id)
GetLabel(id)
GetMenuItemCount()
GetMenuItems()
GetTitle()
Insert(pos, item)
IsChecked(id)
IsEnabled(id)
Remove(item)
RemoveById(id)
SetHelpString(id, helpString)
SetLabel(id, label)
SetTitle(title)
UpdateUI(source)
wxMenu(title, style)
~wxMenu()
wxMenuBar
Append(menu, title)
Check(id, check)
Enable(id, enable)
EnableTop(pos, enable)
FindMenu(title)
FindMenuItem(menuString, itemString)
GetHelpString(id)
GetLabel(id)
GetLabelTop(pos)
GetMenu(menuIndex)
GetMenuCount()
Insert(pos, menu, title)
IsChecked(id)
IsEnabled(id)
Refresh()
Remove(pos)
Replace(pos, menu, title)
SetHelpString(id, helpString)
SetLabel(id, label)
SetLabelTop(pos, label)
wxWindows Methods
wxMenuBar(style)
~wxMenuBar()
wxMenuEvent
GetMenuId()
wxMenuEvent(type, id)
wxMenuItem
Check(check)
Enable(enable)
GetHelp()
GetId()
GetLabel()
GetLabelFromText(text)
GetSubMenu()
GetText()
IsCheckable()
IsChecked()
IsEnabled()
IsSeparator()
SetHelp(helpString)
wxMenuItem(parentMenu, id, text, help, isCheckable, subMenu)
~wxMenuItem()
wxMessageDialog
ShowModal()
wxMessageDialog(parent, message, caption, style, pos)
~wxMessageDialog()
wxMetafileDC
wxMetafileDC(filename)
~wxMetafileDC()
wxMiniFrame
Create(parent, id, title, pos, size, style, name)
wxMiniFrame(parent, id, title, pos, size, style, name)
~wxMiniFrame()
wxMouseEvent
AltDown()
Button(button)
ButtonDClick(but)
wxWindows Methods
ButtonDown(but)
ButtonUp(but)
ControlDown()
Dragging()
Entering()
GetLogicalPosition(dc)
GetPosition()
GetX()
GetY()
IsButton()
Leaving()
LeftDClick()
LeftDown()
LeftIsDown()
LeftUp()
MetaDown()
MiddleDClick()
MiddleDown()
MiddleIsDown()
MiddleUp()
Moving()
RightDClick()
RightDown()
RightIsDown()
RightUp()
ShiftDown()
wxMoveEvent
GetPosition()
wxMoveEvent(pt, id)
wxNotebook
AddPage(page, text, select, imageId)
AdvanceSelection(forward)
Create(parent, id, pos, size, style, name)
DeleteAllPages()
DeletePage(page)
GetImageList()
GetPage(page)
GetPageCount()
GetPageImage(nPage)
GetPageText(nPage)
GetRowCount()
GetSelection()
wxWindows Methods
wxNotebookEvent
GetOldSelection()
GetSelection()
SetOldSelection(page)
SetSelection(page)
wxNotebookEvent(eventType, id, sel, oldSel)
wxNotebookSizer
GetNotebook()
wxNotebookSizer(notebook)
wxNotifyEvent
IsAllowed()
Veto()
wxNotifyEvent(eventType, id)
wxObject
GetClassInfo()
GetRefData()
IsKindOf(info)
Ref(clone)
SetRefData(data)
UnRef()
wxObject()
~wxObject()
wxPageSetupDialog
GetPageSetupData()
ShowModal()
wxPageSetupDialog(parent, data)
~wxPageSetupDialog()
wxWindows Methods
wxPaintDC
wxPaintDC(window)
wxPaintEvent
wxPaintEvent(id)
wxPalette
Create(n, red, green, blue)
Ok()
~wxPalette()
wxPanel
Create(parent, id, pos, size, style, name)
GetDefaultItem()
InitDialog()
SetDefaultItem(btn)
wxPanel(parent, id, pos, size, style, name)
~wxPanel()
wxPen
GetCap()
GetColour()
GetJoin()
GetStyle()
GetWidth()
Ok()
SetCap(capStyle)
SetColour(colour)
SetColour(colourName)
SetColour(red, green, blue)
SetJoin(join_style)
SetStyle(style)
SetWidth(width)
wxPen()
wxPenCopy(pen) (alternate constructor)
wxPenFromColor(colour, width, style) (alternate constructor)
wxPenFromColorName(colourName, width, style) (alternate constructor)
wxPenFromColour(colour, width, style) (alternate constructor)
wxPenFromColourName(colourName, width, style) (alternate constructor)
~wxPen()
wxWindows Methods
wxPlotWindow
Add(curve)
Delete(curve)
Enlarge(curve, factor)
GetAt(n)
GetCount()
GetCurrent()
GetUnitsPerValue()
GetZoom()
Move(curve, pixels_up)
RedrawEverything()
RedrawXAxis()
RedrawYAxis()
SetCurrent(current)
SetEnlargeAroundWindowCentre(aroundwindow)
SetScrollOnThumbRelease(onrelease)
SetUnitsPerValue(upv)
SetZoom(zoom)
wxPlotWindow(parent, id, pos, size, flags)
~wxPlotWindow()
wxPoint
wxPoint(x, y)
~wxPoint()
wxPostScriptDC
GetResolution()
SetResolution(ppi)
wxPostScriptDC(printData)
~wxPostScriptDC()
wxPrintDialog
GetPrintDC()
GetPrintDialogData()
ShowModal()
wxPrintDialog(parent, data)
~wxPrintDialog()
wxPrinterDC
wxPrinterDC(printData)
wxWindows Methods
wxProcessEvent
GetPid()
wxProcessEvent(id, pid)
wxQueryLayoutInfoEvent
GetFlags()
GetOrientation()
GetRequestedLength()
GetSize()
SetAlignment(alignment)
SetFlags(flags)
SetOrientation(orientation)
SetRequestedLength(length)
SetSize(size)
wxQueryLayoutInfoEvent(id)
wxRadioBox
Create(parent, id, label, point, size, n, choices[], majorDimension, style,
validator, name)
Enable(enable)
EnableItem(n, enable)
FindString(string)
GetItemLabel(n)
GetLabel(item)
GetSelection()
GetString(n)
GetStringSelection()
Number()
SetItemLabel(n, label)
SetSelection(n)
SetStringSelection(string)
Show(show)
ShowItem(item, show)
wxRadioBox(parent, id, label, point, size, n, choices[], majorDimension,
style, validator, name)
~wxRadioBox()
wxRadioButton
Create(parent, id, label, pos, size, style, validator, name)
GetValue()
SetValue(value)
wxRadioButton(parent, id, label, pos, size, style, validator, name)
~wxRadioButton()
wxWindows Methods
wxSashLayoutWindow
GetAlignment()
GetOrientation()
SetAlignment(alignment)
SetDefaultSize(size)
SetOrientation(orientation)
wxSashLayoutWindow(parent, id, pos, size, style, name)
~wxSashLayoutWindow()
wxSashWindow
GetMaximumSizeX()
GetMaximumSizeY()
GetMinimumSizeX()
GetMinimumSizeY()
GetSashVisible(edge)
HasBorder(edge)
SetMaximumSizeX(min)
SetMaximumSizeY(min)
SetMinimumSizeX(min)
SetMinimumSizeY(min)
SetSashBorder(edge, hasBorder)
SetSashVisible(edge, visible)
wxSashWindow(parent, id, pos, size, style, name)
~wxSashWindow()
wxScreenDC
EndDrawingOnTop()
StartDrawingOnTop(window)
StartDrawingOnTopRect(rect)
wxScreenDC()
wxScrollBar
Create(parent, id, pos, size, style, validator, name)
GetPageSize()
GetRange()
GetThumbPosition()
SetScrollbar(position, thumbSize, range, pageSize, refresh)
SetThumbPosition(viewStart)
wxScrollBar(parent, id, pos, size, style, validator, name)
~wxScrollBar()
wxWindows Methods
wxScrolledWindow
CalcScrolledPosition(x, y, xx, yy)
CalcUnscrolledPosition(x, y, xx, yy)
Create(parent, id, pos, size, style, name)
EnableScrolling(xScrolling, yScrolling)
GetScrollPixelsPerUnit(xUnit, yUnit)
GetViewStart(x, y)
GetVirtualSize(x, y)
IsRetained()
PrepareDC(dc)
Scroll(x, y)
SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, noUnitsY, xPos,
yPos, noRefresh)
SetTargetWindow(window)
wxScrolledWindow(parent, id, pos, size, style, name)
~wxScrolledWindow()
wxScrollEvent
GetOrientation()
GetPosition()
wxScrollEvent(commandType, id, pos, orientation)
wxScrollWinEvent
GetOrientation()
GetPosition()
wxSingleChoiceDialog
GetSelection()
GetSelectionClientData()
GetStringSelection()
SetSelection(selection)
ShowModal()
~wxSingleChoiceDialog()
wxSize
GetHeight()
GetWidth()
Set(width, height)
SetHeight(height)
SetWidth(width)
wxSize(width, height)
~wxSize()
wxWindows Methods
wxSizeEvent
GetSize()
wxSizeEvent(sz, id)
wxSizer
Add(width, height, option, flag, border, userData)
AddSizer(sizer, option, flag, border, userData)
AddWindow(window, option, flag, border, userData)
CalcMin()
Fit(window)
GetMinSize()
GetPosition()
GetSize()
Layout()
Prepend(width, height, option, flag, border, userData)
PrependSizer(sizer, option, flag, border, userData)
PrependWindow(window, option, flag, border, userData)
RecalcSizes()
Remove(nth)
RemoveSizer(sizer)
RemoveWindow(window)
SetDimension(x, y, width, height)
SetItemMinSize(pos, width, height)
SetMinSize(width, height)
SetSizeHints(window)
SetSizerMinSize(sizer, width, height)
SetWindowMinSize(window, width, height)
~wxSizer()
wxSlider
ClearSel()
ClearTicks()
Create(parent, id, value, minValue, maxValue, point, size, style, validator,
name)
GetLineSize()
GetMax()
GetMin()
GetPageSize()
GetSelEnd()
GetSelStart()
GetThumbLength()
GetTickFreq()
GetValue()
wxWindows Methods
SetLineSize(lineSize)
SetPageSize(pageSize)
SetRange(minValue, maxValue)
SetSelection(startPos, endPos)
SetThumbLength(len)
SetTick(tickPos)
SetTickFreq(n, pos)
SetValue(value)
wxSlider(parent, id, value, minValue, maxValue, point, size, style, validator,
name)
~wxSlider()
wxSocketEvent
GetClientData()
GetSocket()
GetSocketEvent()
wxSocketEvent(id)
wxSpinButton
Create(parent, id, pos, size, style, name)
GetMax()
GetMin()
GetValue()
SetRange(min, max)
SetValue(value)
wxSpinButton(parent, id, pos, size, style, name)
~wxSpinButton()
wxSpinCtrl
Create(parent, id, value, pos, size, style, min, max, initial, name)
GetMax()
GetMin()
GetValue()
SetRange(minVal, maxVal)
SetValue(text)
wxSpinCtrl(parent, id, value, pos, size, style, min, max, initial, name)
wxSpinEvent
GetPosition()
SetPosition(pos)
wxSpinEvent(commandType, id)
wxWindows Methods
wxSplitterWindow
Create(parent, id, pos, size, style, name)
GetMinimumPaneSize()
GetSashPosition()
GetSplitMode()
GetWindow1()
GetWindow2()
Initialize(window)
IsSplit()
ReplaceWindow(winOld, winNew)
SetMinimumPaneSize(paneSize)
SetSashPosition(position, redraw)
SetSplitMode(mode)
SplitHorizontally(window1, window2, sashPosition)
SplitVertically(window1, window2, sashPosition)
Unsplit(toRemove)
wxSplitterWindow(parent, id, point, size, style, name)
~wxSplitterWindow()
wxStaticBitmap
SetBitmap(label)
wxStaticBox
Create(parent, id, label, pos, size, style, name)
wxStaticBox(parent, id, label, pos, size, style, name)
~wxStaticBox()
wxStaticBoxSizer
GetStaticBox()
wxStaticBoxSizer(box, orient)
wxStaticText
Create(parent, id, label, pos, size, style, name)
GetLabel()
SetLabel(label)
wxStaticText(parent, id, label, pos, size, style, name)
wxStatusBar
Create(parent, id, style, name)
GetFieldRect(i, rect)
GetFieldsCount()
GetStatusText(ir)
wxWindows Methods
SetFieldsCount(number, widths)
SetMinHeight(height)
SetStatusText(text, i)
SetStatusWidths(n, widths)
wxStatusBar(parent, id, pos, size, style, name)
~wxStatusBar()
wxSysColourChangedEvent
wxSysColourChangedEvent()
wxTabCtrl
Create(parent, id, pos, size, style, name)
DeleteAllItems()
DeleteItem(item)
GetCurFocus()
GetImageList()
GetItemCount()
GetItemData(item)
GetItemImage(item)
GetItemRect(item, rect)
GetItemText(item)
GetRowCount()
GetSelection()
HitTest(pt, flags)
InsertItem(item, text, imageId, clientData)
SetImageList(imageList)
SetItemData(item, data)
SetItemImage(item, image)
SetItemSize(size)
SetItemText(item, text)
SetPadding(padding)
SetSelection(item)
wxTabCtrl(parent, id, pos, size, style, name)
~wxTabCtrl()
wxTabEvent
wxTabEvent(commandType, id)
wxTextCtrl
AppendText(text)
CanCopy()
CanCut()
CanPaste()
wxWindows Methods
CanRedo()
CanUndo()
Clear()
Copy()
Create(parent, id, value, pos, size, style, validator, name)
Cut()
DiscardEdits()
GetInsertionPoint()
GetLastPosition()
GetLineLength(lineNo)
GetLineText(lineNo)
GetNumberOfLines()
GetSelection(from, to)
GetValue()
IsModified()
LoadFile(filename)
Paste()
PositionToXY(pos, x, y)
Redo()
Remove(from, to)
Replace(from, to, value)
SaveFile(filename)
SetEditable(editable)
SetInsertionPoint(pos)
SetInsertionPointEnd()
SetSelection(from, to)
SetValue(value)
ShowPosition(pos)
Undo()
WriteText(text)
wxTextCtrl(parent, id, value, pos, size, style, validator, name)
XYToPosition(x, y)
~wxTextCtrl()
wxTextEntryDialog
GetValue()
SetValue(value)
ShowModal()
wxTextEntryDialog(parent, message, caption, defaultValue, style, pos)
~wxTextEntryDialog()
wxTimer
IsOneShot()
IsRunning()
wxWindows Methods
Notify()
SetOwner(owner, id)
Start(milliseconds, oneShot)
wxTimer(owner, id)
~wxTimer()
wxTimerEvent
GetInterval()
wxToolBar
AddControl(control)
AddSeparator()
DeleteTool(toolId)
DeleteToolByPos(pos)
EnableTool(toolId, enable)
GetToolBitmapSize()
GetToolClientData(toolId)
GetToolEnabled(toolId)
GetToolLongHelp(toolId)
GetToolPacking()
GetToolSeparation()
GetToolShortHelp(toolId)
GetToolSize()
GetToolState(toolId)
Realize()
SetToolBitmapSize(size)
SetToolLongHelp(toolId, helpString)
SetToolPacking(packing)
SetToolSeparation(separation)
SetToolShortHelp(toolId, helpString)
ToggleTool(toolId, toggle)
wxToolBar(parent, id, pos, size, style, name)
~wxToolBar()
wxTreeCtrl
AddRoot(text, image, selImage, data)
AppendItem(parent, text, image, selImage, data)
Collapse(item)
CollapseAndReset(item)
Create(parent, id, pos, size, style, validator, name)
Delete(item)
DeleteAllItems()
EditLabel(item)
wxWindows Methods
EnsureVisible(item)
Expand(item)
GetChildrenCount(item, recursively)
GetCount()
GetFirstChild(item, cookie)
GetFirstVisibleItem()
GetImageList()
GetIndent()
GetItemData(item)
GetItemImage(item, which)
GetItemSelectedImage(item)
GetItemText(item)
GetLastChild(item)
GetNextChild(item, cookie)
GetNextSibling(item)
GetNextVisible(item)
GetParent(item)
GetPrevSibling(item)
GetPrevVisible(item)
GetRootItem()
GetSelection()
GetSelections(selection)
GetStateImageList()
HitTest(point, flags)
InsertItem(parent, previous, text, image, selImage, data)
InsertItemBefore(parent, before, text, image, selImage, data)
IsBold(item)
IsExpanded(item)
IsSelected(item)
IsVisible(item)
ItemHasChildren(item)
PrependItem(parent, text, image, selImage, data)
ScrollTo(item)
SetImageList(imageList)
SetIndent(indent)
SetItemBackgroundColour(item, col) (alias SetItemBackgroundColor)
SetItemBold(item, bold)
SetItemData(item, data)
SetItemFont(item, font)
SetItemHasChildren(item, hasChildren)
SetItemImage(item, image, which)
SetItemSelectedImage(item, selImage)
SetItemText(item, text)
SetItemTextColour(item, col) (alias SetItemTextColor)
SetStateImageList(imageList)
wxWindows Methods
SortChildren(item)
Toggle(item)
Unselect()
UnselectAll()
wxTreeCtrl(parent, id, pos, size, style, validator, name)
~wxTreeCtrl()
wxTreeEvent
GetCode()
GetItem()
GetLabel()
GetOldItem()
GetPoint()
wxTreeEvent(commandType, id)
wxUpdateUIEvent
Check(check)
Enable(enable)
GetChecked()
GetEnabled()
GetSetChecked()
GetSetEnabled()
GetSetText()
GetText()
SetText(text)
wxUpdateUIEvent(commandId)
wxWindow
AddChild(child)
CaptureMouse()
Center(direction)
CenterOnParent(direction)
CenterOnScreen(direction)
Centre(direction)
CentreOnParent(direction)
CentreOnScreen(direction)
Clear()
ClientToScreen(x, y)
Close(force)
ConvertDialogPointToPixels(pt)
ConvertDialogSizeToPixels(sz)
Destroy()
DestroyChildren()
wxWindows Methods
Enable(enable)
FindFocus()
FindWindow(id)
Fit()
GetBackgroundColour() (alias GetBackgroundColor)
GetBestSize()
GetCaret()
GetCharHeight()
GetCharWidth()
GetChildren()
GetClientSize()
GetConstraints()
GetDropTarget()
GetEventHandler()
GetExtraStyle()
GetFont()
GetForegroundColour() (alias GetForegroundColor)
GetGrandParent()
GetId()
GetLabel()
GetName()
GetParent()
GetPosition(x, y)
GetPositionTuple()
GetRect()
GetScrollPos(orientation)
GetScrollRange(orientation)
GetScrollThumb(orientation)
GetSize(width, height)
GetTextExtent(string, x, y, descent, externalLeading, font)
GetTitle()
GetToolTip()
GetUpdateRegion()
GetValidator()
GetWindowStyleFlag()
InitDialog()
IsEnabled()
IsExposed(x, y)
IsExposedPoint(pt)
IsExposedRect(rect)
IsRetained()
IsShown()
IsTopLevel()
Layout()
LoadFromResource(parent, resourceName, resourceTable)
wxWindows Methods
Lower()
MakeModal(flag)
Move(x, y)
MoveXY(pt)
PopEventHandler(deleteHandler)
PopupMenu(menu, pos)
PopupMenuXY(menu, x, y)
PushEventHandler(handler)
Raise()
Refresh(eraseBackground, rect)
ReleaseMouse()
RemoveChild(child)
Reparent(newParent)
ScreenToClient(pt)
ScreenToClientXY(x, y)
ScrollWindow(dx, dy, rect)
SetAcceleratorTable(accel)
SetAutoLayout(autoLayout)
SetBackgroundColour(colour) (alias SetBackgroundColor)
SetCaret(caret)
SetClientSize(size)
SetClientSizeWH(width, height)
SetConstraints(raints)
SetCursor())
SetDimensions(x, y, width, height, sizeFlags)
SetDropTarget(target)
SetEventHandler(handler)
SetExtraStyle(exStyle)
SetFocus()
SetFont(font)
SetForegroundColour(colour) (alias GetForegroundColor)
SetId(id)
SetName(name)
SetPosition(size)
SetScrollbar(orientation, position, thumbSize, range, refresh)
SetScrollPos(orientation, pos, refresh)
SetSize(width, height)
SetSizeHints(minW, minH, maxW, maxH, incW, incH)
SetSizer(sizer)
SetTitle(title)
SetToolTip(tip)
SetValidator(validator)
SetWindowStyle(style)
SetWindowStyleFlag(style)
Show(show)
wxWindows Methods
TransferDataFromWindow()
TransferDataToWindow()
Validate()
WarpPointer(x, y)
wxGetClientSizeTuple(width, height)
wxWindow(parent, id, pos, size, style, name)
~wxWindow()
wxWindowDC
wxWindowDC(window)
wxWizardEvent
GetDirection()
wxWizardEvent(type, id, direction)
To Do and Wish Lists
There are lots of things that still remain to be implemented, and a number of things that
would be nice, but are hardly critical. The following is in no particular order:
The routines to create a number of support files, such as wrap.cpp, are written in Qbasic.
This isn't especially terrible, since it works just fine. Butit should probably be coded in
something else, like C++ or even wxBasic itself so that it's more portable.
Namespace
Namespaces solve the problem of when function and variable names in included libraries
conflict with those already in use.
and then refer to routines and variable in that file with the namespace prefix:
mylib.someFunction()
At the moment, there is no namespace implemented, but I'd like to add it.
Bytecodes
wxBasic doesn't generate very efficient code. I don't know if this is a problem or not. My
first and foremost goal was get the damned thing done. There's no value in having a
language fast and efficient if it's incomplete and broken.
It's also not clear how much of an issue this is. Computer processors are getting faster and
faster, and most of the time, a GUI application is just sitting in an idle event loop.
Also, the code is still in a constant state of flux. At some point when it settles down, I'll
think about generating bytecodes instead of nodes.
To Do and Wish Lists
User-defined types are conspicious by their absence in wxBasic. At one point I had
implemented them, but the addition of passing parameters by reference broke all that code.
Since wxBasic already supports C++ classes, it would appear to make sense to add user-
defined classes as well. This may well be the case, but I'd like to get version 1.0 completed
and released before adding this sort of complexity.
Interactive Debugging
It would be nice to be able to see what line is currently being executed and the values of
the variables at that point. If you look at the Symbol data structure, you'll see that there is
a.sibling field. This allows you to access things like the names of all the variables
associated with a function.
It would also be nice to be able to modify the values of variables. All this would be
dependant on tying a trace window, and possibly and IDE to wxBasic.
Don't hold your breath for this stuff. It's certainly feasible, but not in the immediate future.
An IDE
At a minimum, it would be nice to have some sort of editor for wxBasic. I'm thinking that
I could hack something together from ScITE, along the lines of Python's IDLE. Since
ScITE is being wrapped as a wxWindow control, I might even be able to write the IDE in
wxBasic.