stk/STklos/Tk/Composite/Lentry.stklos

96 lines
3.1 KiB
Plaintext
Raw Normal View History

1996-09-27 06:29:02 -04:00
;;;;
;;;; L e n t r y . s t k -- Labeled Entry composite widget
;;;;
1999-02-02 06:13:40 -05:00
;;;; Copyright <20> 1993-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
1996-09-27 06:29:02 -04:00
;;;;
;;;; 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.
;;;;
1999-02-02 06:13:40 -05:00
;;;; $Id: Lentry.stklos 1.6 Tue, 02 Feb 1999 09:04:21 +0100 eg $
1998-04-10 06:59:06 -04:00
;;;;
1996-09-27 06:29:02 -04:00
;;;; Author: Erick Gallesio [eg@kaolin.unice.fr]
;;;; Creation date: 22-Mar-1994 13:05
1999-02-02 06:13:40 -05:00
;;;; Last file update: 2-Feb-1999 09:00
1996-09-27 06:29:02 -04:00
1998-04-10 06:59:06 -04:00
(require "Basics")
1996-09-27 06:29:02 -04:00
1998-04-10 06:59:06 -04:00
(select-module STklos+Tk)
1996-09-27 06:29:02 -04:00
1998-04-10 06:59:06 -04:00
;=============================================================================
;
; <Labeled-Entry>
;
;=============================================================================
1996-09-27 06:29:02 -04:00
1998-04-10 06:59:06 -04:00
;;
;; Resources
;;
1999-02-02 06:13:40 -05:00
(option 'add "*LabeledEntry.Entry.Background" "white" "widgetDefault")
(option 'add "*LabeledEntry.Entry.Font" '(Courier-12) "widgetDefault")
(option 'add "*LabeledEntry.Entry.Relief" "sunken" "widgetDefault")
1998-04-10 06:59:06 -04:00
;;
;; Class definition
;;
1996-09-27 06:29:02 -04:00
(define-class <Labeled-entry> (<Tk-composite-widget> <Entry>)
1998-04-10 06:59:06 -04:00
((entry :accessor entry-of)
(label :accessor label-of)
(class :init-keyword :class
:init-form "LabeledEntry")
1996-09-27 06:29:02 -04:00
;; Fictive slots
1998-04-10 06:59:06 -04:00
(title :accessor title
:init-keyword :title
:allocation :propagated
:propagate-to ((label text)))
(title-width :accessor title-width
:init-keyword :title-width
:allocation :propagated
:propagate-to ((label width)))
(title-anchor :accessor title-anchor
:init-keyword :title-anchor
:allocation :propagated
:propagate-to ((label anchor)))
(anchor :accessor anchor
:init-keyword :anchor
:allocation :propagated
:propagate-to (label))
(background :accessor background
:init-keyword :background
:allocation :propagated
:propagate-to (frame entry label))
(foreground :accessor foreground
:init-keyword :foreground
:allocation :propagated
:propagate-to (entry label))
(border-width :accessor border-width
:allocation :propagated
:init-keyword :border-width
:propagate-to (frame))
(relief :accessor relief
:init-keyword :relief
:allocation :propagated
:propagate-to (frame))
(entry-relief :accessor entry-relief
:init-keyword :entry-relief
:allocation :propagated
:propagate-to ((entry relief))) ))
1996-09-27 06:29:02 -04:00
(define-method initialize-composite-widget ((self <Labeled-entry>) initargs frame)
1998-04-10 06:59:06 -04:00
(let* ((e (make <Entry> :parent frame))
1996-09-27 06:29:02 -04:00
(l (make <Label> :parent frame)))
1998-04-10 06:59:06 -04:00
(next-method)
(pack (Id l) :side "left" :padx 2 :pady 2)
(pack e :side "right" :padx 2 :pady 2 :expand #t :fill "x")
1996-09-27 06:29:02 -04:00
(slot-set! self 'Id (slot-ref e 'Id))
(slot-set! self 'entry e)
(slot-set! self 'label l)))
(provide "Lentry")