	;	 dtbfunct.inc - toolbar common functions

	case a_param of
	  begincase
	  '^DISABLE': call disable_fields
	  '^ENABLE':  call enable_fields
	  'FRST': begin
		    dtb_error = FALSE
		    if (dtb_leavemethod)
		      xcall xsubr (dtb_leavemethod,dtb_table,dtb_error)
		    if (dtb_error.eq.FALSE)
		      begin
			clear dtb_function
			call disable_fields
			xcall dtb_first (dtb_table)
			xcall m_signal ('^DISP') ; force a break to display
		      end
		  end
	  'NEXT': begin
		    dtb_error = FALSE
		    if (dtb_leavemethod)
		      xcall xsubr (dtb_leavemethod,dtb_table,dtb_error)
		    if (dtb_error.eq.FALSE)
		      begin
			clear dtb_function
			call disable_fields
			xcall dtb_next (dtb_table)
			xcall m_signal ('^DISP') ; force a break to display
		      end
		  end
	  'PREV': begin
		    dtb_error = FALSE
		    if (dtb_leavemethod)
		      xcall xsubr (dtb_leavemethod,dtb_table,dtb_error)
		    if (dtb_error.eq.FALSE)
		      begin
			clear dtb_function
			call disable_fields
			xcall dtb_previous (dtb_table)
			xcall m_signal ('^DISP') ; force a break to display
		      end
		  end
	  'LAST': begin
		    dtb_error = FALSE
		    if (dtb_leavemethod)
		      xcall xsubr (dtb_leavemethod,dtb_table,dtb_error)
		    if (dtb_error.eq.FALSE)
		      begin
			clear dtb_function
			call disable_fields
			xcall dtb_last (dtb_table)
			xcall m_signal ('^DISP') ; force a break to display
		      end
		  end
	  'FIND': begin
		    dtb_error = FALSE
		    if (dtb_leavemethod)
		      xcall xsubr (dtb_leavemethod,dtb_table,dtb_error)
		    if (dtb_error.eq.FALSE)
		      begin
			clear dtb_function
			xcall m_signal ('^FIND')	; force a break for find
		      end
		  end
	  'ADD':  begin
		    call enable_fields
		    clear dtb_table
		    dtb_function = 'A'
		    xcall dtb_add (dtb_table)
		    xcall m_signal ('^ADD')	; force a break to reset input
		  end
	  'EDIT': begin
		    call enable_fields
		    dtb_function = 'E'
		    xcall dtb_edit (dtb_table)
		    xcall m_signal ('^EDIT')	; force a break to reset input
		  end
	  'UPDT': begin
		    xcall m_signal ('^UPDT')	; force a break for update
		  end
	  'CANC': begin
		    if (g_inpid.eq.inp_wind_no)
		      begin
			call disable_fields
			clear dtb_function
			xcall dtb_cancel (dtb_table)
		      end
		    xcall m_signal ('^CANC')	; force a break for cancel
		  end
	  'DEL':  begin
		    dtb_function = 'D'
		    xcall m_signal ('^DEL')	; force a break for delete
		  end
	  endcase
	xreturn

disable_fields,
	if (field_enabled.eq.TRUE)
	  begin
	    xcall i_disable (D_ALL,inp_wind_no)
	    field_enabled = FALSE
	  end
	return

enable_fields,
	if (field_enabled.eq.FALSE)
	  begin
	    xcall i_enable (D_ALL,inp_wind_no)
	    field_enabled = TRUE
	  end
	return

