Module: environment-tools Synopsis: Environment tools Author: Chris Page 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 /// Primary frame define frame (, , , // NB needed for choose-matching-frame used in environment-primary-frame , ) tool-bar (frame) make-environment-tool-bar(frame, max-width: $fill); command-table (frame) *primary-frame-command-table*; keyword max-width: = $fill; keyword x: = 0; keyword y: = 0; keyword width: = 2000; //---*** andrewa: quick hack! keyword fixed-height?: = #t; keyword icon: = $main-window-small-icon; keyword frame-class-name:, init-value: #"primary-frame"; end frame ; define window-settings primary-window :: = "Primary Window"; define method initialize (frame :: , #key) => () next-method(); command-enabled?(frame-attach-application, frame) := just-in-time-debugging?(); if (release-internal?()) add-command-table-menu-item (*primary-frame-command-table*, "Internal", , *primary-frame-internal-command-table*, after: "Window") end end method initialize; // The startup action is performed via creation of the primary frame. define method handle-event (frame :: , event :: ) => () next-method(); handle-environment-startup(frame) end method handle-event; /// Primary window commands that affect all windows //--- cpage: 1997.10.10 Provide a default method so that we can call this on // all frames. Eventually, we should have a formal model for // documents, and we can iterate over them instead of frames. define sideways method frame-save-all (frame :: ) => () ignore(frame); end method frame-save-all; // Save All define method frame-save-all (frame :: ) => () //--- cpage: 1997.09.29 This isn't quite right. We probably need a method // on that iterates over instances of // (the fictional class) , registered centrally when // frames create or open documents. do-frames(method (_frame :: ) unless (frame = _frame) frame-save-all(_frame) end end method); end method frame-save-all; // Exit the environment define method handle-event (frame :: , event :: ) => () when (frame-exit-application(frame)) next-method(); end; end method handle-event; define method handle-event (frame :: , event :: ) => () next-method(); broadcast($environment-channel, make()); end method handle-event; /// Toolbar buttons // New file buttons define variable $new-text-file-bitmap :: = "New Text File"; define variable $new-project-file-bitmap :: = "New Project"; define constant $new-text-file-title = "New Text File"; define constant $new-project-file-title = "New Project"; define method make-new-file-tool-bar-buttons (frame :: ) => (buttons :: ) vector(make(