I am widely using creation of push buttons via GETOPTIONS descriptions in aButtons.
But when it is needed to change caption of a button during run time there is a problem (for me) how to access it. Parameter 7 in aButtons array is obviously not a name of the object, so what would be the way to change the caption?
Thanks and regards
JAnko
BUTTON via DCGETOPTIONS
Re: BUTTON via DCGETOPTIONS
Use a codeblock for the caption. Call DC_GetRefresh(GetList) when changing is needed.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: BUTTON via DCGETOPTIONS
Tom,
this is how button(s) is created. Caption is empty. If I read the manual for 'BUTTONS' option in DCGETOPTIONS, only 'C' is allowed as a caption definition.
Or I misunderstood your guidelines.
Thanks for your ansver
JAnko
this is how button(s) is created. Caption is empty. If I read the manual for 'BUTTONS' option in DCGETOPTIONS, only 'C' is allowed as a caption definition.
Code: Select all
LOCAL bBlock:={|| if(lFlt,' OFF ',' ON ')}
LOCAL aButtons:={ { (bBlock),90,,{|| (if(lFlt,lflt:=.f.,lFlt:=.t.), DC_GetRefresh(Getlist))} } }
DCGETOPTIONS BUTTONS aButtons
DCREAD GUI TITLE "Izbor " ;
FIT MODAL SETAPPWINDOW ;
BUTTONS DCGUI_BUTTON_OK OPTIONS GetOptions FIT TO lOk
Thanks for your ansver
JAnko
Re: BUTTON via DCGETOPTIONS
This is not correct.LOCAL aButtons:={ { (bBlock),90,,{|| (if(lFlt,lflt:=.f.,lFlt:=.t.), DC_GetRefresh(Getlist))} } }
Please explain how you want the button to behave and I will show you the code to do it.
The eXpress train is coming - and it has more cars.
Re: BUTTON via DCGETOPTIONS
Roger,
I want to change caption of button that is defined via DGGETOPTIONS during runtime. When lFlt:=.t. caption is 'ON' otherwise it is 'OFF'.
Thanks in advance
JAnko
I want to change caption of button that is defined via DGGETOPTIONS during runtime. When lFlt:=.t. caption is 'ON' otherwise it is 'OFF'.
Code: Select all
aButtons:= { {'ON/OFF ',90,,{|| (if(lFlt,lflt:=.f.,lFlt:=.t.), DC_GetRefresh(Getlist))} } } // original button definition
JAnko
Re: BUTTON via DCGETOPTIONS
Try this:
Code: Select all
aButtons := { {||IIF(lFlt,'ON','OFF')},90,,{||lFlt := !lFlt, DC_GetRefresh(Getlist)} } }
The eXpress train is coming - and it has more cars.
Re: BUTTON via DCGETOPTIONS
Thanks, it Works like desired.
BR JAnko
BR JAnko