UI_Accept Command
Obsolete
Use Popup to activate a modal dialog and Activate_View to activate a View. See Activate for detailed explanations of the View and Modal Dialog activation process.
In character mode DataFlex, UI_Accept was used to start a new UI processing loop for modal dialogs. Execution would not pass to the line following the UI_Accept until the child user interface (UI) loop was stopped. At that point, the previous UI loop takes over. That's how modality was handled. The UI loop is stopped in two ways:
- You either send Stop_UI
- You return a non-zero value from one of the messages called by the UI loop (that's why Cancel and OK returned values).
The strategy of returning a non-zero value from a procedure call never held up very well when augmented, so Stop_UI is normally used (and this is usually wrapped in some other method used to close a dialog). Even in character mode, we tried to hide all of this so you never needed to use it.
In Windows, the UI_Accept is automatic. When you activate a modal dialog, we do a lot more to make it work. We hook into the Windows modality logic (i.e., disable all underlying windows) and we start a new UI loop for you. This all occurs inside of the private event Create_Dialog, which is triggered when you activate the dialog. The goal is to ensure that you cannot activate a modal dialog without starting a new UI level and that this child UI level is always closed and only closed when the modal dialog is deactivated. When one happens without the other, it is always going to create problems.