Skip to main content
Topic: [patch] Fix erratic behaviour of buttons (Read 2213 times) previous topic - next topic

[patch] Fix erratic behaviour of buttons

A small patch which fixes the following problems :

1) In the main menu, if for instance we click on the "Load" button, but accidentally slipped the mouse pointer to the "Save" button before releasing the left mouse button, both Load and Save dialogs will appear.

2) In the New Game dialog, if we click (and keep pressing the mouse button) on the right arrow button of, say, the "No.of cities" field, even if we drag the mouse pointer far away from the arrow, the figure still keeps increasing.

With this patch, if you accidentally click the wrong button, move the mouse pointer out of the button and release the mouse to undo the initial click, then you can choose the correct button again. This should be in line with the standard behaviour of buttons in at least the Windows operating system.

Re: [patch] Fix erratic behaviour of buttons

Reply #1
Small and useful: Thank you.

Re: [patch] Fix erratic behaviour of buttons

Reply #2
Thank you for incorporating it, Prissi.

After second thought, there is a minor loophole with the patch, though it doesn't seem to cause any problem currently. Anyway, it's better to be safe than sorry, and to make sure all code are really correct; thus I produced the attached patch to fix the loophole. It's against r3046.