                              ACL
                         (API Controls Library)
                   :  ,
                  , , 1998 - 1999 .
                           
                           

1.      (  ).

          (   
)    ( - ) .  -
       ++  Delphi  ,  
  -   EXE.  C++     ,
        DLL    .  ,
  -  Delphi,       VCL.
         API  ,      -
 -      ,     
   ""  , ,   Delphi  VCL.  
    TWinControl       
  Windows.   ,     Delphi  
,          
      (   
  ).     .     
       - .    
   .  ,        -
 ,   ( , ,   )  
( )       -
   .
        ,  . ,  Delphi 4  -
  "stdcall"   .  ,    
  Delphi    .    
   Delphi VCL,       .  
      ,    , 
       .  ,   -
       .

2.    TWinControl.

        VCL      
(TWinControl)   , ,    ,   
  .    .
       ,   Delphi, 

   function MyVirtualMethod(Param1,Param2,Param3 : integer): integer; virtual;

  ,   ,     ,  
  (..  1 ).     
       -   .  
            
  . ,     (..   -
 )      
    (    
   ,    ), ,   -
 ,  stdcall,       -
  . 
      ,     ,   

   function WindowProc(AMessage : TMessage;
                       WParam   : integer;
                       LParam   : integer): integer; virtual; stdcall;

        (  EIP)
,     Handle  .   ,
          -
.        .
            - "",  
,      .       
     .
      ,        
   ,     -
.    ,     , -
     ,     .  -
          , 
     GWL_USERDATA.     -
   ,      API 
GetProp()/SetProp().
              
  .   ,      -
 ,  @MyVirtualMethod,     
      . TObject.MethodAddress   
,     published - .    
 ,      :

   function TMyClass.GetVirtualMethodAddress : pointer; assembler;
   begin
     mov eax, [eax]              //  VMT
     mov eax, [eax+MethodOffset] //   
   end; 

     .  MethodOffset -
       .   -
,      ( "virtual",   
"override")         4.   
     .   ,   
   TObject.    ,    
       TObject.

3.  .

   TFont        -     Windows
   TFonts       -       Screen.Fonts  VCL
   TControl     -   .
   TWinControl  -    
   TStdControl  -     Windows
   TLabel       - 
   TEdit        -  
   TListBox     -  
   TButton      - 
   TCheckBox    - 
   TComboBox    -  
   TGroupBox    -  
   TProgressBar - -
   TKeyboard    -   

4.      TFont.

==   TFont ========================================================

   constructor Create;
      .

   destructor Destroy; override;
      .

==   TFont ======================================================

   property Handle: HFont read FHandle;
          Windows.

   property PixelsPerInch: Integer read FPixelsPerInch write SetPixelsPerInch;
       (/)

   property Charset: TFontCharset read GetCharset write SetCharset;
        ().

   property Color: TColor read FColor write SetColor;
      .

   property Height: Integer read GetHeight write SetHeight;
         .

   property Name: TFontName read GetName write SetName;
      () .

   property Pitch: TFontPitch read GetPitch write SetPitch;
       (/).

   property Size: Integer read GetSize write SetSize;
      () .

   property Style: TFontStyles read GetStyle write SetStyle;
      () .

5.      TFonts.

==   TFonts =======================================================

      constructor Create;
        .    initialization  Ctrls.pas.

      destructor Destroy; override;
        .    finalization  Ctrls.pas.

      function IndexOf(APitch : TFontPitch;
                 const AName  : string) : integer;
              /-
         .

      function IsDefaultPitch(const AFont : TLogFont) : boolean;
        ,      .

      function IsFixedPitch(const AFont : TLogFont) : boolean;
        ,     .

      function IsVariablePitch(const AFont : TLogFont) : boolean;
        ,     .

      function FindFont(AName : TFontName;
                        APitch : TFontPitch) : TLogFont;
          . 

      property Count : integer read FCount;
         ,   

      property Font[index : integer] : TLogFont read GetFont;
          .

6.      TControl.

==   TControl =====================================================

   constructor Create(AOwner : TWinControl);
      . AOwner -  .   ,  
         .

   procedure Paint(DC : HDC); virtual; abstract;
       . HDC -  .  -
     .    .

   destructor Destroy; override;
      .

==   TControl ===================================================

   property Left : integer read FLeft write FLeft;
          . 
          - .

   property Top : integer read FTop write FTop;
          . 
          - .
     
   property Width : integer read FWidth write FWidth;
      .

   property Height : integer read FHeight write FHeight;
      .

7.      TWinControl.

==   TWinControl ==================================================

   constructor Create(AParent : TWinControl); virtual;
      . AParent -  -    (   
     VCL "Owner",     VCL "Parent").
   
   destructor Destroy; override;
     .   DestroyWindow(),    
         .
   
   procedure CreateWnd; virtual;
      .        
     ,   ( )    
     OnCreate.
   
   procedure Close;
      ,    .

   procedure Show;
         ( ).    .

   procedure Hide;
      .
     
   function ShowModal : TModalResult;
       , ..      
        ModalResult (   VCL)    
     EndModal();
     
   procedure EndModal(Value : TModalResult);
         .

   procedure ProcessMessages;
        .

   procedure Invalidate;
       .

   procedure SetFocus;
       .

   procedure SelectPrev;
            

   procedure SelectNext;
            

   procedure SelectFirst;
            

   procedure SelectLast;
            

   function IsFirstSelected : boolean;
            .

   function IsLastSelected : boolean;
            .

   procedure InsertWinControl(AControl : TWinControl);
          - .

   procedure InsertControl(AControl : TControl);
        TControl   .

   procedure SetFont(const AFont : TLogFont);
       .

==   TWinControl ================================================

   property AutoStop : boolean read FAutoStop write FAutoStop;
      ,        (-
       PostQuitMessage(0);

   property Caption : shortstring read GetText write SetText;
      .

   property Color : TColor read FColor write SetColor;
       .

   property HelpContext : DWORD read FHelpContext write FHelpContext;
        .

   property HelpFile : shortstring read FHelpFile write FHelpFile;
        .

   property Style : longint read FStyle write FStyle;
       ( . Win32 API CreateWindow() ).

   property ExStyle : longint read FExStyle write FExStyle;
        ( . Win32 API CreateWindowEx() ).

   property Ctl3D : boolean read FCtl3D write FCtl3D;
       .

   property TextColor : TColor read FTextColor write SetTextColor;
        .

   property Enabled : boolean read FEnabled write SetEnabled;
       

   property Handle : HWnd read FHandle;
      .

   property Font : TFont read FFont;
       .

   property Left : integer read FLeft write SetLeft;
          .

   property Top : integer read FTop write SetTop;
          .

   property Width : integer read FWidth write SetWidth;
      .

   property Height : integer read FHeight write SetHeight;
      .

   property Parent : TWinControl read FParent;
      .

   property ClientWidth : integer read GetClientWidth;
        .

   property ClientHeight : integer read GetClientHeight;
        .

   property ClientRect : TRect read GetClientRect;
        ,  .

   property IsModal : boolean read FIsModal;
          .

==   TWinControl ================================================

   property OnCreate : TNotifyEvent read FOnCreate write FOnCreate;
      .

   property OnDestroy : TNotifyEvent read FOnDestroy write FOnDestroy;
      .

   property OnClose : TCloseEvent read FOnClose write FOnClose;
      .

   property OnClick : TNotifyEvent read FOnClick write FOnClick;
          .

   property OnErase : TEraseEvent read FOnErase write FOnErase;
           .

   property OnHitTest : THitTestEvent read FOnHitTest write FOnHitTest;
         .

   property OnMouseDown : TMouseEvent read FOnMouseDown write FOnMouseDown;
         .

   property OnKeyDown : TKeyEvent read FOnKeyDown write FOnKeyDown;
        .

   property OnKeyUp : TKeyEvent read FOnKeyUp write FOnKeyUp;
        .

   property OnKeyPress : TKeyPressEvent read FOnKeyPress write FOnKeyPress;
       .

   property OnNIMove : TNotifyEvent read FOnNIMove write FOnNIMove;
           " ".

   property OnNILDown : TNotifyEvent read FOnNILDown write FOnNILDown;
             " ".

   property OnNILUp : TNotifyEvent read FOnNILUp write FOnNILUp;
             " ".

   property OnEndSession : TCloseEvent read FOnEndSession write FOnEndSession;
       Windows. 

8.      TStdControl.

==   TStdControl ==================================================

   procedure CreateWnd; override;
      .        
     ,   ( )    
     OnCreate.

9.      TLabel.

==   TLabel =======================================================

   constructor Create(AParent : TWinControl); override;
     . AParent -  .

==   TLabel =====================================================

   property TextFormat : longint read FFormat write FFormat;
       .  .  API DrawTextEx().

10.      TEdit.

==   TEdit ========================================================

   constructor Create(AParent : TWinControl); override;

==   TEdit ======================================================

   property MaxLength : integer read GetMaxLength write SetMaxLength;
       .

   property MarginWidth : word read GetMargin write SetMargin;
          

   property Text : shortstring read GetText write SetText;
      .

11.      TListBox.

==   TListBox =====================================================

   constructor Create(AParent : TWinControl); override;
     .

   function Add(const S: shortstring): Integer;
        .

   procedure Insert(Index: Integer; const S: shortstring);
        .

   procedure Delete(Index: Integer);
        .

   procedure Clear;
      .

   procedure SelectItem(Value: integer);
      .

==   TListBox ===================================================

   property Count : integer read GetCount;
      .

   property Focused : integer read GetFocused write SetFocused;
      .

   property Items[Index: integer] : shortstring read Get write Put;
      .

   property Objects[Index: integer] : TObject read GetObject write PutObject;
        ( ).

   property Sorted : boolean read FSorted write SetSorted;
         .

12.      TButton.

==   TButton =======================================================

     constructor Create(AParent : TWinControl); override;
        .

==   TButton =====================================================

     property ModalResult : TModalResult read GetModalResult write SetModalResult;
         0,          
         ShowModal   ModalResult.

13.      TCheckBox.

==   TCheckBox =====================================================

     constructor Create(AParent : TWinControl); override;
        .

==   TCheckBox ===================================================

     property Checked : boolean read FChecked write SetChecked;
        ""  .

14.      TComboBox.

==   TComboBox =====================================================

     constructor Create(AParent : TWinControl); override;
        .

     function Add(const S: shortstring): Integer;
           .

     procedure Insert(Index: Integer; const S: shortstring);
            .

     procedure Delete(Index: Integer);
         .

     procedure Clear;
         .

==   TComboBox ===================================================

     property Count : integer read GetCount;
           .

     property Error : integer read FError;
        ,   CB_XXXX.

     property ItemIndex : integer read GetFocused write SetFocused;
           .

     property Items[Index: integer] : shortstring read Get write Put;
        .

     property Sorted : boolean read FSorted write SetSorted;
           .

     property Text : shortstring read GetText write SetText;
         .

15.      TGroupBox.

==   TGroupBox =====================================================

     constructor Create(AParent : TWinControl); override;
        .

16.      TProgressBar.

==   TProgressBar ==================================================

     constructor Create(AParent : TWinControl); override;
        .

==   TProgressBar ================================================

     property Range : word read GetRange write SetRange;
        -.

     property Position : word read GetPosition write SetPosition;
         -.

     property Step : word read GetStep write SetStep;
        -.

/////////////////////////////////////////////////////////////////////////////// 
