Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## menu-items-for-combo-box-range

Arguments: range-object-list row column

This generic function is called when a grid combo-box cell (a cell in a `combo-box-column-mixin` column) is about to show its choices to the user as a pop-up menu that is displayed somewhat like a `combo-box`. The method returns a list of menu-items to display. The menu-values are a list of the actual choices for the cell, as returned by the column's range-reader function called on the row's data-object.

The default method creates menu-items with the print-name of each choice displayed in the menu. An application could add a method to this generic function to instead create menu-items that have some sort of alternative string displayed on the menu for each choice.

Here's an example of defining a custom menu-items-for-combo-box-range method for an application's own combo-box grid-column subclass. The method adds a sequential number (1 through N) to each of the choices that are displayed to the user.

    (defclass my-combo-box-column
              (combo-box-column-mixin grid-column)())

    (defmethod menu-items-for-combo-box-range
        (range-object-list row (column my-combo-box-column))
      (declare (ignore row))
      (let* ((number 0))
        (mapcar #'(lambda (object)
                    (make-instance 'menu-item
                      :value object
                      :title (format nil "~a ~a" (incf number) object)))
          range-object-list)))

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

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version