[Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel

Tony Morehen tmorehen at ...3602...
Wed Jul 19 15:33:20 CEST 2017


That is the documented behaviour:

All Message functions can have up to three buttons:

  *

    The first button is always the default button.

  *

    The last button is always the cancel button.


On 2017-07-19 09:20 AM, bugtracker at ...3416... wrote:
> http://gambaswiki.org/bugtracker/edit?object=BUG.1128&from=L21haW4-
>
> C THAL reported a new bug.
>
> Summary
> -------
>
> Message.Question should return -1 on cancel
>
> Type             : Bug
> Priority         : Medium
> Gambas version   : 3.9.90 (TRUNK)
> Product          : Language
>
>
> Description
> -----------
>
> Message.Question returns 2 if the message window was closed or canceled via <Esc>.
>
> That is bad, especially if there are two buttons and the action should not be default, but on button two, like so:
>
> Dim ret as integer
>
> ret = Message.Question("Do you really want to delete all?", "No", "Yes")
>
> --------------------------------------------------------------------------
>
> If the user cancels or closes the window of the message it returns 2! All will be deleted ...
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user




More information about the User mailing list