;;;; ;;;; L f r a m e . s t k l o s -- Labeled Frame composite widget ;;;; ;;;; Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; Permission to use, copy, modify, distribute,and license this ;;;; software and its documentation for any purpose is hereby granted, ;;;; provided that existing copyright notices are retained in all ;;;; copies and that this notice is included verbatim in any ;;;; distributions. No written agreement, license, or royalty fee is ;;;; required for any of the authorized uses. ;;;; This software is provided ``AS IS'' without express or implied ;;;; warranty. ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 25-Oct-1996 19:31 ;;;; Last file update: 3-Sep-1999 20:13 (eg) (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