## %include "eden/eden.dasm"; %dasm .eden output = (new type = Handle ); %eden winix = 0; ## winix ranges from 0 to 64 sn is winix % 13; dn is winix/13 + 1; output::sn is sn; output::dn is dn; %dasm @timetable = (new); @timetable prototypes = (new); @timetable prototypes cell = (new width = 80 height = 60 x is { @timetable slotsTable startx + (.width * (.slotix)) } y is { @timetable slotsTable starty + (.height * (.dayix)) } slotix = 0 dayix is { .. ix } ); @timetable slotsTable = (new); @timetable slotsTable startx = 100 starty = 100 Monday = (new ix = 0 %deep 0 = (new union (@timetable prototypes cell) slotix = 0) %deep 1 = (new union (@timetable prototypes cell) slotix = 1) %deep 2 = (new union (@timetable prototypes cell) slotix = 2) %deep 3 = (new union (@timetable prototypes cell) slotix = 3) %deep 4 = (new union (@timetable prototypes cell) slotix = 4) %deep 5 = (new union (@timetable prototypes cell) slotix = 5) %deep 6 = (new union (@timetable prototypes cell) slotix = 6) %deep 7 = (new union (@timetable prototypes cell) slotix = 7) %deep 8 = (new union (@timetable prototypes cell) slotix = 8) %deep 9 = (new union (@timetable prototypes cell) slotix = 9) %deep 10 = (new union (@timetable prototypes cell) slotix = 10) %deep 11 = (new union (@timetable prototypes cell) slotix = 11) %deep 12 = (new union (@timetable prototypes cell) slotix = 12) ) Tuesday = (new union (@timetable slotsTable Monday) ix = 1) Wednesday = (new union (@timetable slotsTable Monday) ix = 2) Thursday = (new union (@timetable slotsTable Monday) ix = 3) Friday = (new union (@timetable slotsTable Monday) ix = 4) ; @ui browser root = @timetable; %eden w = h = x = y = 0; winstr is "%scout\nwindow win" // str(winix) // " = {\n" // wtype // "\n" // wloc // "\n" // wcontent // "\n" // wattr // "\n};"; wtype is "\ttype : " // "DONALD"; wloc is "\tbox : " // "[{" // str(x) // "," // str(y) // "} , {" // str(x+w) // "," // str(y+h) // "}]"; wcontent is "\tpict : " // "\"dummy\""; wattr is "\tbgcolor : " // "\"white\"\n\tborder: 1\n\tbdcolor : " // "\"red\""; %dasm @day = (new); @day 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday ; @slotswin = (new); @slotswin daynum = 1 slotnum = 0 ; .eden input = (new type = Oracle w is {@timetable slotsTable (@day (@slotswin daynum)) (@slotswin slotnum) width} h is {@timetable slotsTable (@day (@slotswin daynum)) (@slotswin slotnum) height} x is {@timetable slotsTable (@day (@slotswin daynum)) (@slotswin slotnum) x} y is {@timetable slotsTable (@day (@slotswin daynum)) (@slotswin slotnum) y} sx is {@timetable slotsTable startx} sy is {@timetable slotsTable starty} ); %dasm @slotswin slotnum is {@root eden output sn}; @slotswin daynum is {@root eden output dn}; %eden x is input::x; y is input::y; w is input::w; h is input::h; ## at this point, setting winix to values from 0 to 64 will cycle winstr ## through the Scout specifications of win0, ..., win64 screenstr = "%scout\nscreen = <"; proc drawwin : winix { if (winix<=64) { execute(winstr); screenstr = screenstr // "win" // str(winix) // ((winix<64) ? " / " : ">;") ; } } for (winix=0; winix<=64; winix++) {}; ## the for-loop generates the windows win0, ..., win64 and generates the code for the screen ## in the string screenstr, which is then executed below. execute(screenstr); ## have made provision here for EDEN to be able to access the startx and starty positions ## for the array of windows: might use these e.g. to locate display components, make background