Setting default values for Xojo framework Class properties

This feature allows you to change the default property values used by built-in Xojo classes. For example, you could change the default Windows width and height from 600x400 to 800x600.

These are the steps to override class default values:

  1. Create a file named <ClassName>.defaults in <SharedDocuments>/Xojo/Overrides, <Documents>/Xojo/Overrides or an Overrides folder next to the Xojo app (on macOS, this folder can instead be placed directly inside the Contents folder of the Xojo app bundle). If the same .defaults file is in more than one location, the locations take precedence in this order: the Overrides folder by the Xojo app, then <Documents>/Xojo/Overrides, then <SharedDocuments>/Xojo/Overrides

  2. The file contains simple key=value pairs, where the key is the property name on the class and the value is everything after the =.

  3. Integer properties can support different values by OS with the following syntax: Width=20|30|40 (macOS uses 20, Windows uses 30, Linux uses 40)

  4. String properties do not have a way to include an end-of-line

For example, a file (named Window.defaults and located in ~/Documents/Xojo/Overrides) with the following key/value pairs changes the default width and height of a Window from 600/400 to 800/600:

Width=800
Height=600

After restarting Xojo, when you add any new Windows to a desktop project, they will have a default width of 800 and height of 600.

Notes

CheckBox state can be set with state=<value>, where value = 0-Unchecked, 1-Checked, 2-Indeterminate (the values of the Inspector Popup menu for this field).