Object directives

From Emergent

Jump to: navigation, search

See also Comment directives, Member directives, Method directives, Property directives, Enum directives

Contents

Maketa processing

  • #IGNORE -- Do not register this object in the list of types.
  • #INSTANCE -- If default is not to create instances, then create one anyway for this object.
  • #NO_INSTANCE -- Do not create a global instance (TAI_xxx) of this object. This will prevent tokens of this object from being made.
  • #NO_MEMBERS -- Do not store the members (including member functions) of this class. Only the type name will be registered.
  • #NO_TOKENS -- Do not keep a record of the tokens of this object type. Types can keep pointers to all instances or tokens of themselves. This can be expensive in terms of memory, but the interface uses "token menus" for arguements or methods which are pointers to objects of the given type.
  • #NO_CSS -- Do not create CSS stub functions for the member functions on this object.

Type hierarchy control

  • #VIRT_BASE -- This is a "virtual" base class: don't show in token menus for this object, etc.
  • #STEM_BASE -- this is a "stem" class: a terminal base class that defines an interface that might be used by various derived types, where all the derived types are considered "variants" of the stem base -- they basically interoperate, while providing some kind of specialized functionality. The ProgEl is an excellent example. In the network algorithm space, it should be the algorithm-specific specs, not the generic specs, that are stems (e.g., LeabraConSpec, not ConSpec) -- this is what it means to be "terminal". The implications are:
    • objects can change their type to anything within the stem-derived group
    • selections of objects are restricted to those within the same stem-group as the first selected item.
    • stem bases provide ideal documentation entry-points -- hint hint for gendoc..

Naming

  • DEF_NAME_ROOT_xxx -- use xxx as root for names, otherwise use the TypeDef name (always use this with ##)
  • DEF_NAME_STYLE_n -- name suffix: n=0: legacy (_iii where iii=token#); n=1: (iii, 1-based); n=2: no suffix (always use this with ##)
  • DEF_NAME_LIST -- make the default name when added to a list, and the iii will be the idx in the list (note: not maintained if moved) (always use this with ##)

Display, Editing Etc

  • #DEF_CHILD_xxx -- for tree views, makes the taList member xxx's items appear and behave as direct children of the object; you should also override children_()
  • #DEF_CHILDNAME_xxx -- for defchilds, provides a name for buttons etc., ex. datatable has columns, so xxx would be Columns
  • #INLINE Causes this item to be edited in a single line in a dialog box (e.g. for geometry x,y,z) when it is a member of another object
  • #INLINE_DUMP cause this object to be dumped/loaded in a compact inline format: NOTE: you cannot switch this without breaking the loading of existing projects.
  • #EDIT_INLINE Only causes this item to be edited in a single line in a dialog box, but in all other respects it is treated as a normal included class. This is useful for certain complex objects such as arrays and lists that do not otherwise save/load well as INLINES.
  • #HIDDEN_INLINE -- don't show this type inline by default when it is a member of another object
  • #CHILDREN_INLINE -- for lists, displays a compact inline form of children in edit panel
  • #NO_CHILDREN_INLINE -- forces use of the verbose member-based list view
  • #CAT_xxx -- semantic category for choosing objects from list -- see CatNamesObjects for list
  • #LABEL_xxx -- provide an alternate label when this object is displayed (not recommended because it creates 2 names for the same thing, and makes the transition to programming more difficult)
  • #SCOPE_xxx Type of object to use as a scope for this object. The scope restricts token menus and other things to only those things that share a common parent token of the given scope type.
  • #NO_OK Do not present an OK button on the edit dialog for this object.
  • #NO_CANCEL Do not present a CANCEL button on the edit dialog for this object.
  • #MEMB_SHOW, #MEMB_NO_SHOW, #MEMB_HIDDEN, #MEMB_DETAIL, #MEMB_EXPERT -- most of the Member Show directives have counterparts that can be applied to types, and will affect all members of that type
  • #TREEFILT_xxx -- will suppress showing this type (or member) in the tree context Xxx; example: used in the ProgramGroup editor to filter the code items.
  • #SMART_POINTER -- indicates that this class plays the role of a pointer -- currently used to skip such classes when doing a select edit compare, but other uses are possible..

Saving/Loading

  • #COMPRESS store dump file's of this object compressed. Since the save files are text, they can be large, so it is a good idea to auto-compress dump files for large objects.
  • #EXT_xxx Sets the default extension for saving/loading this type to xxx.
  • #FILETYPE_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)
  • #FILER_CONTEXT_xxx -- for filing, a context for saving/restoring info like last_dir; note that you need to put one of these on the object, as well as its typical collection
  • #LINK_SAVE Save the actual contents of this object even when it appears as a link in a list. Usually just the link pointer is saved, and the object is saved later in the group that actually owns it. This overrides this and saves the information in both places -- can be useful if info from the linked object is needed during loading.

Updating

  • #IMMEDIATE_UPDATE Perform an immediate UpdateAfterEdit on this object after loading (i.e., it creates other objects..). Normally, updating happens after all of the other objects have been loaded.
  • #NO_UPDATE_AFTER Don't call UpdateAfterEdit when loading this object (and other places it might automatically get called). Since a list of objects which should be updated after loading is made, small or numerous objects should not be added to this list if not necessary.
  • #DUMP_LOAD_POST Call the Dump_Load_post routine after loading has been fully completed; call will be done in a normal context, not a "is_loading" context. This should be used for anything that has gui operations.
  • #UAE_OWNER -- for taOBase-derivatives, causes UpdateAfterEdit to get sent to owner->ChildUpdateAfterEdit
  • #NO_EXPAND_ALL -- don't expand all in the browser for this list/group during any kind of automatic expansion operation (e.g., when new elements are manually created in the gui by the user -- put this in a list/group that has many sub-elements that should only be seen on specific demand)

Deprecated 3.2 -- Do not use in new code

  • #ARRAY_ALLOC Specific to taList_impl derivatives: this list or group should have saved items created all together during loading (ie., like an array). If actually using array-based memory allocation, this is essential, but otherwise it can only speed things up a little bit.
  • #BUTROWS_x Set the number of button rows to be x, useful if default allocation of number of rows of buttons for edit dialog is not correct
  • #MEMB_IN_GPMENU This indicates that there is a group object as a member of this one who's objects should appear in menus where this object appears.
Personal tools