# $Header: /home/cvsroot/tcldb/ucodb/Tlib/showError,v 1.2 1998/12/16 21:44:33 de Exp $
# tcl procs saved on Sun Sep 03 16:19:00 PDT 1995

proc showError elist {

	global  bitmapdir


# make sure we do NOT create windows whose names start with upcase
# letters (illegal in Tk 3.2)

  set win .errorbox
  catch {destroy $win}
  toplevel $win
  wm title $win "Error Detected"
  wm iconbitmap $win @$bitmapdir/picklist.xbm

  wm geom $win 700x300+200+200
  wm minsize $win 400 300

  frame $win.l 
  frame $win.f 
  frame $win.b -relief sunken -borderwidth 1 

  set font [getFont $win mediumhelb]
  label $win.l.l -text "Error output"  -anchor center -font $font 
  scrollbar $win.f.vert -orient vertical -command "$win.f.text yview" 	-relief sunken
  scrollbar $win.horz -orient horizontal -command "$win.f.text xview" 	-relief sunken
  set font [getFont $win mediumcou]

  listbox $win.f.text -yscroll "$win.f.vert set" -xscroll "$win.horz set"   -relief sunken -font $font
  
  set errtext "TEXT OF ERROR MESSAGE:\n"
  foreach lem $elist {
    $win.f.text insert end "\n$lem"
    append errtext "$lem\n"
  }

  button $win.b.ok -text "Done" -relief raised -borderwidth 2  -command "destroy $win" -padx 0 -pady 0
  button $win.b.prt -text "Print" -relief raised -border 2  -command "printBox $win.f.text" -padx 0 -pady 0
  eval button $win.b.mail -text \"Mail to DBA\" -relief  raised -border 2  -command \{mailMaven SYBASE_APPLICATION_ERROR \{$errtext\} \}

  pack $win.l -side top -fill x
  pack $win.f -side top -fill both -expand true
  pack $win.horz -side top -fill x
  pack $win.b -side bottom -fill x
 

  pack $win.l.l -side top -fill x -anchor nw
  pack $win.f.vert -side right -fill y -fill x  
  pack $win.f.text  -side left -fill both -expand true

  pack $win.b.mail -side left -ipadx 40 -ipady 2
  pack $win.b.prt -side left -ipadx 40 -ipady 2
  pack $win.b.ok -side right -ipadx 40 -ipady 2
 

}

