Method XbpWindow():setModalState() Foundation

Defines the window as modal or non-modal.

:setModalState( <nStatus> ) --> lSuccess
<nStatus> must be included and must be one of the constants defined in XBP.CH:
Constants for the modality of windows
Constant Description
XBP_DISP_MODELESS Window is not modal
XBP_DISP_APPMODAL Window is modal application wide
XBP_DISP_SYSMODAL *) Window is modal system wide
  1. Not supported by Windows

This method returns the value .T. (true) if the window status could be set, otherwise .F. (false) is returned.


The method :setModalState() sets the "modality" of a window. The user can leave a non-modal window at any time simply by clicking the mouse in another window. A modal window, however, must be closed before another windows can be activated. The method :getModalState() can be used to determine the current modality of a window.

If XBP_DISP_APPMODAL is specified, the owner of the window is locked (disabled). This means that the parent and the owner must be different. If the parent and owner are the same, the parent is also disabled. All children are also disabled and output to the window is no longer possible, because it is also a child of the disabled parent. However, the desktop window is an exception. It can be used for both parent and owner.

For example, to create modal XbpDialog window, AppDesktop() is normally used as parent while SetAppWindow() is the owner. This disables the application window until the modal state is reset to XBP_DISP_MODELESS.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.