subroutine event_display_write_message(text) c c c This routine writes a line of text into the message are in the display c window. c c c George Gollin, g-gollin@uiuc.edu, 1999. c c parameter (max_lines=20) c c #include "event_display.inc" #include "event_display_data.inc" c c c data format is described in the common blocks. c character*(*) text character*200 line(max_lines) c character*9 date1 character*8 time1 c data icalled /0/ data line_length /200/ data line /max_lines * '...'/ c c ************************************************************************* c c c c number of calls so far: if(icalled .gt. 9999) icalled=0 c c c get length of text fed to routine as argument: length_text=lenocc(text) c c c if we have a null string, just write the existing messages... if(length_text .le. 0) go to 10 c icalled=icalled + 1 c c date and time: call date(date1) call time(time1) c c c scroll the lines: do i=1,max_lines-1 line(i)=line(i+1) end do c c c encode call number in first four characters of output line after blanking: line(max_lines)= . ' ' . // ' ' . // ' ' . // ' ' . // ' ' write(line(max_lines)(1:4),'(i4)') icalled c c c put date and time there too: line(max_lines)(5:6)='. ' line(max_lines)(7:14)=time1(1:8) line(max_lines)(15:15)=' ' line(max_lines)(16:24)=date1(1:9) line(max_lines)(25:26)=' ' last_char_used=26 c c c we don't want to run past the end of the line so... if(length_text + last_char_used .gt. line_length) . length_text=line_length - last_char_used c c line(max_lines)(last_char_used+1 : last_char_used+length_text)= . text(1:length_text) c c 10 continue c now draw a box in the message area after setting the fill color: call ixsetfc(index_color_message) mode=1 call ixbox(message_left, message_right, . message_bot, message_top, mode) mode=0 call ixbox(message_left, message_right, . message_bot, message_top, mode) c c c now write the text lines: mode=0 angle=0. rmag=1. iy=message_bot - 2 c do i=max_lines, 1, -1 c c see how many pixels high the text is: call ixtxtl(iwidth, iheight, lenocc(line(i)),line(i)) c c see where the top of the text will go if we print it: itop=iy - iheight c c if it fits, print it: if(itop .gt. message_top) then call ixtext(mode,message_left+3, iy, angle, rmag, . lenocc(line(i)), line(i)) c else c go to 100 c end if iy=iy - iheight - 2 c end do c c 100 continue c c return end