function handles=di_mssg(message)

% function handles=di_mssg(message)
%
% This function is used in conjunction with FD3.  It displays 'message' on
% the right hand side of the FD3 window.  It returns the 'handles' of the
% graphics objects used to create the message.  The "|" symbol is used to
% separate the lines of 'message'.
%
% ACP

% Last update:  July 11, 1993
% Author:       Adrian C. Penisson

global FD3PXPERCM

% Find all the line breaks and the number of lines

positions=[0 find(message=='|') length(message)+1];
numlines=1+sum(message=='|');

for i=1:numlines

    % Keep track of the y position and extract next line from message

    y=3.5-(.25*i);
    str=message((positions(i)+1):(positions(i+1)-1));

    % Write line to screen and add handle to 'handles'

    handle=uicontrol('Style','text','Units','Pixels','String',str,...
       'Position',ceil([5.33 y 1.18 .25]*2.54.*[FD3PXPERCM FD3PXPERCM]));
    handles=[handles handle];

end

% Check for black and white and fix colors if necessary

% if get(0,'ScreenDepth')==1
%   set(handles,'Foreground',[1 1 1],'Background',[0 0 0])
% end
