Discussion:
[Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel
b***@gambaswiki.org
2017-07-19 13:20:52 UTC
Permalink
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 ...
Tony Morehen
2017-07-19 13:33:20 UTC
Permalink
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.
Post by b***@gambaswiki.org
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>.
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
https://lists.sourceforge.net/lists/listinfo/gambas-user
Gianluigi
2017-07-19 21:08:09 UTC
Permalink
Thal, you could take a look at this discussion [0]

Regards
Gianluigi

[0] http://gambas.8142.n7.nabble.com/MessageBox-problem-td56154.html#a56231
Post by Tony Morehen
*
The first button is always the default button.
*
The last button is always the cancel button.
Post by b***@gambaswiki.org
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
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
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------
------------------
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
https://lists.sourceforge.net/lists/listinfo/gambas-user
b***@gambaswiki.org
2017-07-19 13:42:37 UTC
Permalink
http://gambaswiki.org/bugtracker/edit?object=BUG.1128&from=L21haW4-
* The first button is always the default button.
* The last button is always the cancel button.
http://gambaswiki.org/wiki/comp/gb.qt4/message

and for tony, it must be answered in the bugtracker.. the nex time, i'll make now but take in consideration that the next time:

PICCORO LENZ MCKAY changed the state of the bug to: Invalid.
b***@gambaswiki.org
2017-07-19 22:30:34 UTC
Permalink
http://gambaswiki.org/bugtracker/edit?object=BUG.1128&from=L21haW4-

Comment #2 by C THAL:

Ok, thank you all. I did not see it because I just saw http://gambaswiki.org/wiki/comp/gb.form/message (linked from inside the IDE).
b***@gambaswiki.org
2017-07-20 17:46:51 UTC
Permalink
http://gambaswiki.org/bugtracker/edit?object=BUG.1128&from=L21haW4-

Comment #3 by PICCORO LENZ MCKAY:

inside the ide you can click as if you are into a browser... and see documentation in message.question or whatever..

also remenber that some wiki's are not updated, by example i try to mantain the spanish wiki up to date.. but i can cover all the changes..
Loading...