Bug in TButton CANCEL clause

Bug in TButton CANCEL clause

Postby Enrico Maria Giordano » Fri Feb 17, 2006 10:45 pm

The following sample shows that if you hit ALT-C the DIALOG is closed but the VALID of the GET is also executed while if you click on the button with the mouse the VALID is not executed (as it should be):

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := SPACE( 20 )

    DEFINE DIALOG oDlg

    @ 1, 1 GET cVar;
           VALID ( MSGINFO( "Hello" ), .T. )

    @ 3, 1 BUTTON "&Close";
           ACTION oDlg:End();
           CANCEL

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sat Feb 18, 2006 1:48 am

Enrico,

I think you have it backwards. It sounds like the bug is in the Alt-C not the clicking the button. Valids are NOT supposed to be executed when the CANCEL clause is used. If there were, then you could not cancel a new (empty) dialog without filling in any data necessary to meet any VALIDs (and then such data would be discarded). Correct?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Feb 18, 2006 12:48 pm

Yes, the bug is in the Alt-C. That's what I said (or that I was trying to say, sorry for my bad english).

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby dpaterso » Sat Feb 18, 2006 12:57 pm

Hello,

Quite right - just tested - does the same on all of my dialogs - Cancel Button (with CANCEL clause) when clicked - no problem / Alt-C - big problem - GET is VALIDATED.

Dale.
dpaterso
 
Posts: 142
Joined: Tue Jan 24, 2006 9:45 am
Location: South Africa

Postby James Bott » Sat Feb 18, 2006 8:15 pm

Enrico,

Yes, the bug is in the Alt-C. That's what I said (or that I was trying to say, sorry for my bad english).


My apologies, it was my misunderstanding--not your English. I misread this:

click on the button with the mouse the VALID is not executed (as it should be):


I thought is said "(but it should be)."

So, as you said Alt-C should not execute the VALID.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sat Feb 18, 2006 10:00 pm

James Bott wrote:My apologies, it was my misunderstanding--not your English. I misread this:


No problems, James.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 77 guests