Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enumify magic return values of HandleEditBox function #2382

Closed
DorpsGek opened this issue Oct 25, 2008 · 5 comments
Closed

Enumify magic return values of HandleEditBox function #2382

DorpsGek opened this issue Oct 25, 2008 · 5 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Zuu opened the ticket and wrote:

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.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2382
@DorpsGek
Copy link
Member Author

Zuu wrote:

:%s/HEBR_DEFAULT/HEBR_OTHER_KEY/g

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2382#comment4945

@DorpsGek
Copy link
Member Author

Zuu wrote:

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.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2382#comment4946

@DorpsGek
Copy link
Member Author

Zuu wrote:

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 :-)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2382#comment4947

@DorpsGek
Copy link
Member Author

Zuu wrote:

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. :-)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2382#comment4948

@DorpsGek
Copy link
Member Author

glx closed the ticket.

Reason for closing: Implemented

In r14534. Thanks for the patch.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2382

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant