Xojo Classes

Last Updated: February 23, 2015

This page provides Xojo source code for some of the code classes that I (and/or student helpers) have written to support the programs posted on the Computer Programs page. These classes are open-source, and can be freely copied, modified, and used, subject to the licensing restrictions specified below. If you spot bugs, have questions (that the documentation cannot help you with), have suggestions for code modification, or want a waiver from the terms of the license, please contact me at tmoore@pomona.edu. Be sure to provide information about what platform you are using and what operating system you are running.

PD3DClasses: This set of classes allows you to create a predefined 3DSpace that you can fill with predefined objects (e.g. spheres, boxes, arrows).The predefined space displays three dimensional spaces of arbitrary size and provides easy hooks for rotating and zooming the view, for displaying coordinate axes, and for autoscaling and autocentering to keep objects in view. The space can also be set to autoupdate at a specified rate, making it easy to create 3D animations. An earlier version of these classes was used in the 3DEField and 3DBField programs (see the Computer Programs page). These methods have been extensively tested on Mac OS X 10.4.10, but have not been tested for Windows or Linux in their current form (though previous forms worked on Windows). The .zipped download (204 kB) provides the classes embedded in the source for a program called PDTest that displays some of the capabilities of the class, the help file for that program, and detailed .pdf documentation for the classes. Notes: Place the .html help file in the same folder as the source code before compiling. Also, note that you have to have the Quesa framework suitably installed for your platform to use the classes. This set of classes is subject to the GNU GPL license. Note: While one can view the code for these classes in the Xojo IDE, they will no longer compile, because the way that 3D calls are handled in Xojo is now completely different (based on Open GL instead of Quesa). I hope to be updating this soon.

Formatter Module: This class allows you to format a list of numerical and/or string values so that the formatted values always occupy the same number of characters that are in the corresponding format. For example, the sequence of values 123, "play nice", 32300 formatted with "a = @@@@.@@ b = $$$$ c = #.####e+###" yields "a = 0123.00 b = play c = 3.23 e+4 ", a string with exactly the same number of characters as the format string. This is useful for constructing tables using a monospaced font (see the StatMech program on the Computer Programs page for an example of such a table), and is meant to reproduce the most useful functionality in FORTRAN formatting statements. The .zipped download (12 kB) provides the classes embedded in the source for a program called FormatTest that allows you to test the formatting method. Documentation about how to construct formats is provided as comments in the main method. This code is released to the public domain: do whatever you want with it. However, I would greatly appreciate it (though I do not require it) if you would please (1) give me credit in any publically-released software that uses this module, and (2) send me any improvements (such as bug fixes) that you make in the module that you are willing to have me freely distribute. I will give you credit if you do the latter. Note that I make no warranty about the suitability of this code for your purposes: use at your own risk.