Getting Started
-
The GLX Application Framework provides a foundation of common building blocks for building applications in Revolution (2.8.1 and above) on OS X (10.3 and above) and Windows (2000, XP and Vista). The framework takes care of common tasks such as splash stacks, loading stacks and externals at launch, working with user preferences, auto updating and more. This leaves you free to focus on coding the features specific to your application and not reinventing the wheel each time you start a new project.
The framework is free to use in your personal or commercial projects.
The framework does not currently have Linux support because we do not create applications for Linux. Someone is welcome to add support for this. Contact me if you are interested and we can discuss what would need to be done.
There are still some parts of the framework that are not documented yet (i.e. the undo manager and the innards of the auto update mechanism) so if you are poking around in the scripts and come across something that isn't answered anywhere then send an email. There are probably some parts that don't work exactly how one might want. If you come across something that fits into this category please mention it, or better yet, improve it and submit the change.
Thanks to Daniels & Mara for the use of the GLX name. Jerry has created tools that help Revolution developers be far more productive and hopefully this framework will help do the same. GLX2 is the must-have script editor for Revolution developers and is available at http://daniels-mara.com/glx2/.
If you have questions, suggestions or would like to contribute a modification to the framework please send an email to glxapp at bluemangolearning dot com.
-
You can download the GLX Application Framework zip archive here.
-
You can create and configure applications that use the GLX application framework using the supplied plugin.
-
This lesson will walk you through creating your first application using the GLX application framework.
-
This lesson will explain how to take existing stack files and use them with the GLX Application Framework. To begin, create a new GLX Application.
-
After creating your application you will need to use the Revolution Standalone Builder to build executable files for your target platforms using the launcher.rev file that was created in your application folder. This stack is named glxappLauncher in memory.
You only need to build the executables when you want to update the Revolution engine that your application uses. The GLX application framework stores all application stack files outside of the executable so you don't have to rebuild each time you make changes.
-
The application framework will take care of loading your application stack files and externals whether running in the IDE or as a standalone. This lesson will show you to open your application in the IDE.
-
You can edit your GLX application's properties using the glxApplicationProperties plugin.
Configuring General Properties
-
The GLX Application Framework simplifies creating application data folders and storing user preferences. Before you can call the glxapp_getPref, glxapp_setPref and glxapp_savePrefs handlers you must define where the preference files will be stored.
Currently preference data is stored as Revolution stacks. A nice addition might be to move Windows preferences to the Registry and to store OS X preferences as a plist.
-
Revolution provides two global variables that specify the ids of the images to use in ask and answer dialogs. The variables are gRevAppIcon and gRevSmallAppIcon. You can specify the images to use in the General tab.
You can also display these images in your application by assigning the id of an image to glxapp_getProp("32x32 app icon id") or glxapp_getProp("64x64 app icon id") which return the ids of the respective images.
-
A splash screen is a stack that appears after the user launches your application but before your main application window loads. This lesson shows how to display a splash screen in your application.
-
Revolution allows you to set the password property of a stack in order to encrypt the scripts. While this is a useful feature it can be troublesome to password protect your stacks during development.
The GLX Application Framework enables you to specify a password that will only be applied to stacks when you deploy standalones or updates. This provides the benefit of password protection without the inconvenience of having to enter the password for stacks each time you open them in the Revolution IDE during development.
-
The GLX Framework keeps track of your application's version information. This is used by the framework when auto updating your application over the internet and can be used by you to report version information in your about box, etc.
-
By default on Windows a new instance of your Revolution application will be launched each time the user double-clicks on your application or otherwise initiates a successive launch. As a developer you can override this behavior by intercepting the relaunch message (see Revolution docs). This lesson shows how the framework can handle this for you.
This feature is not available on OS X since an application can only have one instance running.
-
You can configure the file extensions that your application supports. This is done for two primary reasons.
1) When your application receives a notice from the operating system to open a file the GLX framework checks all files against the list of supported file extensions. The framework then sends the glxapp_openFiles message to your application with a list of files the operating system is requesting it to open.
2) You can quickly create file type filters for use with the answer file with type command.
-
You can configure complex file type filters for use with the answer file with type command. By doing so you can use one function call to create the necessary strings to pass as the type.
-
By using the GLX Application Framework to build your application you automatically get auto update capabilities. This lesson will explain how to configure the auto update url so you can call glxapp_updateIfAvailable from your application.
The Application Stack
-
When you create a GLX Application a stack named application is created. This lesson will teach you about the application stack.
Preferences
-
The GLX framework will store default values for preferences and broadcast messages when a preference value is changed. Be aware that if you do not want to set a default value or do not need to send a custom message when a preference values is changed then there is no need to add the preference as described in this lesson. You can just use the preference API calls to get/set values.
Stack Files & Externals
-
You can define which stack files your application requires. The framework will automatically load all stack files into memory at launch and can also verify that the stack file exists and refuse to launch if not present.
-
The application framework will automatically load externals and make all external handlers available to all scripts in your application.
Standalone Resources
-
The Standalone Resources tab enables you to specify additional files to include when you deploy your application. This may include readme files, documentation, database drivers or SSL dlls.
-
The lesson will show you how to include a ReadMe file in your application distribution.
-
RevDB.dll/.bundle requires additional files in order to connect to different databases. This lesson will demonstrate how to include RevDB database drivers with your application.
Application Helpers
-
When the user double-clicks on your application file the operating system will launch your application. This lesson shows how to determine what file the user double-clicked on so that you can open it.
-
The framework provides handlers for storing, displaying and retrieving recent files that your application has opened. The recent files are stored in your application's preference file.
Deploying Your Application
-
A Revolution stack will always open looking the same as the last time you saved it. When deploying an application you usually want to prepare your stacks by deleting any development resources and arranging controls so they look right the first time the application opens.
When you package a GLX Application a copy of every application file is made and all custom properties that the Revolution IDE or GLX2 create are erased from every control. Each stack is also compacted and saved. This lesson discusses how to perform any additional actions when deploying an application.
-
When it comes time to distribute your application to users you use the GLX Application Packager to package your application files for an installer or files that can be used with the auto update architecture.
-
You may find that you want to protect your auto update files on your web server with a username or password. The framework allows you to set a username and password on a per build profile basis. The framework currently supports basic and digest authentication.
-
During the build process the application packager can copy files into the build folder and run an AppleScript file. You can use these features to quickly build installers for the new build.
Upgrading Framework Files
-
When new version of the framework are released you may need to upgrade an existing application. This lesson will show you how to upgrade the main framework stack file.