Module: environment-property-pages Synopsis: Environment property pages Author: Chris Page, 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 /// Some useful constants (move into environment-tools?) define constant $list-separator = ", "; define constant $not-applicable = "not applicable"; define constant $not-available = "not available"; /// Environment object property pages define sideways method frame-property-types (frame :: , object :: subclass()) => (types :: ) #(#"general") end method frame-property-types; define sideways method frame-default-property-type (frame :: , class :: subclass()) => (type :: false-or()) #"general" end method frame-default-property-type; /// environment object general property types define method general-property-types (object :: subclass()) => (types :: ) #(#"name", #"kind", #"source-location", #"contents") end method general-property-types; /// environment object general property page // this is a generic page that shows the object general attributes and // summary information (name, kind, location, contents, etc.). // // the types of information to display are returned by general-property-types(), // which can be specialized, just like frame-property-types(). // object icon //---*** cpage: this is possibly a kludge; windows guidelines say that the // system font size is 8 point, and observations show that the // Explorer property pages use 6 pixels of vertical spacing. // It may be that the spacing should be calculated based on // the actual system font size (perhaps this is what is meant // by "dialog units"). define constant $y-spacing = 6; //---*** cpage: This value is based upon observing the Explorer property // pages. define constant $x-spacing = 20; define class () end class ; define pane () layout (pane) make(, y-spacing: $y-spacing); end pane ; define sideways method make-frame-property-page (frame :: , class :: subclass(), type == #"general") => (page :: ) with-frame-manager (frame-manager(frame)) let displayer = make(); make(, label: "General", id: type, child: displayer) end end method make-frame-property-page; define sideways method refresh-frame-property-page (frame :: , displayer :: , environment-object :: , type == #"general", #key clean?, new-thread? = #t) => () //---*** We should really update this piecemeal ignore(new-thread?); let state = displayer.displayer-state; let new-state :: = case state & state.displayer-state-object == environment-object => state; otherwise => displayer.displayer-state := make(, object: environment-object); end; let clean? = ~displayer.displayer-valid? | clean?; let new-state? = displayer.displayer-new-state?; if (clean? | new-state?) let project = frame.ensure-frame-project; let module = frame-current-module(frame); let property-gadgets = make(); let group-items :: = make(); let property-types = general-property-types(object-class(environment-object)); local method make-stretchy-label (name :: ) => (label ::