Method directives
From Emergent
See also Comment directives, Object directives, Member directives, Property directives, Enum directives
Contents |
Maketa control
- #IGNORE -- do not create TA info for this method
Menus and Buttons etc
- #NO_BUSY -- for no param menu/button items, don't show the hourglass cursor; primarily for meths that open a dialog themselves
- #MENU -- Creates a Menu for this function item in an Edit dialog.
- #MENU_SEP_BEFORE -- Create a separator before this item in the menu.
- #MENU_SEP_AFTER -- Create a separator after this item in the menu.
- #MENU_ON_xxx -- Puts this function on given menu. Creates menu if not already there. This does not replace the #MENU directive. Everything on the File and Edit menus will be on the edit button for this class in an edit dialog.
- #BUTTON -- Creates a button for this function in the edit dialog.
- #LABEL_xxx -- Sets the label for item (or menu or button) to be xxx.
- #GHOST_ON_xxx -- For BUTTON meths, ghosts the button based on the value of boolean member xxx of this class. If member == true, button is ghosted. Supports implicit boolean conversion via Variant. Brad: please provide example.
- #GHOST_OFF_xxx -- Like above, except if member == false, button is ghosted.
- #ACTION_xxx -- marks the object as corresponding the indicated "well known" action, ex "editDelete" -- actions can have things like icons and accelerator keys.
- #DYN1 -- menu method that can be applied to 1 or more selected items; (note: method can have parameters, if so, then they are supplied in the usual fashion by a popup dialog)
- #DYN12N -- method that can be applied on 1st selected item, with items 2:N as a parameter; 1st parameter is the type of the object taken as a parameter (note: method can have more parameters, if so, then they are supplied in the usual fashion by a popup dialog)
- #DYN2N1
- method that can be applied on selected items 2:N with 1st item as a parameter; 1st parameter must be a pointer or reference to type of object 1 (note: method can have more parameters, if so, then they are supplied in the usual fashion by a popup dialog)
- method that can be applied as a Destination action (paste-like or drop-like) when object of 1st param type is on clipboard/drag
- #DYN_P1 -- method (usually static) on another object, which has the selected item type as first parameter and can be called from selected item
- #DROP1 -- method to put on Drop (or Edit) menu for this object as target when the src is one object of type of arg 1, ex SetSpec(Spec* src)
- #DROPN -- same as DROP_1 but can accept 1 or more drop objects
- #MENU_CONTEXT -- puts the menu item directly on the context menu (instead of a submenu) -- ignored in edit dialogs and main menus.
- #NO_MENU_CONTEXT -- does not put the item anywhere in a context menu.
- #VIEWMENU -- similar to MENU, but specifies a view item (for DataView classes) -- only VMENU items get put in View window menus. (Note: View items should generally not be edited as data items -- they are usually hidden in the browser hierarchy.)
Arguments
NOTE: all of the following can take an optional [n_] or [_n] arg (e.g., TYPE_ON_1_this or NO_SCOPE_1) which specifies the (0-based) argument index that the directive applies to, as indicated in the items below:
General
- #CONFIRM -- For functions with no args, put up a dialog for confirmation (shows function description too).
- #ARGC_x -- How many args to present to the user (if default args are available).
- #ARG_ON_OBJ -- An argument to this function is an object within the base object (e.g., a member of the group).
- #NO_SAVE_ARG_VAL -- don't save the argument values for this function after it has been called, to provide defaults for the next invocation. This is useful if args are somehow known to not produce reasonable values (e.g., taBase* objects that are not within usual hierarchy and thus don't produce useful paths).
- #INIT_ARGVAL_ON_[n_]xxx -- initial value of arg is on given member of object, instead of using prior memory of what was supplied last time this function was called.
Pointer Args
- #TYPE_[n_]xxx -- For TypeDef pointer args: use given type to anchor the listing of possible types.
- #TYPE_ON_[n_]xxx -- For a function with (any) TypeDef or Token args, uses the member xxx of this to anchor type selection or type of tokens to present (can be a member of a member as long as the path is resolvable in a static fashion -- i.e., everything is a direct member). if xxx == 'this', then the type of the current object is used. can optionally put in a single digit number to indicate which arg number this applies to, if multiple token* args.
- #FROM_GROUP_[n_]xxx -- Performs selection of tokens for args from given group member xxx, which is a member of this object (like ARG_ON_OBJ).
- #NO_GROUP_OPT[_n] -- For FROM_GROUP_xxx args, disallows group itself as an option.
- #NO_SCOPE[_n] -- Don't scope the argument to this function. See SCOPE object directive
- #SCOPE_[n_]xxx -- use give type name to scope tokens shown in chooser.
- #NULL_OK[_n] -- A null value is ok as an option for the user (else not). for all pointers as args.
- #NULL_TEXT_[n_]xxx -- relabel the NULL item with given label to indicate its true function in this context (e.g., "NewGraph" or something)
- #EDIT_OK[_n] -- Include Edit as an option on the token pointer menu (else not)
- #ARG_VAL_FM_FUN[_n] -- call the taBase GetGuiArgVal function on base to get initial arg value for dialog -- passes name of fun and arg, so this can be used for anything to do arbitrarily complex initialization.
Stream or String/filename Args
- #EXT_[n_]xxx -- specify the file extension to use for stream (in 3.2 used to spec the arg name -- apparently that is not true now?)
- #FILETYPE_[n_]xxx -- word used to describe files when saving/loading this type; should be a single noun, ex 'Project' (this directive is always used with the EXT directive)
- #COMPRESS[_n] -- turn on compression of files
- #FILE_DIALOG_[n_]xxx -- activate a file dialog button next to string field name (only for string args) -- xxx is SAVE, LOAD, or APPEND
- #FILE_ARG_EDIT[_n] -- For functions with one ostream arg, use the normal arg edit dialog, instead of a shortcut directly to the file chooser (arg edit allows user to choose open mode for saving).
- #QUICK_SAVE[_n] -- For functions with one ostream arg, use existing file name if possible (default is to prompt).
- #APPEND_FILE[_n] --For functions with one ostream arg, use append as the file opening mode.
Calling, Return Values, etc
- #USE_RVAL -- Use (display) return value from this function. Otherwise return values are ignored.
- #USE_RVAL_RMB -- Use (display) return value from this function only if the right mouse button was pressed on the Ok button. Otherwise return values are ignored.
- #NO_APPLY_BEFORE -- Do not apply any changes to dialog before calling this function. The default is to apply the changes first.
- #NO_REVERT_AFTER -- Do not update (revert) dialog after calling this function (and do not call the UpdateAfterEdit function either). The default is to do both.
- #UPDATE_MENUS -- Update the global menus after calling this function (e.g., because altered the structure reflected by those menus).
- #NO_SCRIPT -- Do not generate script code to call this function, if script code recording is currently active. section 18.3.1 Object Directives.
Misc
- #CAT_xxx identify "semantic" category that this object belongs to: see CatNamesMembMeths for a list
Properties
- #GET_xxx -- marks this method as the "get" method for property xxx -- it must return a Variant-compatible type; must be const; and must not have any non-default parameters
- #SET_xxx -- marks this method as the "set" method for property xxx -- it may (but typically won't) return a value; must *not* be const; must have a Variant-compatible first argument (the value); must not have any other non-default args (but may have default args)
Obsolete
- #NEW_FUN -- OBSOLETE: Give user the option to call this (void) function during New (in the "new" dialog).
