XClasses unitXWindows unitXVisuals.pas unit

    This unit contains definition of the base class for all XCL controls and windows - XVisual. It is a descender of XClass and adds to it a set of properties and methods peculiar to windows-similar visual elements (forms and controls) such as position, size, visibility, enabling, painting and so on.
    Yes, certainly it would be possible to create a single root class, uniting ability to have parent-childs relations and window-similar visibility in one, but I found that ability to have childs and become a parent is important itself. And this allow to improve any poor pascal object just by changing its ancestor from TObject to XClass and to obtain as a result object that is destroying automatically when its parent is destroying. This last ability is similar to TComponent autodestroying capability.
    Be remember, that in contrast to VCL, where base class for all objects is TPersistent, XCL objects do not provide capability of reading its original state from form definition. This allow not to link stream support modules, input/output routines needed to read data from executable and recognize it and do not create form definition blocks in executable. As a result, application made with XCL (called as APPLETS) to leave its size dramatically small.
    Disadvantages of this are evident: inconvenience for programmers because it is necessary now to place controls on forms only at run time. Programming in XCL, at design time developer can now work only with pascal code. No ObjectInspector, no double click on event to create event handler, no components palette and so on. But all this is generously repaid by extremely small size of end applet, and You do not ever need to distribute bpl- or dpl-files to do it!

XVisual = class( XClass );

XVisual properties:

Properties inherited from XClass:

XVisual methods:

 

Methods inherited from XClass:

 

Other methods of XVisuals.pas unit:


Tasks.

    Usually You have not to descend objects directly from XVisual. To create new control, use XControl (or XCustomControl, or XWinControl) as a base. And to create new type of form use XForm as an ancestor. Types XVisual and XClass are taking place at the root of XCL hierarchy and You only know its properties and methods which are inheriting of its descenders.
    Any XVisual descender can have any XClass descender as a child. But only descenders of XVisual are taking in consideration when childs are enumerated (e.g. to find control at the given position or to decide which object have to respond for mouse events and so on). But those childs which are not XVisual-based but are XClass-based, therefore are deleted automatically when its parent is destroying. This is similar to relationship between TForm and TComponent in Delphi VCL (excluding that XClass objects can not be visual at design time).


goto XCL page

goto home page