;;;; ;;;; L f r a m e . s t k l o s -- Labeled Frame composite widget ;;;; ;;;; Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; 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: Lframe.stklos 1.2 Sun, 01 Feb 1998 22:14:16 +0000 eg $ ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 25-Oct-1996 19:31 ;;;; Last file update: 30-Jan-1998 00:00 (require "Basics") (select-module STklos+Tk) ;============================================================================= ; ; < L a b e l e d - F r a m e > ; ;============================================================================= ;;;; ;;;; Resources ;;;; (option 'add "*LabeledFrame.Box.Relief" "ridge" "widgetDefault") (option 'add "*LabeledFrame.Box.BorderWidth" 2 "widgetDefault") ;;;; ;;;; Utilities ;;;; (define (configure-labeled-frame lf box filler label) (let ((width (winfo 'width label)) (height (winfo 'height label))) ;; Compute a new width and height for the filler (slot-set! filler 'height (+ (/ height 2) 2)) (slot-set! filler 'width width) (pack filler :expand #f :fill "x" :side "top") ;; Place the label on the frame (place label :in box :x 10 :y 0 :anchor "w"))) ;;;; ;;;; Class definition ;;;; (define-class ( ) ((class :init-keyword :class :init-form "LabeledFrame") (fill-frame) (box-frame :accessor box-frame-of) (label :accessor label-of) ;; Fictive slots (title :accessor title :init-keyword :title :allocation :propagated :propagate-to ((label text))) (font :accessor font :init-keyword :font :allocation :propagated :propagate-to (label)) (background :accessor background :init-keyword :background :allocation :propagated :propagate-to (frame label fill-frame box-frame)) (foreground :accessor foreground :init-keyword :foreground :allocation :propagated :propagate-to (label)) (width :accessor width :init-keyword :width :allocation :propagated :propagate-to (frame)) (height :accessor height :init-keyword :height :allocation :propagated :propagate-to (frame)))) (define-method initialize-composite-widget ((self ) initargs frame) (let* ((box (make :parent frame :class "Box")) (filler (make :parent box :relief "flat")) (lab (make