Module: environment-framework Synopsis: Environment Framework Author: Andy Armstrong Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// Input focus define open abstract class () end class ; define open generic note-frame-input-focus-changed (frame :: ) => (); define method note-frame-input-focus-changed (frame :: ) => () debug-message("Updating availability of focus commands..."); update-command-availability(frame, ) end method note-frame-input-focus-changed; define method handle-event (frame :: , event :: ) => () next-method(); let sheet = frame-input-focus(frame); note-frame-input-focus-changed(frame) end method handle-event; /// Focus commands define open abstract class () sealed constant slot command-sheet :: , required-init-keyword: sheet:; end class ; define method make-command (command-type :: subclass(), #rest initargs, #key client, server, invoker, results-to) => (command :: ) ignore(client, invoker, results-to); let frame :: = server; let focus = frame-input-focus(frame); //---*** Maybe make the server be the sheet? apply(make, command-type, sheet: focus, initargs) end method make-command; define method do-execute-command (frame :: , command :: ) => () let sheet = command.command-sheet; execute-command-for-focus(sheet, command) end method do-execute-command; define open generic execute-command-for-focus (focus :: type-union(, ), command :: ) => (); define open generic command-available-for-focus? (focus :: type-union(, ), command :: subclass()) => (available? :: ); define method command-available? (frame :: , command :: subclass()) => (available? :: ) let sheet = frame-input-focus(frame); sheet & command-available-for-focus?(sheet, command) end method command-available?; define method execute-command-for-focus (focus :: , command :: ) => () error("No implementation for execute-command-for-focus for %=", command) end method execute-command-for-focus; define method execute-command-for-focus (focus :: , command :: ) => () execute-command-for-focus(sheet-frame(focus), command) end method execute-command-for-focus; define method command-available-for-focus? (focus :: , command :: subclass()) => (available? :: ) #f end method command-available-for-focus?; define method command-available-for-focus? (focus :: , command :: subclass()) => (available? :: ) let frame = sheet-frame(focus); frame & command-available-for-focus?(frame, command) end method command-available-for-focus?;