assign escbtn and defbtn appropriately

Behaviorally: This change makes it so that Enter will never cancel
a dialog, unless that dialog only contains info to be read. Escape
will never unpredictably be treated as Enter. And some dialogs without
Escape to cancel, now can be canceled with Escape.

A lot of this just refactors dialogs to define the cancel button
at the top, not as a hotkey on a cancel button deep in the XML.
I think this makes enter/escape behavior in dialogxml files more
legible at a glance.
This commit is contained in:
2025-03-27 13:34:44 -05:00
parent 1b65be5ab4
commit 3e3b2e1e6f
95 changed files with 184 additions and 185 deletions

View File

@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!-- NOTE: This file should be updated to use relative positioning the next time it changes. -->
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
<dialog defbtn='set'>
<dialog defbtn='set' escbtn='cancel'>
<pict type='dlog' num='7' top='8' left='8'/>
<text size='large' top='8' left='50' width='200' height='17'>Edit Stuff Done</text>
<text top='30' left='50' width='200' height='50'>
@@ -15,6 +15,6 @@
<text top='145' left='8' width='100' height='16'>Value:</text>
<field name='val' top='143' left='110' width='80' height='16'/>
<text name='feedback' top='165' left='8' width='230' height='16'/>
<button name='exit' def-key='esc' type='regular' top='185' left='122'>Exit</button>
<button name='exit' type='regular' top='185' left='122'>Exit</button>
<button name='set' type='regular' top='185' left='187'>Set</button>
</dialog>