Page 1 of 1

How can i make an external application dialog modal in Xbase

Posted: Thu Nov 30, 2017 8:11 am
by unixkd
Hi all

How can i make an external application dialog modal in Xbase ???

Thanks

Joe

Re: How can i make an external application dialog modal in X

Posted: Thu Nov 30, 2017 8:31 am
by rdonnay
According the the Xbase++ docs, Windows does not support system wide modality.

XbpWindow:setModalState()
Defines the window as modal or non-modal.

:setModalState( <nStatus> ) --> lSuccess
Parameters
<nStatus>
<nStatus> must be included and must be one of the constants defined in XBP.CH:

Constants for the modality of windows
Constant Description
*) Not supported by Windows
XBP_DISP_MODELESS Window is not modal
XBP_DISP_APPMODAL Window is modal application wide
XBP_DISP_SYSMODAL *) Window is modal system wide


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

Description
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.

Important note:

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.