cancel clause with tsbutton still fires valid

cancel clause with tsbutton still fires valid

Postby Gale FORd » Mon Nov 13, 2006 9: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?
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Postby toya » Tue Nov 14, 2006 12:08 am

I use:

Code: Select all  Expand view
////////////////
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
User avatar
toya
 
Posts: 38
Joined: Sat Dec 31, 2005 10:08 am
Location: Brasil

Postby Ruben Fernandez » Tue Nov 14, 2006 3: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.
Ruben Fernandez
 
Posts: 366
Joined: Wed Aug 30, 2006 5:25 pm
Location: Uruguay


Return to FiveWin for Harbour/xHarbour

Who is online

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

cron