Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

edited-slots

Arguments: class-grid-or-object-editor

Returns the edited-slots property value of an object-editor dialog or class-grid widget. The value may be set when creating either of those interface objects by passing the edited-slots initarg, or anytime later by calling (setf edited-slots).

An edited-slots value is a high-level specification that tells an object-editor or class-grid which slots of its edited-class it should edit, and how it should edit each of those slots. When the edited-slots property is set, an object-editor will create or update its widgets as needed for editing those slots as specified, or a class-grid will create or update its grid columns.

When creating an object-editor dialog as a form window in an IDE project, or when creating a class-grid on a form, the edited-slots value can be specified interactively using the IDE's Class Interface Editor dialog. Otherwise the expression must be specified programmatically using the options documented here. For an extended example of specifying an edited-slots expression programmatically, see Creating an Object-Editor Dialog or Class-Grid Programmatically.

Here is small sample edited-slots value:

((last-name
  :edited-type (:variable-char)
  :width 120)
 (date-of-birth
  :edited-type (:date :yyyy/mm/dd))
 (favorite-color
  :edited-type (:single-choice (:red :green :blue :yellow))
  :on-print capitalize-object
  :label "Fave Color")
 (best-friend
  :edited-type (:class-instance patient)
  :width 140)
 ((best-friend date-of-birth)
  :label "Best Friend's Birth Date"
  :edited-type (:date :yyyy/mm/dd)))

An edited-slots value is a list where each element of the list describes how to edit a particular slot. We'll call these elements slot entries here. A slot entry is a list where the first element is a slot reference, and the rest of the list is an options plist.

A slot reference is either a slot name or a list of slot names. When it is a slot name, it should be the name of a slot of the edited-class of the object-editor or class-grid. In that case, the widget or grid column that is created will directly access that slot of the displayed instances. When it is a list of slot names, then the widget or grid column will indirectly access a slot of some other object; see Editing Slots Indirectly below.

An options plist consists of alternating option keywords and option values that determine how the generated user interface will edit a particular slot. A special option is the :edited-type option that determines the type of widget that will be used and such things as what choices it might offer. Other options are generally geared toward the look and feel.

The :edited-type Option

An :edited-type value is a list where the first element is a keyword that indicates which basic type of editing to use, such as :variable-char or :class-instance. The rest of the list contains zero, one, or two parameters, depending on the basic type. Here is a list of all of the basic editing types, their meanings, and what else should be in the list for each type.

Other Options

Here are the options other than the special :edited-type option documented just above.

Editing Slots Indirectly

When a slot reference is a list of slot names, the associated widget or grid column will indirectly edit a slot of some object other than the one being displayed by the object-editor or class-grid. It does this by taking the first slot-name in the list and reading the value of that slot of the displayed instance. If there are further slot names in the list, then the value that was read is expected to be a first-class object (a class instance), and the next slot in the list is read from that object. That continues until the last slot is read.

For example, if an object-editor is editing a patient, and the slot reference for one of its widgets is (hospital ceo phone-number), then the widget will read what should be a hospital object from the hospital slot of the patient that the object-editor is currently displaying, then read a CEO object from the ceo slot of that hospital object, and then read a value from the phone-number slot of that CEO object. This will hopefully be the phone number of the CEO of the hospital of the patient. If the user edits the value of the widget and saves it, then this would change the CEO's phone number even though the dialog is editing a patient. For that reason, it's probably usually appropriate to use static (non-editable) widgets for indirect slot references.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version