XClasses unitXGraphics unitXControl class (in XForms.pas unit)

    XControl class is declared in XForms.pas unit to be closer to XForm declaration and to have access to its private fields. XControl is a descender of XVisual class and it is intended to be base class for visual controls, placing on form. This is similar TControl in Delphi VCL, but 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!

XControl = class(XVisual );

XControl properties:

Properties, inherited from XVisual:

Properties inherited from XClass:

 


XControl methods:

Methods, inherited from XVisual:

 

Methods inherited from XClass:

 

Other methods of XVisuals.pas unit:


Tasks.

    Usually You have not to descend controls directly from XControl. To create new self-painted non-windowed control., use XCustomControl, and to create mfc-based windowed control, use XMfcControl as a base class. Controls in XCL are placed onto parent form at run time
    Any XVisual descender can have any XClass descendent as a child. But only descendents 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