when clausule from a button

when clausule from a button

Postby Franklin Demont » Mon Jan 28, 2013 11:11 am

Hello ,

Code: Select all  Expand view

lBuild := .F.
DEFINE BUTTON oBut[2] OF oBar PROMPT "Edit" RESOURCE "edit32" ;
    ACTION ( (cAlias)->(RelBuilder(oBrw,oBrwAct,aInto,@lBuild)),;
              oBrw:Refresh() ,;
          oBrw:SetFocus(),;
          oWnd:AevalWhen() )    
...
DEFINE BUTTON oBut[4] OF oBar PROMPT "Set Relations" RESOURCE "buildall" GROUP ;
            WHEN (lBuild);


......

oBrw:bkeyDown   := { | nkey | IIF(nkey==13 , EVAL(oBut[2]:bAction)  ,;
    IIF(nkey==VK_DELETE .AND. EVAL(oBut[3]:bWhen) ,;
                 EVAL(oBut[3]:bAction)  ,  )  )}

oBrw:bLDblClick := {||EVAL(oBut[2]:bAction) }

 


Relbuilder set lBuild to .T. when the save button is clicked

Using button edit works as expected after editing oBut[4] changes from disabled in enabled

BUT enter or doubleclicking in the browse let edit , but doesn't change obut[4] : it is still disabled !

Placing a tracelog in the when clausule from obut[4] : When (tracelog(lBuild) , lBuild) :

When the edit button is used , i can see that oWnd:AevalWhen() is executed , lBuild = .T.

Using enter or doubleclicking : AevalWhen seems not to be executed !!!!!!!

Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Solved : oWnd:oBar:AevalWhen()

Postby Franklin Demont » Mon Jan 28, 2013 12:18 pm

Using a buttonbar we must

oWnd:oBar:AevalWhen()

Still : Why it works when the edit button is used AND Aevalwhen is executed and why not whit doubleclicking ?
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests