Class XbpCrt() Foundation
Class function of the XbpCrt class.
The XbpCrt class is the GUI dialog used for applications partially programmed in text mode. An XbpCrt object provides a dialog window for text based and graphic oriented screen output. Using XbpCrt objects, applications programmed for text mode can be transitioned into pure PM applications in a stepwise manner. An XbpCrt object can display text output using functions such as QOut() or DispOut() and can display Get data entry fields (command @... SAY... GET). They can also include graphic dialog elements such as those provided by objects of the XbpPushButton and XbpMLE classes. XbpCrt objects create what are called "hybrid" applications because they combine text and graphic oriented screen output.
The XbpCrt class offers a straightforward way to transition existing text mode applications to GUI applications. An existing Clipper application can run in an XbpCrt window after being compiled with Xbase++. The program code can be changed to use Xbase Parts that provide graphic dialog elements step by step as time permits.
XbpCrt on Windows platforms
For the configuration of an XbpCrt window, the instance variable :taskList plays an important role when the window is displayed on the desktop. See the description of configuration instance variables for details.
When using MDI client windows in an application, there are some particular technical features where Windows differs from OS/2.
The instance variables in this group configure system resources. If changes are made to the default values, they must be made before the :create() method is executed or :configure() must be called to activate the changes.
The instance variables in this group can be changed after :create() is called without requiring a call to :configure(). The changes are automatically registered.
// In the example, two windows are created that are
// visible only within the parent window. After the focus
// changes due to a mouse click, the display focus is changed
// and the output of the function QOut() occurs in the
// window that currently has focus.
#include "Appevent.ch"
PROCEDURE Main
LOCAL nEvent, mp1, mp2, oXbp
LOCAL bSetFocus, bKillFocus
bSetFocus := {|mp1,mp2,obj| ;
QOut( obj:title, "received focus"), ;
SetAppWindow( obj ) }
bKillFocus := {|mp1,mp2,obj| ;
QOut( obj:title, "lost focus") }
oXbp := SetAppWindow() // Parent window
oXbp:setTitle( "Parent" )
oXbp:setInputFocus := bSetFocus
oXbp:killInputFocus := bKillFocus
oXbp := XbpCrt():new( ,, {50, 100}, 10, 40, "Child A" )
oXbp:autoFocus := .F. // First child window
oXbp:create()
oXbp:setInputFocus := bSetFocus
oXbp:killInputFocus := bKillFocus
oXbp := XbpCrt():new( ,, {300, 70}, 15, 35, "Child B" )
oXbp:autoFocus := .F. // Second child window
oXbp:create()
oXbp:setInputFocus := bSetFocus
oXbp:killInputFocus := bKillFocus
nEvent := 0
DO WHILE nEvent <> xbeP_Close // Event loop
nEvent := AppEvent( @mp1, @mp2, @oXbp, 0 )
IF nEvent == xbeK_ESC // Esc terminates
EXIT
ELSEIF nEvent < xbeB_Event // output in window with focus
? "The key has the event code:", nEvent
ELSEIF oXbp <> NIL
oXbp:handleEvent( nEvent, mp1, mp2, oXbp )
ENDIF
ENDDO
RETURN
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.