functor
require
DemoUrls(image: ImageDir) at '../DemoUrls.ozf'
import
Tk
TkTools
export
Images
Capacity
Delta
delay: DelayMove
Colors
Title
Fonts
Goods
prepare
Title = 'Transportation'
Capacity = 100 % Delta = 5 % DelayMove = 100 %
FullColors = colors(back: aquamarine
street: black
city: red
truck: [red blue yellow green
plum cyan tan bisque]
frame: black
window: steelblue
good: brown
textBg: wheat)
BwColors = colors(back: white
street: black
city: black
truck: [white]
frame: black
window: white
good: black
textBg: white)
fun {Namify B}
ImageDir#'transport/'#B#'.xbm'
end
%% Goods = bananas # cheese # cream # computers # rye # oil # sugar # salt #
vinegar # apples # whisky # beer # garbage # ketchup # coffee # ham #
umbrellas # paper # books # yoghurt # engines # oranges # juice #
tea # jam # grease # cigarettes # toys # corn # hamburgers
define
%% Fonts = fonts(text:
{New Tk.font tkInit(family:helvetica size:~12)}
about:
{New Tk.font tkInit(family:times size:~24 weight:bold)})
Colors = if Tk.isColor then FullColors else BwColors end
%% local
RI = {TkTools.images {Map [down
truck_frame_left truck_frame_right
truck_win_left truck_win_right]
Namify}}
{RI.truck_frame_left tk(configure foreground:Colors.frame)}
{RI.truck_frame_right tk(configure foreground:Colors.frame)}
{RI.truck_win_left tk(configure foreground:Colors.window)}
{RI.truck_win_right tk(configure foreground:Colors.window)}
CI = {List.toRecord c
{Map Colors.truck
fun {$ C}
I = {TkTools.images {Map [truck_fill_right
truck_fill_left] Namify}}
in
{I.truck_fill_left tk(configure foreground:C)}
{I.truck_fill_right tk(configure foreground:C)}
C#c(left: I.truck_fill_left
right: I.truck_fill_right)
end}}
in
Images = images(down: RI.down
truck: t(fill: CI
frame: f(left: RI.truck_frame_left
right: RI.truck_frame_right)
win: w(left: RI.truck_win_left
right: RI.truck_win_right)))
end
end