Page 1 of 1

Dialog Button.Visible property not working

PostPosted: 17 May 2016 20:46
by ScottWGast
It seems that the dialog's buttons .Visible property is not being processed when the dialog is rendered. The buttons always display even if their .Visible property is False.

Code: Select all
    Self.dialogModal.JQDialogOptions.Buttons.Clear;
    buttonDialog := Self.dialogModal.JQDialogOptions.Buttons.Add;
    buttonDialog.Text             := C_DIALOG_BUTTON_CAPTION_CANCEL;
    buttonDialog.OnClick.OnEvent  := Self.CloseModalDialog;
    buttonDialog.Visible          := True;
    iCancelButtonIndex            := buttonDialog.Index;

    buttonDialog := Self.dialogModal.JQDialogOptions.Buttons.Add;
    buttonDialog.Text             := C_DIALOG_BUTTON_CAPTION_CLOSE;
    buttonDialog.OnClick.OnEvent  := Self.CloseModalDialog;
    buttonDialog.Visible          := False;
    iCloseButtonIndex             := buttonDialog.Index;

    buttonDialog := Self.dialogModal.JQDialogOptions.Buttons.Add;
    buttonDialog.Text             := C_DIALOG_BUTTON_CAPTION_SAVE;
    buttonDialog.OnClick.OnEvent  := Self.CloseModalDialog;
    buttonDialog.Visible          := True;
    iSaveButtonIndex              := buttonDialog.Index;


dialog.png

(Event Self.CloseModalDialog is smart enough to know which button is pressed)

Scott

DXE2Updt4/IW14.0.52/CG2.9.0.251

Re: Dialog Button.Visible property not working

PostPosted: 17 May 2016 22:23
by ScottWGast
I cannot duplicate the error in a small demo.

I will continue to investigate why the non-visible buttons are being shown.