BUTTON via DCGETOPTIONS

This forum is for eXpress++ general support.
Post Reply
Message
Author
Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

BUTTON via DCGETOPTIONS

#1 Post by Janko »

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

User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: BUTTON via DCGETOPTIONS

#2 Post by Tom »

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."

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: BUTTON via DCGETOPTIONS

#3 Post by Janko »

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.

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

Or I misunderstood your guidelines.

Thanks for your ansver

JAnko

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: BUTTON via DCGETOPTIONS

#4 Post by rdonnay »

LOCAL aButtons:={ { (bBlock),90,,{|| (if(lFlt,lflt:=.f.,lFlt:=.t.), DC_GetRefresh(Getlist))} } }
This is not correct.

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.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: BUTTON via DCGETOPTIONS

#5 Post by Janko »

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'.

Code: Select all


aButtons:=  {  {'ON/OFF ',90,,{|| (if(lFlt,lflt:=.f.,lFlt:=.t.), DC_GetRefresh(Getlist))} } }    //   original button definition   

Thanks in advance

JAnko

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: BUTTON via DCGETOPTIONS

#6 Post by rdonnay »

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.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: BUTTON via DCGETOPTIONS

#7 Post by Janko »

Thanks, it Works like desired.

BR JAnko

Post Reply