# Voreinstellungsmenü für Editor
#
# Copyright (C) 1999  G. Lamprecht, W. Lotz, R. Weibezahn; IWD, Bremen University

proc ev  {} {

proc evanzeigen {w s1} {
 global vv edtext editor edback edxterm edoptions efile esuff edsyntaxhelp
 writescr0 $w.d.tt "$s1\n\n$edtext\n $vv(ev2) $editor$edback\n" \
	" $vv(ev1) $edxterm\n $vv(ev3) $edoptions\n" \
	[alternative $esuff " $vv(ev4) *\n" " $vv(ev4) $esuff\n"] \
	[alternative $efile " $vv(bad1)\n" " $vv(bad2) $efile$esuff\n\n"] \
	" edsyntaxhelp: $edsyntaxhelp"
}

proc evssel {sel} {
 global We vv tssk edsyntaxchg edsyntaxhelp
 for {set i 1} {$i<=3} {incr i} {if {$sel==$vv(evsb$i)} {set edsyntaxhelp $tssk($i)}}
 writescr0 $We.d.tt ""; set edsyntaxchg 1
}

proc evesel {s} {
 global We vv evsep edtext edxterm editor edoptions edback evesel_v
 set edtext [getvalue $s 0 $evsep]; set edxterm   [getvalue $s 1 $evsep]
 set editor [getvalue $s 2 $evsep]; set edoptions [getvalue $s 3 $evsep]
 progback editor edback; evanzeigen $We "$vv(evt1):"; knoepfe
 set evesel_v "$s"
}

proc evWeae {} {global We;  destros $We; knoepfe; setInUnlockListe .c.1.ed;  unlock_list}

proc evWeag {} {
 global vv We editor edback edsyntaxhelp tssk evssel_v
 vstr_editor; progback editor edback; evanzeigen $We "$vv(ausg1)"; knoepfe
 for {set i 1} {$i<=3} {incr i} {if {$edsyntaxhelp==$tssk($i)} {set evssel_v $vv(evsb$i)}}
}


global We vv edtext evsep tssk edsyntaxhelp evssel_v

toplevel_init $We "$vv(evvor)" 0 0;  set tyh 17


# top buttons

insertTopButtons $We ev_h evWeae
button $We.a.g -text "$vv(ag)" -command {evWeag}; Bind3HF $We.a.g ev_grund $We.d.tt
pack configure $We.a.g -side left -padx 3 -pady 2


# frame bv for display of personal settings

frame $We.bv; pack configure $We.bv -pady 5 -anchor w

label $We.bv.dv -text "$vv(bvdv)   " -anchor w
Bind3HF $We.bv.dv z_voreinst1 $We.d.tt
button $We.bv.va -text "$vv(bvva)" -command {evanzeigen $We "$vv(aus0)"}
Bind3HF $We.bv.va z_voreinst1 $We.d.tt
pack configure $We.bv.dv $We.bv.va -side left


#frame for syntaxhelp and editor selection

frame $We.b; pack configure $We.b -pady 5 -padx 4 -anchor e
frame $We.c; pack configure $We.c -pady 5 -padx 4 -anchor e

# syntaxhelp selection
for {set i 1} {$i<=3} {incr i} {if {$edsyntaxhelp=="$tssk($i)"} {set evssel_v $vv(evsb$i)}}
CreateLSBox $We.b $vv(evs1) left 50 8 2 ev_syntaxhlp $We.d.tt \
	"" "{$vv(evsb1)} {$vv(evsb2)} {$vv(evsb3)}" evssel "" evWeae

# editor selection
set evsep [getsep editor.vst]
CreateLSBox $We.c $vv(evc1el) left 50 8 2 ev_edisel $We.d.tt \
	$evsep [vst2list editor.vst 1 $evsep "$edtext" evesel_v] evesel "" evWeae


InsertTextFrame $We $tyh "" "" ""
}
