Commit of 3.99.3 version
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
/* XPM */
|
||||
static char * box_minux_xpm[] = {
|
||||
"9 9 2 1",
|
||||
" c black",
|
||||
". c white",
|
||||
" ",
|
||||
" ....... ",
|
||||
" ....... ",
|
||||
" ....... ",
|
||||
" . . ",
|
||||
" ....... ",
|
||||
" ....... ",
|
||||
" ....... ",
|
||||
" "};
|
||||
@@ -0,0 +1,14 @@
|
||||
/* XPM */
|
||||
static char * box_plus_xpm[] = {
|
||||
"9 9 2 1",
|
||||
" c black",
|
||||
". c white",
|
||||
" ",
|
||||
" ....... ",
|
||||
" ... ... ",
|
||||
" ... ... ",
|
||||
" . . ",
|
||||
" ... ... ",
|
||||
" ... ... ",
|
||||
" ....... ",
|
||||
" "};
|
||||
@@ -0,0 +1,25 @@
|
||||
/* XPM */
|
||||
static char * diropen_xpm[] = {
|
||||
"16 16 5 1",
|
||||
" s None c None",
|
||||
". c grey51",
|
||||
"X c white",
|
||||
"o c goldenrod1",
|
||||
"O c grey4",
|
||||
" ",
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XooooX...... ",
|
||||
" .XoooooXXXXX.O ",
|
||||
" .Xoooooooooo.O ",
|
||||
"...........oo.O ",
|
||||
".XXXXXXXXX.Oo.O ",
|
||||
".XoooooooooO..O ",
|
||||
" .Xoooooooo.O.O ",
|
||||
" .XoooooooooO.O ",
|
||||
" .Xoooooooo.OO ",
|
||||
" ...........OO ",
|
||||
" OOOOOOOOOOOO ",
|
||||
" ",
|
||||
" "};
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Author: Erick Gallesio [eg@unice.fr]
|
||||
# Creation date: ???
|
||||
# Last file update: 30-Apr-1998 16:28
|
||||
# Last file update: 27-Sep-1998 17:37
|
||||
|
||||
|
||||
include ../config.make
|
||||
@@ -19,7 +19,7 @@ install:
|
||||
-if [ ! -d $(STK_IMAGES) ] ; then mkdir -p $(STK_IMAGES); fi
|
||||
-if [ ! -d $(STK_STK) ] ; then mkdir -p $(STK_STK); fi
|
||||
-if [ ! -d $(STK_STK_MATCH) ] ; then mkdir -p $(STK_STK_MATCH); fi
|
||||
for i in *.stk *.stklos prolog.ps STk.init; \
|
||||
for i in *.stk *.stklos STk.init; \
|
||||
do \
|
||||
sed -e 's=/usr/local/lib/stk=$(libdir)=' \
|
||||
-e 's=/usr/local/bin=$(bindir)=' $$i > $(STK_STK)/$$i ;\
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
;;;; b a s e 6 4 . s t k -- Base 64 support
|
||||
;;;;
|
||||
;;;; Copyright © 1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;;
|
||||
;;;; 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: base64.stk 1.1 Mon, 20 Jul 1998 19:44:40 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 20-Jul-1998 18:43
|
||||
;;;; Last file update: 20-Jul-1998 19:15
|
||||
|
||||
|
||||
(if (symbol-bound? '%init-base64)
|
||||
;; Html module is in the core interpreter
|
||||
(%init-base64)
|
||||
;; Try to load hash table dynamically
|
||||
(load (string-append "base64." *shared-suffix*)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Public procedures
|
||||
;;;
|
||||
(define base64-encode-string #f)
|
||||
(define base64-decode-string #f)
|
||||
|
||||
|
||||
;;;
|
||||
;;; Impl.
|
||||
;;;
|
||||
(let ((encode/decode (lambda (op)
|
||||
(lambda (str)
|
||||
(let ((in (open-input-string str))
|
||||
(out (open-output-string)))
|
||||
(op in out)
|
||||
(get-output-string out))))))
|
||||
|
||||
(set! base64-encode-string (encode/decode base64-encode))
|
||||
(set! base64-decode-string (encode/decode base64-decode)))
|
||||
|
||||
(provide "base64")
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
;;;; permission of the copyright holder.
|
||||
;;;; This software is provided ``as is'' without express or implied warranty.
|
||||
;;;;
|
||||
;;;; $Id: bigloo.stk 1.3 Thu, 30 Apr 1998 14:16:40 +0000 eg $
|
||||
;;;; $Id: bigloo.stk 1.3 Thu, 30 Apr 1998 16:16:40 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 28-Oct-1997 11:09
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
;;;;
|
||||
;;;; c l a s s - b r o w s e r . s t k l o s -- Class browser
|
||||
;;;;
|
||||
;;;; Copyright © 1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;;
|
||||
;;;; 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: class-browser.stklos 1.1 Sat, 26 Sep 1998 19:19:52 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 25-Aug-1998 20:12
|
||||
;;;; Last file update: 26-Sep-1998 19:07
|
||||
|
||||
(require "Tk-classes")
|
||||
(require "method-editor")
|
||||
|
||||
(define-module class-browser
|
||||
(import STklos STklos+Tk Tk)
|
||||
(export class-browser browse-class)
|
||||
|
||||
(define *browser-current* #f)
|
||||
(define *browser-notepad* #f)
|
||||
(define *browser-tree* #f)
|
||||
(define *browser-window* #f)
|
||||
|
||||
(define-class <Inheritance-item> (<Hierarchy-item>) ())
|
||||
|
||||
(define-class <Inheritance-tree> (<Hierarchy-tree>)
|
||||
((entry :init-form #f)
|
||||
(items-type :init-form <Inheritance-item>)))
|
||||
|
||||
(define-method open-item((self <Inheritance-item>))
|
||||
(unless (slot-ref self 'open)
|
||||
(let* ((data (slot-ref self 'data))
|
||||
(children (slot-ref self 'children))
|
||||
(hierarchy (slot-ref self 'parent))
|
||||
(subclasses (class-direct-subclasses data)))
|
||||
(when (and (null? children) (not (null? subclasses)))
|
||||
(for-each (lambda (x)
|
||||
(if (null? (class-direct-subclasses x))
|
||||
(add-leave hierarchy self x)
|
||||
(add-node hierarchy self x)))
|
||||
(sort subclasses
|
||||
(lambda (x y)
|
||||
(string<? (symbol->string (class-name x))
|
||||
(symbol->string (class-name y))))))))
|
||||
;; Do the redisplay
|
||||
(next-method)))
|
||||
|
||||
(define-method close-item((self <Inheritance-item>))
|
||||
(slot-set! self 'children '())
|
||||
(next-method))
|
||||
|
||||
(define-method label-item((self <Inheritance-item>))
|
||||
(let* ((data (slot-ref self 'data))
|
||||
(len (length (class-direct-supers data)))
|
||||
(name (class-name data)))
|
||||
(if (> len 2)
|
||||
(format #f "~A : ~A" name len) ; class has multiple super-classes
|
||||
name)))
|
||||
|
||||
(define-method select-item ((self <Inheritance-item>))
|
||||
(let* ((data (slot-ref self 'data))
|
||||
(parent (slot-ref self 'parent))
|
||||
(entry (slot-ref parent 'entry)))
|
||||
(unless (equal? data *browser-current*)
|
||||
(set! *browser-current* data)
|
||||
;; Update all the listboxes with information relative to the current class
|
||||
(select-tab (current-tab *browser-notepad*))
|
||||
(slot-set! entry 'value (class-name data))
|
||||
(next-method))))
|
||||
|
||||
(define (create-hierarchy top)
|
||||
(let* ((f (make <Frame> :parent top))
|
||||
(e (make <Labeled-Entry> :parent f :title "Current Class"
|
||||
:relief "ridge" :border-width 2))
|
||||
(h (make <Inheritance-tree> :parent f :relief "raised" :border-width 2)))
|
||||
(pack e :expand #f :fill "x" :padx 3 :pady 3)
|
||||
(pack h :expand #t :fill "both")
|
||||
(slot-set! h 'entry e)
|
||||
(add-node h #f <top>)
|
||||
(set! *browser-tree* h)
|
||||
f))
|
||||
|
||||
;=============================================================================
|
||||
|
||||
(define (create-notepad toplevel)
|
||||
(define lbs (make-vector 8))
|
||||
(define n (make <Notepad> :parent toplevel))
|
||||
(define index 0)
|
||||
|
||||
(define (create-listbox parent txt index)
|
||||
(let* ((f (make <Frame> :parent parent))
|
||||
(l (make <Label> :parent f :text txt))
|
||||
(lb (make <Scroll-listbox> :parent f)))
|
||||
(set! (background (listbox-of lb)) "white")
|
||||
(pack l :fill "x" :expand #f)
|
||||
(pack lb :fill "both" :expand #t)
|
||||
(vector-set! lbs index lb)
|
||||
f))
|
||||
|
||||
(define (internal-page index txt1 txt2 proc1 proc2)
|
||||
(lambda (parent tab)
|
||||
;; If this is the first call for this page, instanciante it
|
||||
(unless (page tab)
|
||||
(let* ((paned (make <HPaned> :parent parent))
|
||||
(f1 (create-listbox (top-frame-of paned) txt1 index))
|
||||
(f2 (create-listbox (bottom-frame-of paned) txt2 (+ index 1))))
|
||||
(pack f1 f2 :expand #t :fill "both")
|
||||
(set! (page tab) paned)))
|
||||
;; Executed each time we select this page
|
||||
(pack (page tab) :pady 5 :padx 3 :fill "both" :expand #t)
|
||||
(when *browser-current*
|
||||
(proc1) ;; To fill the upper part of the page
|
||||
(proc2)))) ;; ........... lower ................
|
||||
|
||||
(define (new label txt1 txt2 proc1 proc2)
|
||||
(let ((index (- index 2))) ; UGLY! we know index has been ++ by fill-lisbox
|
||||
(make <Notepad-Tab>
|
||||
:parent n :text label :font '(Helvetica 10 Bold)
|
||||
:action (internal-page index txt1 txt2 proc1 proc2))))
|
||||
|
||||
(define convert-method
|
||||
(lambda (m)
|
||||
(format #f "~A ~S" (generic-function-name(method-generic-function m))
|
||||
(map* class-name (method-specializers m)))))
|
||||
|
||||
(define (sort-symbols l)
|
||||
(sort l (lambda (s1 s2)
|
||||
(string<? (symbol->string (cdr s1)) (symbol->string (cdr s2))))))
|
||||
|
||||
(define (sort-strings l)
|
||||
(sort l (lambda (s1 s2) (string<? (cdr s1) (cdr s2)))))
|
||||
|
||||
(define (show-slot s)
|
||||
(let* ((top (make <Toplevel> :title "Slot Description"))
|
||||
(edit (make <Scheme-text> :parent top :relief "ridge" :border-width 3))
|
||||
(quit (make <Button> :parent top :text "Quit"
|
||||
:command (lambda () (destroy top)))))
|
||||
(set! (value edit) (format #f "Slot ``~A'' is defined as:\n\n~A"
|
||||
(slot-definition-name s) (pp s 50 #f)))
|
||||
(set! (background (text-of edit)) "white")
|
||||
;; change title to differentiate it from the body
|
||||
(tag-add (make <Text-tag> :parent edit :underline #t :foreground "brown3")
|
||||
"0.0" "2.0")
|
||||
;; pack everybody
|
||||
(pack edit :expand #t :fill 'both)
|
||||
(pack quit :expand #f :anchor 'w :ipadx 20)))
|
||||
|
||||
|
||||
(define (fill-listbox convert build-list sortproc selectproc)
|
||||
(let* ((idx index)
|
||||
(res (lambda ()
|
||||
(let* ((lb (vector-ref lbs idx))
|
||||
(l1 (build-list *browser-current*))
|
||||
(l2 (map convert l1))
|
||||
(l3 (sortproc (map cons l1 l2))))
|
||||
;; l1 is the list of objects. l2 is the list of the names of
|
||||
;; these objects (to be inserted in the listbox). l3 is the
|
||||
;; a A-list built from l1 and l2. l3 is sorted on the values
|
||||
;; of l2.
|
||||
(bind lb "<Double-1>"
|
||||
(lambda ()
|
||||
(let ((active (listbox-index lb "active")))
|
||||
(selectproc (car (list-ref l3 active))))))
|
||||
(set! (value lb) (map cdr l3))))))
|
||||
(set! index (+ index 1))
|
||||
res))
|
||||
|
||||
;;
|
||||
;; Create-notepad starts here
|
||||
;;
|
||||
(new "Super\nClasses" "Direct Super Classes" "Class Precedence List"
|
||||
(fill-listbox class-name class-direct-supers sort-symbols browse-class)
|
||||
(fill-listbox class-name class-precedence-list (lambda(l)l) browse-class))
|
||||
|
||||
(new "Sub\nClasses" "Direct Subclasses" "All Subclasses"
|
||||
(fill-listbox class-name class-direct-subclasses sort-symbols
|
||||
browse-class)
|
||||
(fill-listbox class-name class-subclasses sort-symbols browse-class))
|
||||
|
||||
(new "Slots" "Direct Slots" "All Slots"
|
||||
(fill-listbox slot-definition-name class-direct-slots sort-symbols
|
||||
show-slot)
|
||||
(fill-listbox slot-definition-name class-slots sort-symbols show-slot))
|
||||
|
||||
(new "Methods" "Direct Methods" "All Methods"
|
||||
(fill-listbox convert-method class-direct-methods sort-strings
|
||||
method-editor)
|
||||
(fill-listbox convert-method class-methods sort-strings method-editor))
|
||||
|
||||
(set! *browser-notepad* n)
|
||||
n)
|
||||
|
||||
;=============================================================================
|
||||
|
||||
(define (init-class-browser . parent)
|
||||
(let* ((top (if (null? parent)
|
||||
(make <Toplevel> :title "** STklos Class browser **")
|
||||
(car parent)))
|
||||
(paned (make <VPaned> :parent top :width 700 :height 400 :fraction .4))
|
||||
(h (create-hierarchy (left-frame-of paned)))
|
||||
(pad (create-notepad (right-frame-of paned)))
|
||||
(quit (make <Button> :parent top :text "Quit"
|
||||
:command (lambda() (destroy top)))))
|
||||
|
||||
(pack h pad paned :fill 'both :expand #t)
|
||||
(pack quit :anchor 'w :ipadx 20)
|
||||
(wm 'protocol (Id top) "WM_DELETE_WINDOW" (lambda ()
|
||||
(set! *browser-window* #f)
|
||||
(destroy top)))
|
||||
(set! *browser-window* top)))
|
||||
|
||||
(define (browse-class class)
|
||||
(unless *browser-window* (init-class-browser))
|
||||
(let* ((cpl (reverse (class-precedence-list class)))
|
||||
(proc (lambda (i)
|
||||
(let ((data (slot-ref i 'data)))
|
||||
(when (memq data cpl)
|
||||
(open-item i)
|
||||
(if (eq? data class) (select-item i)))))))
|
||||
(walk-hierarchy *browser-tree* proc)))
|
||||
|
||||
(define (class-browser . parent)
|
||||
(apply init-class-browser parent)
|
||||
(browse-class <top>))
|
||||
)
|
||||
|
||||
(import class-browser)
|
||||
|
||||
(define class-browser (with-module class-browser class-browser))
|
||||
|
||||
(provide "class-browser")
|
||||
+11
-9
@@ -1,7 +1,7 @@
|
||||
;;;;
|
||||
;;;; Entries bindings and procs
|
||||
;;;;
|
||||
;;;; Copyright © 1993-1997 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;; Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;;
|
||||
;;;; Permission to use, copy, and/or distribute this software and its
|
||||
;;;; documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -17,7 +17,7 @@
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 17-May-1993 12:35
|
||||
;;;; Last file update: 27-Aug-1997 15:23
|
||||
;;;; Last file update: 27-Sep-1998 12:04
|
||||
;;;;
|
||||
|
||||
(select-module Tk)
|
||||
@@ -334,6 +334,9 @@
|
||||
(define-binding "Entry" "<<Clear>>" (|W|)
|
||||
(|W| 'delete 'sel.first 'sel.last))
|
||||
|
||||
(define-binding "Entry" "<<PasteSelection>>" (|W| x)
|
||||
(when (or *tk-strict-Motif* (not tk::mouse-moved))
|
||||
(Tk:entry-paste |W| x)))
|
||||
|
||||
(define-binding "Entry" "<1>" (|W| x)
|
||||
(Tk:entry-button-1 |W| x)
|
||||
@@ -469,10 +472,12 @@
|
||||
(bind "Entry" "<KP_Enter>" nop)
|
||||
(bind "Entry" "<Tab>" nop))
|
||||
|
||||
|
||||
(define-binding "Entry" "<Insert>" (|W|)
|
||||
(catch
|
||||
(Tk:entry-insert |W| (selection 'get :displayof |W|))))
|
||||
;; On Windows, paste is done using Shift-Insert. Shift-Insert already
|
||||
;; generates the <<Paste>> event, so we don't need to do anything here.
|
||||
(if (eqv? (os-kind) 'Unix)
|
||||
(define-binding "Entry" "<Insert>" (|W|)
|
||||
(catch
|
||||
(Tk:entry-insert |W| (selection 'get :displayof |W|)))))
|
||||
|
||||
;; Additional emacs-like bindings:
|
||||
|
||||
@@ -531,6 +536,3 @@
|
||||
(set! tk::mouse-moved #t))
|
||||
(|W| 'scan 'dragto x))
|
||||
|
||||
(define-binding "Entry" "<ButtonRelease-2>" (|W| x)
|
||||
(when (or *tk-strict-Motif* (not tk::mouse-moved))
|
||||
(Tk:entry-paste |W| x)))
|
||||
|
||||
+3
-2
@@ -4,7 +4,7 @@
|
||||
;;;; For backward compatibility ...
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; Copyright © 1993-1997 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;; Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;;
|
||||
;;;; Permission to use, copy, and/or distribute this software and its
|
||||
;;;; documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -16,7 +16,7 @@
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 16-Jun-1996 22:37
|
||||
;;;; Last file update: 27-Aug-1997 18:34
|
||||
;;;; Last file update: 21-Jul-1998 12:48
|
||||
|
||||
(select-module Tk)
|
||||
|
||||
@@ -38,5 +38,6 @@
|
||||
((string? s) (if (string=? s "") (fct file #f) (err)))
|
||||
(ELSE (err)))))))
|
||||
|
||||
(define Tk:fileevent fileevent)
|
||||
|
||||
|
||||
|
||||
+17
-3
@@ -11,11 +11,11 @@
|
||||
;;;; permission of the copyright holder.
|
||||
;;;; This software is provided ``as is'' without express or implied warranty.
|
||||
;;;;
|
||||
;;;; $Id: init.stk 1.15 Tue, 19 May 1998 10:44:58 +0000 eg $
|
||||
;;;; $Id: init.stk 1.17 Sat, 26 Sep 1998 19:19:52 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@kaolin.unice.fr]
|
||||
;;;; Creation date: ??-Sep-1993 ??:??
|
||||
;;;; Last file update: 14-May-1998 22:12
|
||||
;;;; Last file update: 26-Sep-1998 17:22
|
||||
;;;;
|
||||
|
||||
;;;==============================================================================
|
||||
@@ -440,6 +440,19 @@
|
||||
(define-macro (multiple-value-bind vars form . body)
|
||||
`(apply (lambda ,vars ,@body) ,form))
|
||||
|
||||
(define (map* fn . l) ; A map which accepts dotted lists (arg lists
|
||||
(cond ; must be "isomorph"
|
||||
((null? (car l)) '())
|
||||
((pair? (car l)) (cons (apply fn (map car l))
|
||||
(apply map* fn (map cdr l))))
|
||||
(else (apply fn l))))
|
||||
|
||||
(define (for-each* fn . l) ; A for-each which accepts dotted lists (arg lists
|
||||
(cond ; must be "isomorph"
|
||||
((null? (car l)) '())
|
||||
((pair? (car l)) (apply fn (map car l)) (apply for-each* fn (map cdr l)))
|
||||
(else (apply fn l))))
|
||||
|
||||
(define (os-kind)
|
||||
(case (machine-type)
|
||||
(("MS_Win32") 'Windows)
|
||||
@@ -455,7 +468,8 @@
|
||||
(cond
|
||||
((null? l) res)
|
||||
((memv (car l) res) (rem-dupl (cdr l) res))
|
||||
(ELSE (rem-dupl (cdr l) (cons (car l) res)))))))
|
||||
(ELSE (rem-dupl (cdr l) (cons (car l)
|
||||
res)))))))
|
||||
(rem-dupl l '())))
|
||||
|
||||
(define (set-union l1 l2)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
;;;; l o c a l e . s t k -- Locale support
|
||||
;;;;
|
||||
;;;; Copyright © 1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;;
|
||||
;;;; 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: locale.stk 1.1 Sat, 26 Sep 1998 19:19:52 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 19-Sep-1998 13:17
|
||||
;;;; Last file update: 19-Sep-1998 13:18
|
||||
|
||||
|
||||
(if (symbol-bound? '%init-locale)
|
||||
;; Locale module is in the core interpreter
|
||||
(%init-locale)
|
||||
;; Try to load hash table dynamically
|
||||
(load (string-append "locale." *shared-suffix*)))
|
||||
|
||||
(provide "locale")
|
||||
+18
-15
@@ -15,7 +15,7 @@
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 17-May-1993 12:35
|
||||
;;;; Last file update: 27-Apr-1998 12:34
|
||||
;;;; Last file update: 27-Sep-1998 12:14
|
||||
;;;;
|
||||
|
||||
(select-module Tk)
|
||||
@@ -659,23 +659,25 @@
|
||||
;; Can't traverse into or out of a cascaded menu. Go to the next
|
||||
;; or previous menubutton, if that makes sense.
|
||||
(let* ((buttons (winfo 'children [winfo 'parent tk::posted-mb]))
|
||||
(len (length buttons)))
|
||||
(let loop ((i (- count (length (member tk::posted-mb buttons)))))
|
||||
(while (< i 0) (set! i (+ i len)))
|
||||
|
||||
(while (>= i len) (set! i (- i len)))
|
||||
|
||||
(len (length buttons))
|
||||
(i (do ((i 0 (+ i 1)))
|
||||
((eq? tk::posted-mb (list-ref buttons i)) i)
|
||||
'nothing)))
|
||||
(let loop ((i (modulo (+ i count) len))
|
||||
(cnt 0))
|
||||
(let ((mb (list-ref buttons i)))
|
||||
(unless (and (string=? [winfo 'class mb] "Menubutton")
|
||||
(if (or (and (string=? [winfo 'class mb] "Menubutton")
|
||||
(not (string=? [tk-get mb :state] "disabled"))
|
||||
(tk-get mb :menu)
|
||||
(not (equal? ((tk-get mb :menu) 'index 'last) "none")))
|
||||
(when (eq? mb tk::posted-mb)
|
||||
(set! continue #f))))
|
||||
(loop (+ i count))))
|
||||
(when continue
|
||||
(Tk:menu-button-post mb)
|
||||
(Tk:menu-first-entry (tk-get mb :menu))))))
|
||||
(eq? mb tk::posted-mb))
|
||||
;; found a menu to post
|
||||
(begin
|
||||
(Tk:menu-button-post mb)
|
||||
(Tk:menu-first-entry (tk-get mb :menu)))
|
||||
;; no menu, search another one, if possible
|
||||
(if (< cnt len)
|
||||
(loop (modulo (+ i count) len) (+ cnt 1))))))))))
|
||||
|
||||
;; Tk:menu-next-entry --
|
||||
;; Activate the next higher or lower entry in the posted menu,
|
||||
@@ -1136,7 +1138,8 @@
|
||||
:relief "raised"
|
||||
:borderwidth 2
|
||||
:highlightthickness 2
|
||||
:anchor "c"))
|
||||
:anchor "c"
|
||||
:direction "flush"))
|
||||
(m (menu menu-name :tearoff #f)))
|
||||
(for-each (lambda (x)
|
||||
(m 'add 'radiobutton :label x :variable var-name :environment env))
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
;;;;
|
||||
;;;; m e t h o d - e d i t o r . s t k l o s -- Editor for STklos methods and gf
|
||||
;;;;
|
||||
;;;; Copyright © 1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
;;;;
|
||||
;;;; 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: method-editor.stklos 1.1 Sat, 26 Sep 1998 19:19:52 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 24-Sep-1998 16:32
|
||||
;;;; Last file update: 26-Sep-1998 17:28
|
||||
|
||||
(require "Tk-classes")
|
||||
|
||||
;;;
|
||||
;;; Utilities
|
||||
;;;
|
||||
|
||||
(define (method->list m)
|
||||
(let ((gf (method-generic-function m)))
|
||||
(if gf
|
||||
(let ((proc (uncode (procedure-body (method-procedure m))))
|
||||
(spec (map* class-name (method-specializers m))))
|
||||
`(define-method ,(generic-function-name gf) ,(map* list (cdadr proc) spec)
|
||||
,@(cddr proc)))
|
||||
;; Method with no associated method
|
||||
'())))
|
||||
|
||||
;=============================================================================
|
||||
;
|
||||
; m e t h o d - e d i t o r
|
||||
;
|
||||
;=============================================================================
|
||||
(define-method method-editor ((m <method>) parent)
|
||||
|
||||
(define (make-buttons parent edit env)
|
||||
(let* ((f (make <Frame> :parent parent :border-width 2 :relief "ridge"))
|
||||
(e (make <Button> :parent f :text "Eval" :border-width 0
|
||||
:command (lambda ()
|
||||
(eval-string (value edit) env))))
|
||||
(c (make <Button> :parent f :text "Close" :border-width 0
|
||||
:command (lambda () (destroy parent)))))
|
||||
(pack c e :side 'left)
|
||||
f))
|
||||
|
||||
(let* ((class (if (is-a? parent <Multiple-window>) <Inner-Window> <Toplevel>))
|
||||
(top (make class :title m :parent parent))
|
||||
(body (pp (method->list m) 75 #f))
|
||||
(env (procedure-environment (method-procedure m)))
|
||||
(edit (make <Scheme-Text> :parent top :width 80 :background "white"
|
||||
:value body))
|
||||
(but (make-buttons top edit env)))
|
||||
(pack but :expand #f :fill "x")
|
||||
(pack edit :expand #t :fill "both")
|
||||
top))
|
||||
|
||||
|
||||
(define-method method-editor ((m <method>)) ; without parent
|
||||
(method-editor m *top-root*))
|
||||
|
||||
;=============================================================================
|
||||
;
|
||||
; g f - e d i t o r
|
||||
;
|
||||
;=============================================================================
|
||||
(define-method gf-editor ((gf <generic>))
|
||||
|
||||
(define (make-buttons parent)
|
||||
(let* ((f (make <Frame> :parent parent :border-width 2 :relief "ridge"))
|
||||
(t (make <Label> :parent f :anchor 'w
|
||||
:text (format #f "Methods of `~S'" (generic-function-name gf))))
|
||||
(e (make <Button> :parent f :text "Close"
|
||||
:command (lambda () (destroy parent)))))
|
||||
(pack t :fill 'x :expand #t :side 'left :padx 5)
|
||||
(pack e :side 'left)
|
||||
f))
|
||||
|
||||
(let* ((top (make <Toplevel> :title "Generic Function Editor"))
|
||||
(win (make <Multiple-Window> :parent top :background "wheat3"))
|
||||
(but (make-buttons top)))
|
||||
(pack but :side "top" :expand #f :fill 'x)
|
||||
(pack win :expand #t :fill "both")
|
||||
|
||||
(let loop ((x 20) (y 20) (l (generic-function-methods gf)))
|
||||
(when (pair? l)
|
||||
(let ((ed (method-editor (car l) win)))
|
||||
(place ed :x x :y y)
|
||||
(loop (+ x 20) (+ y 20) (cdr l)))))))
|
||||
|
||||
(provide "method-editor")
|
||||
@@ -544,6 +544,9 @@
|
||||
|
||||
(printer-add 'define *pp:print-sform*)
|
||||
(printer-add 'define-macro *pp:print-sform*)
|
||||
(printer-add 'define-class *pp:print-sform*)
|
||||
(printer-add 'define-method *pp:print-sform*)
|
||||
|
||||
(printer-add 'extend-syntax *pp:print-sform*)
|
||||
(printer-add 'when *pp:print-sform*)
|
||||
(printer-add 'unless *pp:print-sform*)
|
||||
|
||||
-284
@@ -1,284 +0,0 @@
|
||||
%%BeginProlog
|
||||
50 dict begin
|
||||
|
||||
% This is a standard prolog for Postscript generated by Tk's canvas
|
||||
% widget.
|
||||
% SCCS: @(#) prolog.ps 1.5 96/02/17 17:45:11
|
||||
|
||||
% The definitions below just define all of the variables used in
|
||||
% any of the procedures here. This is needed for obscure reasons
|
||||
% explained on p. 716 of the Postscript manual (Section H.2.7,
|
||||
% "Initializing Variables," in the section on Encapsulated Postscript).
|
||||
|
||||
/baseline 0 def
|
||||
/stipimage 0 def
|
||||
/height 0 def
|
||||
/justify 0 def
|
||||
/lineLength 0 def
|
||||
/spacing 0 def
|
||||
/stipple 0 def
|
||||
/strings 0 def
|
||||
/xoffset 0 def
|
||||
/yoffset 0 def
|
||||
/tmpstip null def
|
||||
|
||||
% Define the array ISOLatin1Encoding (which specifies how characters are
|
||||
% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript
|
||||
% level 2 is supposed to define it, but level 1 doesn't).
|
||||
|
||||
systemdict /ISOLatin1Encoding known not {
|
||||
/ISOLatin1Encoding [
|
||||
/space /space /space /space /space /space /space /space
|
||||
/space /space /space /space /space /space /space /space
|
||||
/space /space /space /space /space /space /space /space
|
||||
/space /space /space /space /space /space /space /space
|
||||
/space /exclam /quotedbl /numbersign /dollar /percent /ampersand
|
||||
/quoteright
|
||||
/parenleft /parenright /asterisk /plus /comma /minus /period /slash
|
||||
/zero /one /two /three /four /five /six /seven
|
||||
/eight /nine /colon /semicolon /less /equal /greater /question
|
||||
/at /A /B /C /D /E /F /G
|
||||
/H /I /J /K /L /M /N /O
|
||||
/P /Q /R /S /T /U /V /W
|
||||
/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
|
||||
/quoteleft /a /b /c /d /e /f /g
|
||||
/h /i /j /k /l /m /n /o
|
||||
/p /q /r /s /t /u /v /w
|
||||
/x /y /z /braceleft /bar /braceright /asciitilde /space
|
||||
/space /space /space /space /space /space /space /space
|
||||
/space /space /space /space /space /space /space /space
|
||||
/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
|
||||
/dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron
|
||||
/space /exclamdown /cent /sterling /currency /yen /brokenbar /section
|
||||
/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen
|
||||
/registered /macron
|
||||
/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph
|
||||
/periodcentered
|
||||
/cedillar /onesuperior /ordmasculine /guillemotright /onequarter
|
||||
/onehalf /threequarters /questiondown
|
||||
/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
|
||||
/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex
|
||||
/Idieresis
|
||||
/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
|
||||
/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn
|
||||
/germandbls
|
||||
/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
|
||||
/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex
|
||||
/idieresis
|
||||
/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
|
||||
/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn
|
||||
/ydieresis
|
||||
] def
|
||||
} if
|
||||
|
||||
% font ISOEncode font
|
||||
% This procedure changes the encoding of a font from the default
|
||||
% Postscript encoding to ISOLatin1. It's typically invoked just
|
||||
% before invoking "setfont". The body of this procedure comes from
|
||||
% Section 5.6.1 of the Postscript book.
|
||||
|
||||
/ISOEncode {
|
||||
dup length dict begin
|
||||
{1 index /FID ne {def} {pop pop} ifelse} forall
|
||||
/Encoding ISOLatin1Encoding def
|
||||
currentdict
|
||||
end
|
||||
|
||||
% I'm not sure why it's necessary to use "definefont" on this new
|
||||
% font, but it seems to be important; just use the name "Temporary"
|
||||
% for the font.
|
||||
|
||||
/Temporary exch definefont
|
||||
} bind def
|
||||
|
||||
% StrokeClip
|
||||
%
|
||||
% This procedure converts the current path into a clip area under
|
||||
% the assumption of stroking. It's a bit tricky because some Postscript
|
||||
% interpreters get errors during strokepath for dashed lines. If
|
||||
% this happens then turn off dashes and try again.
|
||||
|
||||
/StrokeClip {
|
||||
{strokepath} stopped {
|
||||
(This Postscript printer gets limitcheck overflows when) =
|
||||
(stippling dashed lines; lines will be printed solid instead.) =
|
||||
[] 0 setdash strokepath} if
|
||||
clip
|
||||
} bind def
|
||||
|
||||
% desiredSize EvenPixels closestSize
|
||||
%
|
||||
% The procedure below is used for stippling. Given the optimal size
|
||||
% of a dot in a stipple pattern in the current user coordinate system,
|
||||
% compute the closest size that is an exact multiple of the device's
|
||||
% pixel size. This allows stipple patterns to be displayed without
|
||||
% aliasing effects.
|
||||
|
||||
/EvenPixels {
|
||||
% Compute exact number of device pixels per stipple dot.
|
||||
dup 0 matrix currentmatrix dtransform
|
||||
dup mul exch dup mul add sqrt
|
||||
|
||||
% Round to an integer, make sure the number is at least 1, and compute
|
||||
% user coord distance corresponding to this.
|
||||
dup round dup 1 lt {pop 1} if
|
||||
exch div mul
|
||||
} bind def
|
||||
|
||||
% width height string StippleFill --
|
||||
%
|
||||
% Given a path already set up and a clipping region generated from
|
||||
% it, this procedure will fill the clipping region with a stipple
|
||||
% pattern. "String" contains a proper image description of the
|
||||
% stipple pattern and "width" and "height" give its dimensions. Each
|
||||
% stipple dot is assumed to be about one unit across in the current
|
||||
% user coordinate system. This procedure trashes the graphics state.
|
||||
|
||||
/StippleFill {
|
||||
% The following code is needed to work around a NeWSprint bug.
|
||||
|
||||
/tmpstip 1 index def
|
||||
|
||||
% Change the scaling so that one user unit in user coordinates
|
||||
% corresponds to the size of one stipple dot.
|
||||
1 EvenPixels dup scale
|
||||
|
||||
% Compute the bounding box occupied by the path (which is now
|
||||
% the clipping region), and round the lower coordinates down
|
||||
% to the nearest starting point for the stipple pattern. Be
|
||||
% careful about negative numbers, since the rounding works
|
||||
% differently on them.
|
||||
|
||||
pathbbox
|
||||
4 2 roll
|
||||
5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll
|
||||
6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll
|
||||
|
||||
% Stack now: width height string y1 y2 x1 x2
|
||||
% Below is a doubly-nested for loop to iterate across this area
|
||||
% in units of the stipple pattern size, going up columns then
|
||||
% across rows, blasting out a stipple-pattern-sized rectangle at
|
||||
% each position
|
||||
|
||||
6 index exch {
|
||||
2 index 5 index 3 index {
|
||||
% Stack now: width height string y1 y2 x y
|
||||
|
||||
gsave
|
||||
1 index exch translate
|
||||
5 index 5 index true matrix tmpstip imagemask
|
||||
grestore
|
||||
} for
|
||||
pop
|
||||
} for
|
||||
pop pop pop pop pop
|
||||
} bind def
|
||||
|
||||
% -- AdjustColor --
|
||||
% Given a color value already set for output by the caller, adjusts
|
||||
% that value to a grayscale or mono value if requested by the CL
|
||||
% variable.
|
||||
|
||||
/AdjustColor {
|
||||
CL 2 lt {
|
||||
currentgray
|
||||
CL 0 eq {
|
||||
.5 lt {0} {1} ifelse
|
||||
} if
|
||||
setgray
|
||||
} if
|
||||
} bind def
|
||||
|
||||
% x y strings spacing xoffset yoffset justify stipple DrawText --
|
||||
% This procedure does all of the real work of drawing text. The
|
||||
% color and font must already have been set by the caller, and the
|
||||
% following arguments must be on the stack:
|
||||
%
|
||||
% x, y - Coordinates at which to draw text.
|
||||
% strings - An array of strings, one for each line of the text item,
|
||||
% in order from top to bottom.
|
||||
% spacing - Spacing between lines.
|
||||
% xoffset - Horizontal offset for text bbox relative to x and y: 0 for
|
||||
% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se.
|
||||
% yoffset - Vertical offset for text bbox relative to x and y: 0 for
|
||||
% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se.
|
||||
% justify - 0 for left justification, 0.5 for center, 1 for right justify.
|
||||
% stipple - Boolean value indicating whether or not text is to be
|
||||
% drawn in stippled fashion. If text is stippled,
|
||||
% procedure StippleText must have been defined to call
|
||||
% StippleFill in the right way.
|
||||
%
|
||||
% Also, when this procedure is invoked, the color and font must already
|
||||
% have been set for the text.
|
||||
|
||||
/DrawText {
|
||||
/stipple exch def
|
||||
/justify exch def
|
||||
/yoffset exch def
|
||||
/xoffset exch def
|
||||
/spacing exch def
|
||||
/strings exch def
|
||||
|
||||
% First scan through all of the text to find the widest line.
|
||||
|
||||
/lineLength 0 def
|
||||
strings {
|
||||
stringwidth pop
|
||||
dup lineLength gt {/lineLength exch def} {pop} ifelse
|
||||
newpath
|
||||
} forall
|
||||
|
||||
% Compute the baseline offset and the actual font height.
|
||||
|
||||
0 0 moveto (TXygqPZ) false charpath
|
||||
pathbbox dup /baseline exch def
|
||||
exch pop exch sub /height exch def pop
|
||||
newpath
|
||||
|
||||
% Translate coordinates first so that the origin is at the upper-left
|
||||
% corner of the text's bounding box. Remember that x and y for
|
||||
% positioning are still on the stack.
|
||||
|
||||
translate
|
||||
lineLength xoffset mul
|
||||
strings length 1 sub spacing mul height add yoffset mul translate
|
||||
|
||||
% Now use the baseline and justification information to translate so
|
||||
% that the origin is at the baseline and positioning point for the
|
||||
% first line of text.
|
||||
|
||||
justify lineLength mul baseline neg translate
|
||||
|
||||
% Iterate over each of the lines to output it. For each line,
|
||||
% compute its width again so it can be properly justified, then
|
||||
% display it.
|
||||
|
||||
strings {
|
||||
dup stringwidth pop
|
||||
justify neg mul 0 moveto
|
||||
stipple {
|
||||
|
||||
% The text is stippled, so turn it into a path and print
|
||||
% by calling StippledText, which in turn calls StippleFill.
|
||||
% Unfortunately, many Postscript interpreters will get
|
||||
% overflow errors if we try to do the whole string at
|
||||
% once, so do it a character at a time.
|
||||
|
||||
gsave
|
||||
/char (X) def
|
||||
{
|
||||
char 0 3 -1 roll put
|
||||
currentpoint
|
||||
gsave
|
||||
char true charpath clip StippleText
|
||||
grestore
|
||||
char stringwidth translate
|
||||
moveto
|
||||
} forall
|
||||
grestore
|
||||
} {show} ifelse
|
||||
0 spacing neg translate
|
||||
} forall
|
||||
} bind def
|
||||
|
||||
%%EndProlog
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
;;;; permission of the copyright holder.
|
||||
;;;; This software is provided ``as is'' without express or implied warranty.
|
||||
;;;;
|
||||
;;;; $Id: sterm.stk 1.3 Tue, 03 Mar 1998 22:48:24 +0000 eg $
|
||||
;;;; $Id: sterm.stk 1.3 Tue, 03 Mar 1998 23:48:24 +0100 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 2-Oct-1995 22:57
|
||||
|
||||
+6
-6
@@ -14,11 +14,11 @@
|
||||
;;;; This software is a derivative work of other copyrighted softwares; the
|
||||
;;;; copyright notices of these softwares are placed in the file COPYRIGHTS
|
||||
;;;;
|
||||
;;;; $Id: text.stk 1.3 Sun, 22 Mar 1998 16:16:09 +0000 eg $
|
||||
;;;; $Id: text.stk 1.5 Wed, 30 Sep 1998 14:02:29 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 17-May-1993 12:35
|
||||
;;;; Last file update: 21-Mar-1998 12:47
|
||||
;;;; Last file update: 27-Sep-1998 12:20
|
||||
;;;;
|
||||
|
||||
(select-module Tk)
|
||||
@@ -462,10 +462,6 @@
|
||||
(define-binding "Text" "<Control-1>" (|W| x y)
|
||||
(|W| 'mark 'set "insert" (format #f "@~A,~A" x y)))
|
||||
|
||||
(define-binding "Text" "<ButtonRelease-2>" (|W| x y)
|
||||
(if (or (not tk::mouse-moved) *tk-strict-motif*)
|
||||
(Tk:text-mouse-paste |W| x y)))
|
||||
|
||||
(define-binding "Text" "<Left>" (|W|)
|
||||
(Tk:text-set-cursor |W| "insert-1c"))
|
||||
|
||||
@@ -612,6 +608,10 @@
|
||||
(define-binding "Text" "<<Clear>>" (|W|)
|
||||
(catch (|W| 'delete 'sel.first 'sel.last)))
|
||||
|
||||
(define-binding "Text" "<<PasteSelection>>" (|W| x y)
|
||||
(if (or (not tk::mouse-moved) *tk-strict-motif*)
|
||||
(Tk:text-mouse-paste |W| x y)))
|
||||
|
||||
(define-binding "Text" "<Insert>" (|W|)
|
||||
(catch
|
||||
(Tk:text-insert |W| (selection 'get :displayof |W|))))
|
||||
|
||||
+14
-7
@@ -17,11 +17,11 @@
|
||||
;;;; This software is a derivative work of other copyrighted softwares; the
|
||||
;;;; copyright notices of these softwares are placed in the file COPYRIGHTS
|
||||
;;;;
|
||||
;;;; $Id: tk-init.stk 1.13 Thu, 28 May 1998 20:07:43 +0000 eg $
|
||||
;;;; $Id: tk-init.stk 1.18 Wed, 30 Sep 1998 14:02:29 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 17-May-1993 12:35
|
||||
;;;; Last file update: 28-May-1998 19:16
|
||||
;;;; Last file update: 27-Sep-1998 12:26
|
||||
;;;;
|
||||
|
||||
(unless (equal? *tk-version* "8.0")
|
||||
@@ -82,7 +82,6 @@
|
||||
(define tk::grab "")
|
||||
(define tk::inMenuButton '())
|
||||
(define tk::posted #f)
|
||||
(define tk::selectMode '())
|
||||
(define tk::cursor "")
|
||||
(define tk::kill-buffer "") ;; One kill buffer shared between all texts.
|
||||
|
||||
@@ -167,6 +166,7 @@
|
||||
;;;; *start-withdrawn* to #f
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
(when *start-withdrawn*
|
||||
;; Start without mapping the root window.
|
||||
(wm 'withdraw ".")
|
||||
@@ -186,7 +186,7 @@
|
||||
(set! wm
|
||||
(lambda l
|
||||
(let ((res (apply old-wm l)))
|
||||
(unless (eq? (old-wm 'state *root*) 'withdrawn)
|
||||
(unless (equal? (old-wm 'state *root*) "withdrawn")
|
||||
;; Previous wm call makes the *root* window no more withdrawn
|
||||
;; Replace the pack and wm command by the original Tk ones
|
||||
(set! pack old-pack)
|
||||
@@ -285,10 +285,12 @@
|
||||
(case (os-kind)
|
||||
((Windows) (event 'add "<<Cut>>" "<Control-Key-x>" "<Shift-Key-Delete>")
|
||||
(event 'add "<<Copy>>" "<Control-Key-c>" "<Control-Key-Insert>")
|
||||
(event 'add "<<Paste>>" "<Control-Key-v>" "<Shift-Key-Insert>"))
|
||||
(event 'add "<<Paste>>" "<Control-Key-v>" "<Shift-Key-Insert>")
|
||||
(event 'add "<<PasteSelection>>" "<ButtonRelease-2>" ))
|
||||
((Unix) (event 'add "<<Cut>>" "<Control-Key-x>" "<Key-F20>")
|
||||
(event 'add "<<Copy>>" "<Control-Key-c>" "<Key-F16>")
|
||||
(event 'add "<<Paste>>" "<Control-Key-v>" "<Key-F18>")
|
||||
(event 'add "<<PasteSelection>>" "<ButtonRelease-2>" )
|
||||
;; Add a trace to set and unset Motif bindings when the
|
||||
;; *tk-strict-Motif* variable is changed
|
||||
(let ((trace (lambda ()
|
||||
@@ -298,6 +300,7 @@
|
||||
(event op "<<Paste>>" "<Control-Key-y>")))))
|
||||
(trace-var '*tk-strict-Motif* trace)
|
||||
(trace))))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;
|
||||
@@ -328,6 +331,9 @@
|
||||
(autoload "sterm" sterm)
|
||||
(autoload "image" find-image make-image change-image delete-image)
|
||||
|
||||
(when (eq? (os-kind) 'Unix)
|
||||
(autoload "tk-unix" Tk:choose-color Tk:message-box
|
||||
Tk:get-open-file Tk:get-set-file Tk:get-file))
|
||||
|
||||
;=============================================================================
|
||||
;
|
||||
@@ -355,8 +361,9 @@
|
||||
(apply STk:report-error args))
|
||||
|
||||
;; Global help functions which are defined when Tk is loaded
|
||||
(autoload "help" help STk:show-help-file)
|
||||
(autoload "www-browser" WWW:browser))
|
||||
(autoload "help" help STk:show-help-file)
|
||||
(autoload "www-browser" WWW:browser)
|
||||
(autoload "class-browser" class-browser))
|
||||
|
||||
;;;;
|
||||
;;;; Retain now that Tk is now fully initialized
|
||||
|
||||
+35
-43
@@ -12,72 +12,64 @@
|
||||
;;;; permission of the copyright holder.
|
||||
;;;; This software is provided ``as is'' without express or implied warranty.
|
||||
;;;;
|
||||
;;;; $Id: tk-unix.stk 1.1 Fri, 10 Apr 1998 07:13:18 +0000 eg $
|
||||
;;;; $Id: tk-unix.stk 1.2 Thu, 10 Sep 1998 23:44:28 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 1-Feb-1998 19:03
|
||||
;;;; Last file update: 2-Feb-1998 12:19
|
||||
;;;; Creation date: 10-Sep-1998 23:20
|
||||
;;;; Last file update: 10-Sep-1998 23:29
|
||||
|
||||
(require "Tk-classes")
|
||||
;;; Functions defined here are only loaded when we are on Unix.
|
||||
;;; On windows, they are defined in C and implemented using the
|
||||
;;; native look and feel.
|
||||
;;; The functions defined here are simple wrapers around the real ones
|
||||
;;; defined in the STklos+Tk module. Otherwise, we have needed to require
|
||||
;;; the loading of "Tk-classes", when running Unix (and not on Windows).
|
||||
|
||||
(select-module STklos+Tk)
|
||||
|
||||
(export Tk:message-box Tk:get-open-file Tk:get-save-file)
|
||||
(select-module Tk)
|
||||
(export Tk:message-box Tk:choose-color
|
||||
Tk:get-file Tk:get-open-file Tk:get-save-file)
|
||||
|
||||
;=============================================================================
|
||||
;
|
||||
; Tk:message-box
|
||||
;
|
||||
;=============================================================================
|
||||
|
||||
(define (Tk:message-box . l)
|
||||
(let* ((default (get-keyword :default l ""))
|
||||
(icon (get-keyword :icon l #f))
|
||||
(text (get-keyword :text l ""))
|
||||
(title (get-keyword :title l ""))
|
||||
(class (case (get-keyword :type l 'ok)
|
||||
((abortretryignore) <Abort-retry-ignore-message-box>)
|
||||
((okcancel) <Ok-cancel-message-box>)
|
||||
((retrycancel) <Retry-cancel-message-box>)
|
||||
((yesno) <Yes-no-message-box>)
|
||||
((yesnocancel) <Yes-no-cancel-message-box>)
|
||||
(else <Ok-message-box>)))
|
||||
(box (make class :text text :title title)))
|
||||
(require "Tk-classes")
|
||||
(apply (with-module STklos+Tk Tk:message-box) l))
|
||||
|
||||
;; Default
|
||||
;/////// must be done ////////
|
||||
;=============================================================================
|
||||
;
|
||||
; Tk:choose-color
|
||||
;
|
||||
;=============================================================================
|
||||
(define (Tk:choose-color . l)
|
||||
(require "Tk-classes")
|
||||
(apply (with-module STklos+Tk Tk:choose-color) l))
|
||||
|
||||
;; Icon
|
||||
(if icon (set! (icon box) (make-image icon)))
|
||||
|
||||
(grab 'set box)
|
||||
(tkwait 'window box)
|
||||
msgbox-button))
|
||||
;=============================================================================
|
||||
;
|
||||
; Tk:get-file
|
||||
;
|
||||
;=============================================================================
|
||||
(define (Tk:get-file . l)
|
||||
(require "Tk-classes")
|
||||
(apply (with-module STklos+Tk Tk:get-file) l))
|
||||
|
||||
;=============================================================================
|
||||
;
|
||||
; Tk:get-open-file
|
||||
;
|
||||
;=============================================================================
|
||||
|
||||
(define (Tk:get-open-file . l)
|
||||
(apply file-chooser
|
||||
:mode 'read
|
||||
:value (string-append (get-keyword :initial-dir l (getcwd))
|
||||
"/"
|
||||
(get-keyword :initial-file l ""))
|
||||
l))
|
||||
(define (Tk:get-file . l)
|
||||
(require "Tk-classes")
|
||||
(apply (with-module STklos+Tk Tk:get-open-file) l))
|
||||
|
||||
;=============================================================================
|
||||
;
|
||||
; Tk:get-save-file
|
||||
;
|
||||
;=============================================================================
|
||||
|
||||
(define (Tk:get-save-file . l)
|
||||
(apply file-chooser
|
||||
:mode 'write
|
||||
:value (string-append (get-keyword :initial-dir l (getcwd))
|
||||
"/"
|
||||
(get-keyword :initial-file l ""))
|
||||
l))
|
||||
(require "Tk-classes")
|
||||
(apply (with-module STklos+Tk Tk:get-save-file) l))
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
;;;; permission of the copyright holder.
|
||||
;;;; This software is provided ``as is'' without express or implied warranty.
|
||||
;;;;
|
||||
;;;; $Id: trace.stk 1.3 Tue, 19 May 1998 10:44:58 +0000 eg $
|
||||
;;;; $Id: trace.stk 1.3 Tue, 19 May 1998 12:44:58 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 26-Apr-1997 16:02
|
||||
|
||||
Reference in New Issue
Block a user