FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour cancel clause with tsbutton still fires valid
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
cancel clause with tsbutton still fires valid
Posted: Mon Nov 13, 2006 09:12 PM

I have run across a problem with tsbutton, latest FWH, and Xharbour builder.

I create a dialog with some gets with valids and tsbutton with cancel clause. When I press the button it still executes the valid on the get that has focus at the time.

Is anyone else having this problem?
Do you need for me to create sample?

Posts: 38
Joined: Sat Dec 31, 2005 10:08 AM
cancel clause with tsbutton still fires valid
Posted: Tue Nov 14, 2006 12:08 AM
I use:

////////////////
function teste()
////////////////

local lButton:=.f.

....
....
REDEFINE GET aoGets[01] VAR aDados[01] ID 101 OF oDlg PICTURE '99999' ;
        VALID lButton(@lButton) .and. VerDados( @aDados, aoGets, 1, 5, '99999' )
....
....
REDEFINE SBUTTON aoBtn[02] ID 510 OF oDlg RESOURCE 'EXIT' ACTION ( lButton:=.t., oDlg:end() )
....
....
ACTIVATE DIALOG oDlg CENTERED
return nil


///////////////////////////
function lButton( lButton )
///////////////////////////
local lOk:=.t.
if lButton
       lOk:=.f.
endif
lButton:=.f.
return lOk
toya
Ahora en la version 6.6
Consultoria e Desenvolvimento - NF-e/NFC-e
http://www.toyanet.com.br
https://www.facebook.com/profile.php?id=100009195956044
toyasis@gmail.com
FWH 10.8+PellesC+xHarbour.org 1.2.1
Posts: 366
Joined: Wed Aug 30, 2006 05:25 PM
cancel clause with tsbutton still fires valid
Posted: Tue Nov 14, 2006 03:09 AM

Gale:

Try this: In Control.prg Method KillFocus() add TSBUTTON like this line

METHOD KillFocus( hCtlFocus ) CLASS TControl

local oWnd

if ! Empty( hCtlFocus ) .and. ::bValid != nil .and. WndParents( hCtlFocus, ::hWnd ) .and. ;
( oWnd := oWndFromhWnd( hCtlFocus ) ) != nil .and. ;
Upper( oWnd:Classname() ) $ "TBUTTON;TBTNBMP;TBUTTONBMP;TSBUTTON" .and. ;

Tell me what about.

Regards
Ruben Fernandez.

Gracias y Saludos

Ruben Fernandez - Uruguay

FWH 11.06, Harbour, Borland 5.82

Continue the discussion