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

confirm-grid-subsection-deletion

Arguments: grid-widget selected-subsections

This generic function is called when the user presses the delete key while a grid-widget has the keyboard focus, and whenever delete-selected-subsections is called with a true confirm argument (as it is by the delete key). Its purpose is to ask the user whether to proceed with deleting any deletable rows or columns that are selected. An application should not call this function, but may override the default method in order to customize the manner in which the user is asked for confirmation, or even to suppress the delete key behavior altogether.

grid-widget is the grid-widget that has the keyboard focus when the delete key is pressed. selected-subsections is a list of any grid-rows and grid-columns of the grid that are both deletable and selected. The method should return true if all of the selected-subsections should be deleted, and nil if not.

The default method shows a warning dialog if selected-subsections is the empty list, and otherwise shows a modal dialog with a generic message asking the user whether to proceed with the deletion. Here is the default method:

(defmethod confirm-grid-subsection-deletion ((grid-widget grid-widget)
                                             selected-subsections)
  (if* selected-subsections
     then (y-or-n-dialog "Delete rows and / or columns ~a ?"
                         (mapcar #'name selected-subsections))
     else (pop-up-message-dialog
           (window grid-widget) "Nothing to Delete"
           "There are no selected and deletable rows or columns to delete."
           warning-icon "~OK")
          nil))

All interactive deletion could be suppressed (even if rows and columns are selectable for other purposes) by simply always returning nil from this function.

The calling of this generic function is never suppressed by adding custom cell-key-down methods. It could be suppressed by overriding the default virtual-key-down method for the grid-drawing-pane of the window of the grid-widget, though this would be modifying the keypress behavior of the grid at a low level.

See also select-subsection, deselect-subsection, and deletable.


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