function tgl_view

% function tgl_view
%
% This function is used in conjunction with FD3.  It is the callback for the
% page/quadrant view menu item and is used to flip/flop between the two modes.
%
% ACP

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

global FD3MENUS FD3AXES FD3SLIDERS FD3SCALE FD3STATUS FD3AXES FD3NEXT
global FD3MESSAGE FD3MODULES FD3STREAMS FD3TEXT

child=get(FD3MENUS(6),'Children');

% Turn flip/flop grid if status if grid is on

if FD3STATUS(2)
   if gca~=FD3AXES(1)
      axes(FD3AXES(1))
   end
   grid
   restack
end

if strcmp(FD3NEXT,'Page')

   % This means the user has just selected Quadrant.
   % First change label back to Full Page.

   set(child(2),'Label','Full Page');

   % Turn sliders back go back to old position

   set(FD3SLIDERS,'Visible','on');
   adj_view(1,FD3SLIDERS(1));
   adj_view(2,FD3SLIDERS(2)); 

   % Enable grid and put tick marks back

   set_menu(6,'on',1);
   set(FD3AXES,'TickLength','factory')

   % Turn all the text back on.

   lenmod=size(FD3MODULES,2);
   if lenmod>1
      set(FD3MODULES(2,2:lenmod),'Visible','on');
   end

   lenstr=size(FD3STREAMS,2);
   if lenstr>1
      set(FD3STREAMS(2,2:lenstr),'Visible','on');
   end

   set(FD3TEXT,'Visible','on');

   fd_reset(0)

else

   % This means the user has just selected Page View.
   % First change label back to Quadrant.

   set(child(2),'Label','Quadrant');
   set(FD3SLIDERS,'Visible','off');

   % Turn off all the text because it looks real bad in page

   lenmod=size(FD3MODULES,2);
   if lenmod>1
      set(FD3MODULES(2,2:lenmod),'Visible','off');
   end

   lenstr=size(FD3STREAMS,2);
   if lenstr>1
      set(FD3STREAMS(2,2:lenstr),'Visible','off');
   end

   set(FD3TEXT,'Visible','off');

   % Set axes so everything is in view.

   set(FD3AXES,'Xlim',FD3SCALE*[0 44],'Ylim',FD3SCALE*[0 33]);

   % Turn everything except Quandrant and Help off

   set_menu(1:5,'off');
   set_menu(6,'off',1);

   % Make ticks disappear

   set(FD3AXES,'TickLength',[0 0])

   % Let user know how to get view back to normal

   str='Select Quad.|from the|Window menu|or click on|the flow|diagram';
   str=[str ' to|return to|quadrant view.'];

   FD3MESSAGE=di_mssg(str);

   FD3NEXT='Page';

end


