Page 1 of 1

button caption bug

PostPosted: Tue Mar 14, 2006 9:26 pm
by Richard Chidiak
We can not change anymore the button caption "on the fly" as in the sample below. The caption does not change.
Using sbutton instead of button will display the correct caption while clicking.

Richard

FUNCTION MAIN()
LOCAL oDlg,OBTN
LOCAL LTEST := .T.

DEFINE DIALOG oDlg TITLE "Button test"
@ 01,01 BUTTON OBTN PROMPT "Activate" OF ODLG SIZE 50,12 ;
ACTION (if(LTEST,(LTEST := FALSE,obtn:ccaption := "Active" ),(LTEST := TRUE ,obtn:ccaption := "Inactive" )) , obtn:refresh(),ODLG:update())
ACTIVATE DIALOG oDlg CENTER

return nil

Re: button caption bug

PostPosted: Tue Mar 14, 2006 10:04 pm
by Enrico Maria Giordano
This is a working sample:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBtn

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON oBtn PROMPT "Change";
           ACTION oBtn:SetText( "Changed" )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG

Re: button caption bug

PostPosted: Wed Mar 15, 2006 12:02 pm
by Richard Chidiak
EnricoMaria wrote:This is a working sample:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBtn

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON oBtn PROMPT "Change";
           ACTION oBtn:SetText( "Changed" )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG


Enrico,

Thank you

Richard