Difference between revisions of "Coding explore methods"
(→Required Files) |
(→Required Files) |
||
Line 16: | Line 16: | ||
'''Required files:''' | '''Required files:''' | ||
− | * exploreproperties<KEWORD> - this is similar to the graphproperties file used by [[workspace objects]], although it contains fewer properties. Note that the properties stored in this file should all be static. You should not add your own properties to this file... those things should be stored in [[the workspace]] object's udata.explore field as described below. This file must contain the following properties: | + | * '''exploreproperties<KEWORD>''' - this is similar to the graphproperties file used by [[workspace objects]], although it contains fewer properties. Note that the properties stored in this file should all be static. You should not add your own properties to this file... those things should be stored in [[the workspace]] object's udata.explore field as described below. This file must contain the following properties: |
**properties.longname = the string that appears in the menu on the Customize tab. This is the name of this method that the user will see. | **properties.longname = the string that appears in the menu on the Customize tab. This is the name of this method that the user will see. | ||
**properties.updates = a cell array of strings that lists the [[events and updates]] that trigger an update for this explore method. This list should contain all events that require an update for ANY workspace object, i.e. if the event causes some [[workspace objects]] to require an update, but others to not require an update, the event SHOULD appear in this list. | **properties.updates = a cell array of strings that lists the [[events and updates]] that trigger an update for this explore method. This list should contain all events that require an update for ANY workspace object, i.e. if the event causes some [[workspace objects]] to require an update, but others to not require an update, the event SHOULD appear in this list. | ||
− | *makeuicontrols<KEYWORD> - this file creates the uicontrols on the Customize tab that appear when the user selects this explore method from the menu on the Customize tab. You can also store the callbacks for these uicontrols in this file, or you can put them in their own files. The handles of all objects created by this function must be appended to the end of handles.tabobjects so that they will be correctly deleted when the user changes tabs. For most explore methods, this function should create a button that toggles the method on and off (although this doesnt make sense for all methods and is by no means required). | + | *'''makeuicontrols<KEYWORD>''' - this file creates the uicontrols on the Customize tab that appear when the user selects this explore method from the menu on the Customize tab. You can also store the callbacks for these uicontrols in this file, or you can put them in their own files. The handles of all objects created by this function must be appended to the end of handles.tabobjects so that they will be correctly deleted when the user changes tabs. For most explore methods, this function should create a button that toggles the method on and off (although this doesnt make sense for all methods and is by no means required). |
Revision as of 15:01, 11 October 2013
Introduction
An "explore method" is a customization that can be applied to a workspace object to specialize it in some way. Yes, that is a vague definition. More importantly, explore methods provide a way for you to add a custom tab to a workspace object, which you can use to do pretty much anything.
Explore methods are the things that you access from the Customize tab. I call them explore methods because the Customize tab used to be called the "Explore tab," and all the references in the code still use "explore".
Explore methods live in the rave\exploremethods\ folder. Just like everything other rave plugin, each explore method goes in its own folder, whose name serves as the KEYWORD. All the files related to the explore method will also contain this KEYWORD, which is how Rave knows which files to use for which purposes.
In order for an explore method to be useable on a particular workspace object, one of the following conditions must be true:
- The explore method keyword is listed in the workspace object's graphproperties file under properties.exploremethods
- The workspace object key word is listed in the explore method's exploreproperties file under properties.workspaceobjects
This way, if you code a new workspace object you can let it access exising explore methods without having to change the explore methods' code, and if you code a new explore method you can let it access existing workspace objects without changing the workspace objects' code.
Required Files
Each explore method requires 3 files, but will probably also have several "update" files that run in response to certain user actions.
Required files:
- exploreproperties<KEWORD> - this is similar to the graphproperties file used by workspace objects, although it contains fewer properties. Note that the properties stored in this file should all be static. You should not add your own properties to this file... those things should be stored in the workspace object's udata.explore field as described below. This file must contain the following properties:
- properties.longname = the string that appears in the menu on the Customize tab. This is the name of this method that the user will see.
- properties.updates = a cell array of strings that lists the events and updates that trigger an update for this explore method. This list should contain all events that require an update for ANY workspace object, i.e. if the event causes some workspace objects to require an update, but others to not require an update, the event SHOULD appear in this list.
- makeuicontrols<KEYWORD> - this file creates the uicontrols on the Customize tab that appear when the user selects this explore method from the menu on the Customize tab. You can also store the callbacks for these uicontrols in this file, or you can put them in their own files. The handles of all objects created by this function must be appended to the end of handles.tabobjects so that they will be correctly deleted when the user changes tabs. For most explore methods, this function should create a button that toggles the method on and off (although this doesnt make sense for all methods and is by no means required).