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:
parent
c977e4cf76
commit
6b8f5d1d67
|
|
@ -1153,7 +1153,10 @@ proc magic::add_entry {pname ptext parameters} {
|
|||
|
||||
#----------------------------------------------------------
|
||||
# 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} {
|
||||
|
|
@ -1166,6 +1169,12 @@ proc magic::add_check_callbacks {gencell_type library} {
|
|||
bind $w <FocusOut> \
|
||||
"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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue