home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / ctrlkit.zip / LBOXCHK.INT < prev    next >
Text File  |  1995-09-16  |  3KB  |  99 lines

  1. unit LBoxChk;
  2.  
  3. interface
  4.  
  5. uses
  6.   Classes, Controls, Forms, Menus, StdCtrls, WinTypes,
  7.   WinProcs, Messages, Graphics;
  8.  
  9. const
  10.   IDX_UNCHECKED  = 0;
  11.   IDX_CHECKED    = 1;
  12.   IDX_MLEFT      = 0;
  13.   IDX_MTOP       = 1;
  14.   IDX_MTEXTLEFT  = 2;
  15.   DEFAULT_HEIGHT = 17;
  16.  
  17. type
  18.   TCheckRange     = IDX_UNCHECKED..IDX_CHECKED;
  19.   TCheckBmpArray  = Array[TCheckRange] of TBitMap;
  20.  
  21.   TMarginRange    = IDX_MLEFT..IDX_MTEXTLEFT;
  22.   TMarginArray    = Array[TMarginRange] of Integer;
  23.  
  24.   TCheckListBox = class(TCustomListBox)
  25.   private
  26.     FOffsets    : TMarginArray;
  27.     FPictures   : TCheckBmpArray;
  28.     FUseFocus   : Boolean;
  29.  
  30.     procedure CMFontChanged(var Msg: TMessage); message CM_FONTCHANGED;
  31.     procedure ClearBitmap(Bitmap: TBitmap);
  32.     procedure SetGlyph(Index: Integer; Value: TBitmap);
  33.     function  GetGlyph(Index: Integer): TBitmap;
  34.     procedure SetOffset(Index: Integer; Value: Integer);
  35.     function  GetOffset(Index: Integer): Integer;
  36.     procedure SetItemHeight;
  37.  
  38.   protected
  39.     procedure DrawItem(Index: Integer;
  40.                        Rect: TRect;
  41.                        State: TOwnerDrawState); override;
  42.  
  43.   public
  44.     constructor Create(AOwner: TComponent); override;
  45.     destructor  Destroy; override;
  46.  
  47.   published
  48.     property Align;
  49.     property BorderStyle;
  50.     property Color;
  51.     property Columns;
  52.     property Ctl3D;
  53.     property DragCursor;
  54.     property DragMode;
  55.     property Enabled;
  56.     {property ExtendedSelect;}
  57.     property Font;
  58.     property IntegralHeight;
  59.     property ItemHeight;
  60.     property Items;
  61.     property MultiSelect;
  62.     property ParentColor;
  63.     property ParentCtl3D;
  64.     property ParentFont;
  65.     property ParentShowHint;
  66.     property PopupMenu;
  67.     property ShowHint;
  68.     property Sorted;
  69.     {property Style;}
  70.     property TabOrder;
  71.     property TabStop;
  72.     property Visible;
  73.     property OnClick;
  74.     property OnDblClick;
  75.     property OnDragDrop;
  76.     property OnDragOver;
  77.     {property OnDrawItem;}
  78.     property OnEndDrag;
  79.     property OnEnter;
  80.     property OnExit;
  81.     property OnKeyDown;
  82.     property OnKeyPress;
  83.     property OnKeyUp;
  84.     {property OnMeasureItem;}
  85.     property OnMouseDown;
  86.     property OnMouseMove;
  87.     property OnMouseUp;
  88.  
  89.     property GlyphChecked   : TBitmap index IDX_CHECKED read GetGlyph write SetGlyph;
  90.     property GlyphUnchecked : TBitmap index IDX_UNCHECKED read GetGlyph write SetGlyph;
  91.     property GlyphLeftMargin: Integer index IDX_MLEFT read GetOffset write SetOffset default 1;
  92.     property GlyphTopMargin : Integer index IDX_MTOP  read GetOffset write SetOffset default 1;
  93.     property TextLeftMargin : Integer index IDX_MTEXTLEFT read GetOffset write SetOffset default 8;
  94.     property ShowFocusColor : Boolean read FUseFocus write FUseFocus default False;
  95.   end;
  96.  
  97.  
  98. implementation
  99. end.