832
832
# If a parameter "-animate" is specified, board changes are animated.
834
834
proc updateBoard {args} {
835
global boardSize gameInfo
836
835
set pgnNeedsUpdate 0
838
837
foreach arg $args {
839
838
if {! [string compare $arg "-pgn"]} { set pgnNeedsUpdate 1 }
840
839
if {! [string compare $arg "-animate"]} { set animate 1 }
843
::board::resize .main.board $boardSize
842
if {$pgnNeedsUpdate} { ::pgn::Refresh $pgnNeedsUpdate }
844
::board::resize .main.board $::boardSize
844
845
::board::setmarks .main.board [sc_pos getComment]
845
846
::board::update .main.board [sc_pos board] $animate
847
# Update the status of each navigation button:
848
after cancel updateNavButtons
849
after cancel notifyPosChange
853
after idle updateNavButtons
854
after idle notifyPosChange
858
# Update the status of each navigation button
860
proc updateNavButtons {} {
848
861
if {[sc_pos isAt start]} {
849
862
.main.fbutton.button.start configure -state disabled
850
863
} else { .main.fbutton.button.start configure -state normal }
885
898
.main.fbutton.button.exitVar configure -state normal
888
if {![sc_base inUse] || $::trialMode || [sc_base isReadOnly]} {
889
.main.tb.save configure -state disabled
902
set comment [sc_pos getComment]
903
# remove technical comments, notify only human readable ones
904
regsub -all {\[%.*\]} $comment {} comment
905
if {$comment != ""} {
906
.main.fbutton.button.comment configure -image comment_avail -relief flat
907
::utils::tooltip::Set .main.fbutton.button.comment $comment
891
.main.tb.save configure -state normal
909
.main.fbutton.button.comment configure -image comment_unavail -relief flat
910
::utils::tooltip::UnSet .main.fbutton.button.comment
915
# Update the game status window .main.gameInfo
917
proc updateGameInfo {} {
893
920
.main.gameInfo configure -state normal
894
921
.main.gameInfo delete 0.0 end
895
922
::htext::display .main.gameInfo [sc_game info -hide $gameInfo(hideNextMove) \
906
933
.main.gameInfo configure -state disabled
907
934
updatePlayerPhotos
938
# Notify other windows of current position changes
940
proc notifyPosChange {} {
941
if {![sc_base inUse] || $::trialMode || [sc_base isReadOnly]} {
942
.main.tb.save configure -state disabled
944
.main.tb.save configure -state normal
947
if {$::showGameInfo} { updateGameInfo }
909
if {[winfo exists .analysisWin1]} { updateAnalysis 1 }
910
if {[winfo exists .analysisWin2]} { updateAnalysis 2 }
911
# if {[winfo exists .treeWin]} { ::tree::refresh }
913
if {[winfo exists .commentWin]} { ::commenteditor::Refresh }
914
if {[::tb::isopen]} { ::tb::results }
951
::commenteditor::Refresh
921
956
if {[winfo exists .twinchecker]} { updateTwinChecker }
922
if {[winfo exists .pgnWin]} { ::pgn::Refresh $pgnNeedsUpdate }
923
958
if {[winfo exists .bookWin]} { ::book::refresh }
924
959
if {[winfo exists .bookTuningWin]} { ::book::refreshTuning }
925
if {[winfo exists .noveltyWin]} { updateNoveltyWin }
928
set comment [sc_pos getComment]
929
# remove technical comments, notify only human readable ones
930
regsub -all {\[%.*\]} $comment {} comment
931
if {$comment != ""} {
932
.main.fbutton.button.comment configure -image comment_avail -relief flat
933
::utils::tooltip::Set .main.fbutton.button.comment $comment
935
.main.fbutton.button.comment configure -image comment_unavail -relief flat
936
::utils::tooltip::UnSet .main.fbutton.button.comment
940
964
# Set up player photos: