YadaImages.tcl
00001
# Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de>
00002
#
00003
# This file is free software; as a special exception the author gives
00004
# unlimited permission to copy and/or distribute it, with or without
00005
# modifications, as long as this notice is preserved.
00006
#
00007
# This program is distributed in the hope that it will be useful, but
00008
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
00009
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00010
00011
## ----------------------------------------------------------------------------
00012
## YadaImages - an image factory.
00013
## This class is not ment to be instanciated. Its only purpose is to
00014
## provide named tcl image objects via YadaImages::get.
00015
##
00016
## These are the symbolic image names known to YadaImages:
00017
## \latexonly
00018
## back, bomb, checkmark, folder, delete, down, erase, error, eyes, finish,
00019
## floppy, forward, giveup, halfeyes, home, info, lamp, ledOff, ledOn, yadalogo,
00020
## open, folder\_open, question, reload, run, runall, step, stop, text
00021
## \endlatexonly
00022
## ----------------------------------------------------------------------------
00023
## \image html back.gif "backward"
00024
## \image html bomb.gif "bomb"
00025
## \image html checkmark.gif "checkmark"
00026
## \image html folder.gif "defaultFolder"
00027
## \image html delete.gif "delete"
00028
## \image html down.gif "down"
00029
## \image html erase.gif "erase"
00030
## \image html error.gif "error"
00031
## \image html eyes.gif "eyes"
00032
## \image html finish.gif "finish"
00033
## \image html floppy.gif "floppy"
00034
## \image html forward.gif "forward"
00035
## \image html giveup.gif "giveup"
00036
## \image html halfeyes.gif "halfeyes"
00037
## \image html home.gif "home"
00038
## \image html info.gif "info"
00039
## \image html lamp.gif "lamp"
00040
## \image html ledOff.gif "ledOff"
00041
## \image html ledOn.gif "ledOn"
00042
## \image html yadalogo.gif "logo"
00043
## \image html open.gif "openFile"
00044
## \image html folder_open.gif "openFolder"
00045
## \image html question.gif "question"
00046
## \image html reload.gif "reload"
00047
## \image html run.gif "run"
00048
## \image html runall.gif "runall"
00049
## \image html step.gif "step"
00050
## \image html stop.gif "stop"
00051
## \image html text.gif "textFile"
00052
## \image html up.gif "up"
00053
## ----------------------------------------------------------------------------
00054
##
00055
## \author Michael Daum
00056
##
00057
## $Id: YadaImages.tcl,v 1.11 2004/02/25 14:42:08 micha Exp $
00058
## ----------------------------------------------------------------------------
00059 class YadaImages {
00060
00061
# variables ----------------------------------------------------------------
00062
00063
## hash mapping image names to tcl image objects
00064 common
_images; ## \type TclArray
00065
00066 array set
_images [list \
00067 home [image create photo -file [file join $env(YADA_IMAGES) home.gif]] \
00068 defaultFolder [image create photo -file [file join $env(YADA_IMAGES) folder.gif]] \
00069 openFolder [image create photo -file [file join $env(YADA_IMAGES) folder_open.gif]] \
00070 textFile [image create photo -file [file join $env(YADA_IMAGES) text.gif]] \
00071 backward [image create photo -file [file join $env(YADA_IMAGES) back.gif]] \
00072 forward [image create photo -file [file join $env(YADA_IMAGES) forward.gif]] \
00073 lamp [image create photo -file [file join $env(YADA_IMAGES) lamp.gif]] \
00074 up [image create photo -file [file join $env(YADA_IMAGES) up.gif]] \
00075 down [image create photo -file [file join $env(YADA_IMAGES) down.gif]] \
00076 floppy [image create photo -file [file join $env(YADA_IMAGES) floppy.gif]] \
00077 openFile [image create photo -file [file join $env(YADA_IMAGES) open.gif]] \
00078 reload [image create photo -file [file join $env(YADA_IMAGES) reload.gif]] \
00079 erase [image create photo -file [file join $env(YADA_IMAGES) erase.gif]] \
00080 eyes [image create photo -file [file join $env(YADA_IMAGES) eyes.gif]] \
00081 halfeyes [image create photo -file [file join $env(YADA_IMAGES) halfeyes.gif]] \
00082 giveup [image create photo -file [file join $env(YADA_IMAGES) giveup.gif]] \
00083 run [image create photo -file [file join $env(YADA_IMAGES) run.gif]] \
00084 runall [image create photo -file [file join $env(YADA_IMAGES) runall.gif]] \
00085 step [image create photo -file [file join $env(YADA_IMAGES) step.gif]] \
00086 finish [image create photo -file [file join $env(YADA_IMAGES) finish.gif]] \
00087 stop [image create photo -file [file join $env(YADA_IMAGES) stop.gif]] \
00088 bomb [image create photo -file [file join $env(YADA_IMAGES) bomb.gif]] \
00089 delete [image create photo -file [file join $env(YADA_IMAGES) delete.gif]] \
00090 ledOn [image create photo -file [file join $env(YADA_IMAGES) ledOn.gif]] \
00091 ledOff [image create photo -file [file join $env(YADA_IMAGES) ledOff.gif]] \
00092 checkmark [image create photo -file [file join $env(YADA_IMAGES) checkmark.gif]] \
00093 question [image create photo -file [file join $env(YADA_IMAGES) question.gif]] \
00094 info [image create photo -file [file join $env(YADA_IMAGES) info.gif]] \
00095 error [image create photo -file [file join $env(YADA_IMAGES) error.gif]] \
00096 logo [image create photo -file [file join $env(YADA_IMAGES) yadalogo.gif]] \
00097 ]
00098
00099 # static methods ------------------------------------------------------------
00100 public proc get {imageName}; ## \type TclString
00101 };
00102
00103
## ----------------------------------------------------------------------------
00104
## get named image.
00105
## This method lets you access the stored image objects by their name.
00106
## ----------------------------------------------------------------------------
00107
proc
YadaImages::get {imageName} {
00108 return $_images($imageName)
00109 }
YADA 2.0-alpha (20 Oct 2004)