Alaska Software Inc. - Re: XbpPushButton()
Username: Password:
AuthorTopic: Re: XbpPushButton()
Jim LeeRe: XbpPushButton()
on Wed, 20 Jun 2018 04:54:52 +0200
it is a very old Thread ... neverless it is easy this Way

DO WHILE !lExit = .T.
   nEvent := AppEvent(@mp1, @mp2, @oXbp )
   DO CASE
      CASE nEvent == xbeP_Keyboard .and.;
              mp1 == xbeK_ENTER    .and.;
              ,NOT. EMPTY(oXbp)    .and.;
              oXbp:isDerivedFrom("XbpPushButton")

            send Event to activate Pushbutton
           PostAppEvent(xbeP_Activate,,,oXbp)

   OTHERWISE
      oXbp:handleEvent(nEvent, mp1,mp2)
   ENDCASE
ENDDO

now every Pushbutton can react on ENTER ... if it have Focus !
Carlos a Beling Re: XbpPushButton()
on Wed, 20 Jun 2018 10:20:11 -0300
Hello Jim.
Good morning
Many thanks.
The real problem is that the method :draw() is not executed. Please see 
the attach.
I confirmed it using the debugger.

Fraternaly
Beling

Em 19/06/2018 23:54, Jim Lee escreveu:
> it is a very old Thread ... neverless it is easy this Way
>
> DO WHILE !lExit = .T.
>     nEvent := AppEvent(@mp1, @mp2, @oXbp )
>     DO CASE
>        CASE nEvent == xbeP_Keyboard .and.;
>                mp1 == xbeK_ENTER    .and.;
>                ,NOT. EMPTY(oXbp)    .and.;
>                oXbp:isDerivedFrom("XbpPushButton")
>
>              send Event to activate Pushbutton
>             PostAppEvent(xbeP_Activate,,,oXbp)
>
>     OTHERWISE
>        oXbp:handleEvent(nEvent, mp1,mp2)
>     ENDCASE
> ENDDO
>
> now every Pushbutton can react on ENTER ... if it have Focus !
>
>


NotExecuted.png
Jim LeeRe: XbpPushButton()
on Wed, 20 Jun 2018 16:15:21 +0200
> The real problem is that the method :draw() is not executed.

this Thread was just to activate Button with ENTER
i will answer in other Thread