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
button caption bug
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: button caption bug
This is a working sample:
EMG
Code: Select all
#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
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Re: button caption bug
Enrico,EnricoMaria wrote:This is a working sample:
EMGCode: Select all
#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
Thank you
Richard