Roger,
We use addbuttons on most menu options, and on a lot of big jobs we give them progress of what the system is doing with osay on the same window.
The issue is that the user can stilll click on ok/cancel and stop the job, which actually causes an error.
Is there a built-in method to stop them from clicking anything once ok is clicked. On some I do not like to use waiton, or users to not like it. Actually does not happen very often but still want to block it.
Suppose I could add my own ok/cancel and then use a WHEN to not allow it, but did not know if you can do it with addbuttons.
Sample below:
@ 7,2 DCSAY "" SAYSIZE 50 SAYOBJECT oSAY1
DCGETOPTIONS NORESIZE TABSTOP COLOR &QQONE ;
SAYRIGHTBOTTOM ;
CHECKGET EXITVALIDATE ;
NOESCAPEKEY ;
TITLE 'EMAIL TRIAL STATEMENTS' ;
DCREAD GUI ADDBUTTONS ;
TO lStatus ;
ENTEREXIT FIT ;
; // MODAL ;
OPTIONS GetOptions ;
APPWINDOW oMainDialog:drawingArea ;
NODESTROY ;
PARENT @oDialog ;
; // SAVE
Thanks
fred
Omni
Blocking buttons
Re: Blocking buttons
Hi, Fred.
Look at the BUTTONS clause of DCGET OPTIONS. It accepts a two-dim array for the buttons to be added, like this:
Every line of this BUTTONS-array may be up to 12 or 13 items long (in the sample, every line has 4 items - 1 is the caption, 2 the width, 3 the height, 4 the action codeblock). Item # 8 is a WHEN clause for those buttons.
Look at the BUTTONS clause of DCGET OPTIONS. It accepts a two-dim array for the buttons to be added, like this:
Code: Select all
DCGET OPTIONS ;
BUTTONS {{"OK",30,20,{||lOk:=.T.,DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)} },;
{"CANCEL",50,20,{||lOk:=.F.,DC_ReadGuiEvent(DCGUI_EXIT_ABORT,GetList)} } } ;
ICON MY_ICON
DCREAD GUI ... BUTTONS DCGUI_BUTTONS_CUSTOM
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."