Class XbpPartHandler() Foundation

Class function of the XbpPartHandler class.

Description

The XbpPartHandler class is an abstract class that provides the mechanism used by subclass objects to recognize and react to events. XbpPartHandler is the superclass for all Xbase Parts used to program graphic dialogs. All of the Xbase Parts that can process messages or events are derived from the XbpPartHandler class (for example, XbpPushButton() and XbpDialog()).

In addition to event handling, the XbpPartHandler class defines physical and logical relationships between Xbase Parts. This includes the relationships between the parent, owner, and children of each Xbase Part. For example, if a pushbutton is displayed in a dialog window, the pushbutton is considered within the dialog and is therefore a child of the dialog. Similarly, the dialog is the parent of the pushbutton. Parent-child relationships describe a physical relationship: a child is contained in the parent. A parent can have several children (1:n relationship), but a child can have only one parent (1:1 relationship).

Owner relationships are logical relationships. They are generally defined only for applications with a main window and several associated windows that are not contained in the main window. However, these associated windows are closed when the main window is closed, since this indicates that the application has terminated. The main window is the owner of the associated windows.

Since the XbpPartHandler class is an abstract class, instances of it are not created. It is only used as a superclass for defining other classes whose instances are able to process events through inherited behavior.

Instance variables
:cargo
Instance variable for ad-hoc use.
Life cycle
:init()
Initializes an instance of the XbpPartHandler class.
:create()
Requests system resources.
:configure()
Reconfigures the object after system resources have been allocated.
:destroy()
Releases system resources.
:handleEvent()
Processes events.
:status()
Determines the status of an Xbase Part object.
Windows Controls / Xbase Parts
:addChild()
Defines an Xbase Part as a child.
:childFromName()
Returns an Xbase Part from the child list based on a numeric ID.
:childList()
Returns the child list of the Xbase Part.
:delChild()
Deletes an Xbase Part from the child list.
:setName()
Defines or retrieves a numeric ID associated with self.
:setOwner()
Sets or returns the owner of the Xbase Part.
:setParent()
Sets or returns the parent of the Xbase Part.
Examples
Create subclass of XbpPartHandler

// The example shows the class declaration 
// and methods in the life cycle of a class 
// inherited from XbpPartHandler. 

CLASS xyz FROM XbpPartHandler 
   EXPORTED: 
   METHOD init, create, configure, destroy 
   VAR    iVarA, iVarB 
ENDCLASS 

METHOD xyz:init( oParent, oOwner, varA, varB ) 
   ::XbpPartHandler:init( oParent, oOwner ) 
   ::iVarA := varA 
   ::iVarB := varB 
RETURN self 

METHOD xyz:create() 
   ::XbpPartHandler:create() 
RETURN self 

METHOD xyz:configure( oParent, oOwner, varA, varB ) 
   ::XbpPartHandler:configure( oParent, oOwner ) 
   ::iVarA := varA 
   ::iVarB := varB 
RETURN self 

METHOD xyz:destroy() 
   ::XbpPartHandler:destroy() 
   ::iVarA := NIL 
   ::iVarB := NIL 
RETURN self 
Feedback

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.