version 1.4, 1999/10/20 19:57:37
|
version 1.5, 1999/10/26 16:47:36
|
Line 2282 proc showParseErrors {} {
|
Line 2282 proc showParseErrors {} {
|
$gParseErrorsText delete 0.0 end |
$gParseErrorsText delete 0.0 end |
capaRaise .parseErrors |
capaRaise .parseErrors |
} |
} |
|
foreach line [split $parseErrors "\n"] { |
|
if { [regexp {File:.+->(.+), Line ([0-9]+): ERROR:} $line a one two three four five]} { |
|
puts a:$a |
|
puts one:$one |
|
puts two:$two |
|
puts three:$three |
|
puts four:$four |
|
puts five:$five |
|
} else { |
|
if { [regexp {File:(.+), Line ([0-9]+): ERROR:} $line a one two three four five]} { |
|
puts a:$a |
|
puts one:$one |
|
puts two:$two |
|
puts three:$three |
|
puts four:$four |
|
puts five:$five |
|
} |
|
} |
|
} |
$gParseErrorsText insert end $parseErrors |
$gParseErrorsText insert end $parseErrors |
} else { |
} else { |
if { [winfo exists .parseErrors] } { $gParseErrorsText delete 0.0 end } |
if { [winfo exists .parseErrors] } { $gParseErrorsText delete 0.0 end } |
Line 2420 proc rereadCapaConfig { } {
|
Line 2438 proc rereadCapaConfig { } {
|
displayError "Invalid capa.config file" |
displayError "Invalid capa.config file" |
set gCapaConfig(printer_option) $printer_option |
set gCapaConfig(printer_option) $printer_option |
} |
} |
|
setDefaultValues |
updateColors |
updateColors |
} |
} |
|
|
Line 2438 proc pickCapaConfig { } {
|
Line 2457 proc pickCapaConfig { } {
|
cd [file dirname $file] |
cd [file dirname $file] |
set error [parseCapaConfig] |
set error [parseCapaConfig] |
if { $error != "OK" } { displayError "Invalid capa.config file"; cd $oldDir } |
if { $error != "OK" } { displayError "Invalid capa.config file"; cd $oldDir } |
|
setDefaultValues |
} |
} |
} |
} |
|
|
|
proc setDefaultValues {} { |
|
global gProbVal gTryVal gHintVal gCapaConfig |
|
catch {set gProbVal $gCapaConfig(default_prob_val)} |
|
catch {set gTryVal $gCapaConfig(default_try_val)} |
|
catch {set gHintVal $gCapaConfig(default_hint_val)} |
|
} |
|
|
########################################################### |
########################################################### |
# openDocument |
# openDocument |
########################################################### |
########################################################### |
########################################################### |
########################################################### |
########################################################### |
########################################################### |
proc openDocument {} { |
proc openDocument {} { |
global gFile gTextWindow gSetNumberText gPrefs gChanged gQuizTemp gUndo |
global gFile gTextWindow gSetNumberText gPrefs gChanged gQuizTemp gUndo |
|
|
if { $gChanged } { if { [askToSave 0 0] == "Cancel" } { return } } |
if { $gChanged } { if { [askToSave 0 0] == "Cancel" } { return } } |
if { ![catch {set gTextWindow}] } { |
if { ![catch {set gTextWindow}] } { |
Line 2517 proc openDocument {} {
|
Line 2544 proc openDocument {} {
|
set gQuizTemp true |
set gQuizTemp true |
return |
return |
} |
} |
|
setDefaultValues |
|
|
createEditingWindow 0 |
createEditingWindow 0 |
$gTextWindow delete 0.0 end |
$gTextWindow delete 0.0 end |
$gTextWindow insert 0.0 [read $fileId [file size $gFile]] |
$gTextWindow insert 0.0 [read $fileId [file size $gFile]] |