/[eiffelstudio]/trunk/Delivery/vision2_tour/templates/common_test.e
ViewVC logotype

Contents of /trunk/Delivery/vision2_tour/templates/common_test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 35741 - (show annotations)
Tue Feb 4 18:04:01 2003 UTC (17 years ago) by rogers
File size: 1218 byte(s)
We no longer use the curretn working directory to locate the png files,
but instead use the "ISE_VISION2_TOUR" environment variable.

1 indexing
2 description: "Objects that provide attributes for all examples."
3 author: ""
4 date: "$Date$"
5 revision: "$Revision$"
6
7 deferred class
8 COMMON_TEST
9
10 inherit
11 EXECUTION_ENVIRONMENT
12 undefine
13 default_create
14 end
15
16 feature -- Access
17
18 widget: EV_WIDGET
19 -- Widget into which example is built.
20 -- Simply insert into your Vision2 interface, for
21 -- testing purposes.
22
23 feature {NONE} -- Implementation
24
25 numbered_pixmap (a_number: INTEGER): EV_PIXMAP is
26 -- `Result' is pixmap named "image" + a_number.out.
27 local
28 filename: FILE_NAME
29 do
30 if all_loaded_pixmaps = Void then
31 create all_loaded_pixmaps.make (2)
32 end
33 create filename.make_from_string (get ("ISE_VISION2_TOUR"))
34 filename.extend ("png")
35 filename.extend ("image" + a_number.out + ".png")
36 if all_loaded_pixmaps @ filename /= Void then
37 Result := all_loaded_pixmaps @ filename
38 else
39 create Result
40 Result.set_with_named_file (filename)
41 all_loaded_pixmaps.put (Result, filename)
42 end
43 end
44
45 all_loaded_pixmaps: HASH_TABLE [EV_PIXMAP, STRING]
46 -- All pixmaps already loaded, referenced by their names.
47 -- For quick access.
48
49 invariant
50 widget_not_void: Widget /= Void
51
52 end -- class COMMON_TEST

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23