# GraffitiSettings
Class Inherits GraffitiSuite.BaseObject
## About
GraffitiSettings offers a simple way for Xojo developers to load and save their application’s user-specific settings values to an XML file. It supports automatic writing of values on change, automatic selection of default file location, and uses Variant for values so your settings are saved and read the way you intended them to be.
## Preview

Previous
Next
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Error | theMessage as String | (None) | An error occurred. |
| Log | theMessage as String | (None) | A log message has been encountered. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| AddPreset | name as String <br> values as Dictionary | (None) | Adds a new static set of preset values to the instance. |
| Constructor | (None) | (None) | Creates a new instance of the class. |
| Constructor | settingsPath as FolderItem | (None) | Creates a new instance of the class. |
| Constructor | fileName as String | (None) | Creates a new instance of the class. |
| Erase | DeleteFile as Boolean = False | (None) | Clears all settings. If DeleteFile is True, then the settings file is removed from the filesystem. |
| GetValue | strKey as String <br> Optional DefaultValue as String = "" | Variant | Retrieves a value for the specified setting. DefaultValue will be returned if no entry is found for strKey. |
| HasPreset | name as String | Boolean | Returns True if a preset has been added with the name specified by the parameter. |
| Load | (None) | (None) | Reload contents from settings file. |
| LoadPreset | name as String <br> ignoredValues() as String | (None) | Loads the specified preset in to the main settings memory, overwrites any value whose name does not appear in the ignoredValues array. |
| Operator_Lookup | Key as String <br> DefaultValue as String = "" | Variant | (None) |
| Operator_Lookup | Key as String <br> Assigns Value as String | (None) | (None) |
| Preset | name as String | Dictionary | Returns the dictionary represented by the specified preset name. |
| RemoveAllPresets | (None) | (None) | Clears all added presets. |
| RemovePreset | name as String | (None) | Removes the specified preset. |
| RemoveSetting | strKey as String | (None) | Remove a setting from the instance and settings file. |
| Save | (None) | (None) | Update settings file with instance values. |
| SetValue | strKey as String <br> Value as Variant | (None) | Sets a new setting in the instance with value supplied by Value. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| AlwaysSave | Boolean | True | If True, any change to the instance's settings will save all values to the file immediately. |
| Values | Dictionary | (None) | The raw dictionary containing all setting values. |