XEdits unitcontrols of XControls unitXMfcControl class (in XMfcControls.pas unit)

    XMfcControl class is derived from XControl and is intended to be a base class for all windowed MFC-based controls, which use standard Windows Microsoft Foundation Classes. Such controls are similar to TWinControl descendents in VCL and need in window handle, but need not XCanvas unit, because its are painting and controlling itself using ready Windows controls.So, code of applet, which contains only such controls, can be smaller, then in case of using so called self-painting controls. And creating of new Mfc-based control is the easiest task, then creating of self-painting ones.
    Therefore, self-painted controls have some additional features. First, its are created by us and not by Windows creators. So, we can make its more clever, using more advanced algorithms to perform some works (e.g., handling of huge data arrays). Or, we can perform painting without flickering, using rotated text (MFC-based controls can not draw rotated text correctly), custom backgrounds and so on.
    It is also possible to combine self-painted and mfc-based controls together on one form (but this will increase applet size).

    Here class XMfcControl is presented only. Other controls are located in the next topic to simplify reading.

XMfcControl = class(XControl);

XMfcControl properties:

Properties, inherited from XControl:

Properties, inherited from XVisual:

Properties inherited from XClass:

 


XMfcControl methods:

Methods, inherited from XControl:

Methods, inherited from XVisual:

 

Methods inherited from XClass:


Event of XCustomControl:


Tasks.

    Use XMfcControl to create MFC-based controls. Look at other its descendents (e.g., XWLabel) to understand how to do this.
    Creating of MFC-based controls is more easier task then it is for self-painting controls. When You create new type of MFC-based control deriving it directly from XMfcControl, override its method CreateParams to subclass window procedure with name of standard control ('STATIC', 'BUTTON', etc.). Also provide properties and methods, corresponding to given control, and implement it (usually by sending certain windows messages to control window).
    I think, that creating of MFC-based controls is even more easy task, because You always can peep at Delphi VCL controls, which are indeed MFC-based. Yes! And these are not too big itself. The only Delphi love to TPersistent makes its so fat.
    So don't hesitate! Get your high professional experience and join. You will be a winner any case...


goto XCL page

goto home page