;;;; ;;;; Combobox.stklos -- A Combobox Implementation ;;;; ;;;; Copyright © 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: 5-Apr-1999 11:22 ;;;; Last file update: 3-Sep-1999 20:12 (eg) (require "Basics") (select-module STklos+Tk) ;============================================================================= ; ; < C o m b o b o x > ; ;============================================================================= ;;;; ;;;; Resources ;;;; (option 'add "*Combobox.Entry.Background" "white" "widgetDefault") ;(option 'add "*Combobox.Entry.Font" '(Courier-12) "widgetDefault") ;;;; ;;;; Globals ;;;; (define *max-item-in-combo* 8) (define *combo-down-arrow* (make-image "down_arrow_8.bm")) (define *combo-up-arrow* (make-image "up_arrow_8.bm")) (define *combo-focus* #f) ;;;; ;;;; Class definition ;;;; (define-class ( ) ((%visible :init-form #f) (entry :accessor entry-of) (button :accessor button-of) (toplevel :accessor toplevel-of) (listbox :accessor listbox-of) (class :init-keyword :class :init-form "Combobox") (command :init-keyword :command :init-form "" :accessor command) ;; Virtual slots (values :accessor values :init-keyword :values :allocation :propagated :propagate-to ((listbox value))) (background :accessor background :init-keyword :background :allocation :propagated :propagate-to (frame button listbox)) (relief :accessor relief :init-keyword :relief :allocation :propagated :propagate-to (frame)) (text-background :accessor text-background :init-keyword :text-background :allocation :propagated :propagate-to ((entry background))))) (define-method initialize-composite-widget ((self ) initargs parent) (let* ((t (make :highlight-thickness 0 :border-width 0)) (l (make :parent t :highlight-thickness 0 :border-width 0)) (e (make :parent parent :highlight-thickness 0 :relief 'flat)) (b (make