;; -*-Mode: Scheme;-*- ;; ;; Copyright (C) 1995, 1996 Josh MacDonald ;; ;; Permission to use, copy, and/or distribute this software and its ;; documentation for any purpose and without fee is hereby granted, provided ;; that both the above copyright notice and this permission notice appear in ;; all copies and derived works. Fees for distribution or use of this ;; software or derived works may only be charged with express written ;; permission of the copyright holder. ;; This software is provided ``as is'' without express or implied warranty. ;; ;; $Id: env-toplev.stk,v 1.1 2003/12/19 22:57:28 willchu Exp $ ;; $ProjectHeader: stk ucb2.29 Thu, 11 Sep 2003 14:07:59 -0700 hilfingr $ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; TOPLEVEL WIDGET ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require "placement") (unless (provided? "env-toplev") (define PLACEMENT_INITIAL_POSITION (make-point 1250 1250)) (define ENVDRAW_BITMAP (format #f "@~a/icons/envdraw" *EnvDraw-library*)) (define (update-object-label t obj) (slot-set! (object-label-of t) 'text (viewed-rep (safen-list obj)))) (define-class () ((canv :getter canvas-of) (menu :getter menu-of) (xscrollbar :getter xscrollbar-of) (yscrollbar :getter yscrollbar-of) (startx :getter scroll-startx-of) (starty :getter scroll-starty-of) (listbox :getter listbox-of) (obj-label :getter object-label-of) (metro :getter metropolis-of :initform #f) (color :initform (cadr COLORS_LIST) :getter color-of) (table :initform (make-hash-table) :getter table-of))) (define-method initialize((self ) initargs) (next-method) (prepend! self *toplevel-views*) (slot-set! self 'title "EnvDraw") (slot-set! self 'min-size '(600 700)) (slot-set! self 'max-size '(2000 1600)) (slot-set! self 'geometry ENV_INITSIZE) (let* ((frame (make :parent self :background MENU_BACKGROUND_COLOR)) (optionframe (make :parent frame :background MENU_BACKGROUND_COLOR)) (menub (make :parent optionframe :relief 'raised :text "Options" :background MENU_BACKGROUND_COLOR :active-background MENU_ABACKGROUND_COLOR :foreground MENU_FOREGROUND_COLOR)) (menu (make :parent menub :activebackground MENU_ABACKGROUND_COLOR :foreground MENU_FOREGROUND_COLOR :background MENU_BACKGROUND_COLOR)) (cmenu (make :parent menu :activebackground MENU_ABACKGROUND_COLOR :foreground MENU_FOREGROUND_COLOR :background MENU_BACKGROUND_COLOR)) (label (make