Modified the toolkit behavior so that a default callback to update

the dialog (and run limit checks) is installed by default on
checkboxes and selection menus, as it is already done for entry
boxes.  Otherwise it is possible to make a selection (like changing
a device type) that invalidates the existing values, but if Apply
is hit immediately afterward, then no checks will be run and the
values may be used as-is even if invalid.  This does not prohibit
the use of "add_dependency" to change the callback behavior.
This commit is contained in:
R. Timothy Edwards 2025-10-16 17:08:15 -04:00
parent c977e4cf76
commit 6b8f5d1d67
2 changed files with 11 additions and 2 deletions

View File

@ -1 +1 @@
8.3.563 8.3.564

View File

@ -1153,7 +1153,10 @@ proc magic::add_entry {pname ptext parameters} {
#---------------------------------------------------------- #----------------------------------------------------------
# Default entry callback, without any dependencies. Each # Default entry callback, without any dependencies. Each
# parameter changed # parameter changed causes an update to the dialog. Also
# add default callbacks on checkboxes and choice menus,
# using a null function which does not get executed, but
# the dialog gets updated afterward.
#---------------------------------------------------------- #----------------------------------------------------------
proc magic::add_check_callbacks {gencell_type library} { proc magic::add_check_callbacks {gencell_type library} {
@ -1166,6 +1169,12 @@ proc magic::add_check_callbacks {gencell_type library} {
bind $w <FocusOut> \ bind $w <FocusOut> \
"magic::update_dialog {} $pname $gencell_type $library" "magic::update_dialog {} $pname $gencell_type $library"
} }
if {[regexp {\.params\.body\.area\.edits\.(.+)_sel} $w valid pname]} {
magic::add_dependency \{\} $gencell_type $library $pname
}
if {[regexp {\.params\.body\.area\.edits\.(.+)_chk} $w valid pname]} {
magic::add_dependency \{\} $gencell_type $library $pname
}
} }
} }