I created a small form, YesNoCancel, with 3 buttons defaulting to Yes,
No and Cancel.
Each button has a small EEP; e.g. for the cancel button:
--Cancel button; YesNoCancel form
SET VAR vYNCResponse TEXT = 'Cancel'
CLOSEWINDOW
RETURN
There's an OnAfterStart EEP on the YesNoCancel form.
It can provide a caption for the form and hide a button if needed.
Cancel Button properties are repeated for other buttons:
SET VAR +
vYNCFormCaption TEXT, +
vYNCCancelCaption TEXT, +
vYNCNoCaption TEXT, +
vYNCYesCaption TEXT
IF vYNCFormCaption IS NOT NULL THEN
PROPERTY RBASE_FORM CAPTION .vYNCFormCaption
ENDIF
--Cancel Button properties
IF vYNCCancelCaption = '-' THEN
PROPERTY cidCancel VISIBLE 'False'
ELSE
IF vYNCCancelCaption IS NOT NULL THEN
PROPERTY cidCancel CAPTION .vYNCCancelCaption
ENDIF
SET VAR vYNCCancelHint TEXT
IF vYNCCancelHint IS NOT NULL THEN
PROPERTY cidCancel HINT .vYNCCancelHint
ENDIF
ENDIF
...
RETURN
When I want to use the three button form, I set up the variables.
In this example, the "Cancel" has been replaced by "Edit" with the
appropriate hint.
SET VAR +
vYNCFormCaption TEXT = ('Finished Editing'), +
vYNCCancelCaption TEXT = ('Edit'), +
vYNCCancelHint TEXT = ('Return to editing.'), +
vYNCNoHint TEXT = ('Discard all changes and exit.'), +
vYNCYesHint TEXT = ('Process the data and exit.'), +
vYNCMsg TEXT = ('Do you want to save this receipt?'), +
vYNCResponse TEXT = NULL
EDIT USING YesNoCancel
CLEAR VAR vYNCCancelHint,vYNCFormCaption,vYNCNoHint,vYNCMsg,vYNCYesHint
Then you can use vYNCResponse in IF statements or CASE/SWITCH.
Doug
On 2/5/2016 9:14 AM, Carpet Broker, Dick Fey wrote:
I use dialog with buttons for all sorts of things, usually to give 2
options, but not 'yes' 'no' , controlled by eeps.
Is it possible to add a third button ??? Has anyone ever tried that?
I know of other ways to get the result, but dialog boxes are so easy.
I am sure the Rbase team wonders how we come up with such strange
requests.
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus