
This method will close the indicated dialog.
Returns the following according to the situation:
The recommended convention is passing the control identifier directly:
Copy Code |
|---|
(Odcl_Form_Close MyDialogReference [as Reference]) |
An alternative convention is to identify the control by providing the project file, the dialog name and the control name:
Copy Code |
|---|
(Odcl_Form_Close ProjectFile [as String] DialogName [as String] ControlName [as String]) |
This function must be the last function called in an event defun. Any functions called from within the event defun after this function may not work correctly. The reason is because the dialog box is not completely closed until the event defun is completed. Many va, vla, vlax and command function calls may not work from the event defun. The correct way to call these functions is to call them after the Form_Close function is completed.
See the example below on how to correctly handle this situation.
Dockable, FileDialog, Modal, Modeless.
This example relates to the remark above.
Copy Code |
|---|
(defun c:show (/ bOkPressed) ; set the flag to nil (setq bOkPressed Nil) ; here is the event defun that is to closes the dialog box. (defun c:dialog_OK_OnClicked () ; set the flag as true so our completion code will be activated. (setq bOkPressed T) ; now close the dialog box (odcl_form_close project_dialog) ) ; here is the event defun that cancels the dialog box (defun c:dialog_Cancel_OnClicked () ; set the flag as nil so our completion code ; will NOT be activated. (setq bOkPressed Nil) ; now close the dialog box (odcl_form_close project_dialog) ) ; load the project if not already loaded. (odcl_loadproject "project") ; show the dialog box. (odcl_form_show project_dialog) ; if the OK button was pressed. (if (= bOkPressed T) ; now lets do completion code, ; (in this case a simple command call) (command "line" (list 0 0) (list 10 10) "") ) ) |