FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TButton CANCEL clause
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TButton CANCEL clause
Posted: 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):

#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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Bug in TButton CANCEL clause
Posted: Sat Feb 18, 2006 01: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TButton CANCEL clause
Posted: 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

Posts: 142
Joined: Tue Jan 24, 2006 09:45 AM
Bug in TButton CANCEL clause
Posted: 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.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Bug in TButton CANCEL clause
Posted: Sat Feb 18, 2006 08: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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TButton CANCEL clause
Posted: 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

Continue the discussion