OpenTTD

Tasklist

FS#2382 - Enumify magic return values of HandleEditBox function

Attached to Project: OpenTTD
Opened by Leif Linse (Zuu) - Saturday, 25 October 2008, 18:57 GMT
Last edited by Loïc GUILLOUX (glx) - Saturday, 25 October 2008, 19:59 GMT
Type Patch
Category Interface
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Today HandleEditBox returns {0, 1, 2} where 1 stands for return/enter key, 2 for escape key and 0 for all other cases.

This patch enumifies these return values.


Suggestions for what to call the 0-enum are welcome. I've used the name "default" which doesn't describe it very good but good names are always hard. "other key" could be a possibility.
This task depends upon

Closed by  Loïc GUILLOUX (glx)
Saturday, 25 October 2008, 19:59 GMT
Reason for closing:  Implemented
Additional comments about closing:  In r14534. Thanks for the patch.
Comment by Leif Linse (Zuu) - Saturday, 25 October 2008, 19:05 GMT
:%s/HEBR_DEFAULT/HEBR_OTHER_KEY/g
Comment by Leif Linse (Zuu) - Saturday, 25 October 2008, 19:14 GMT
The comment after HEBR_OTHER_KEY is quite unnecessary now. Also we don't want to have a ask for suggestion of the name in trunk I guess.

Change:
* Removed the comment after HEBR_OTHER_KEY
* Made sure there is no white space laying around on the end of that line, or elsewhere in lines added by the patch.
Comment by Leif Linse (Zuu) - Saturday, 25 October 2008, 19:33 GMT
Renamed enums to: "HEBR_EDITING", "HEBR_CONFIRM", "HEBR_CANCEL"

Removed unnecessary comments when checking for these enums. No need to tell that we are checking for Escape key etc. any more.


Kept an eye on white spaces at end of line :-)
Comment by Leif Linse (Zuu) - Saturday, 25 October 2008, 19:52 GMT
Fixed problems with applying the patch.

All problems had to do with edits of lines other than the + lines. A removed line was accidentally edited and a space on non-edited line was also removed.


This version applies and compiles with MSVS. :-)

Loading...