home *** CD-ROM | disk | FTP | other *** search
/ Freelog 11 / Freelog011.iso / BestOf / PhoenixMail / Source / comps / TreeViewEx.pas < prev    next >
Pascal/Delphi Source File  |  1999-01-06  |  2KB  |  78 lines

  1. {*****************************************************************************
  2.  *
  3.  *  TreeViewEx.pas - TTreeViewEx Component
  4.  *
  5.  *  Copyright (c) 1998-99 Michael Haller
  6.  *  
  7.  *  Idea taken from Toolbox.
  8.  *
  9.  *  Author:     Michael Haller
  10.  *  E-mail:     michael@discountdrive.com
  11.  *  Homepage:   http://www.discountdrive.com/sunrise/
  12.  *
  13.  *  This program is free software; you can redistribute it and/or
  14.  *  modify it under the terms of the GNU General Public License
  15.  *  as published by the Free Software Foundation;
  16.  *
  17.  *  This program is distributed in the hope that it will be useful,
  18.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  *  GNU General Public License for more details.
  21.  *
  22.  *  You should have received a copy of the GNU General Public License
  23.  *  along with this program; if not, write to the Free Software
  24.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  25.  *
  26.  *----------------------------------------------------------------------------
  27.  *
  28.  *  Revision history:
  29.  *
  30.  *     DATE     REV                 DESCRIPTION
  31.  *  ----------- --- ----------------------------------------------------------
  32.  *
  33.  *****************************************************************************}
  34.  
  35. unit TreeViewEx;
  36.  
  37. interface
  38.  
  39. uses
  40.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  41.   ComCtrls, ExtCtrls;
  42.  
  43. type
  44.   TTreeViewEx = class(TTreeView)
  45.   private
  46.     { Private declarations }
  47.     procedure WMNotify(var Message: TWMNotify); message WM_NOTIFY;
  48.   protected
  49.     { Protected declarations }
  50.   public
  51.     { Public declarations }
  52.   published
  53.     { Published declarations }
  54.   end;
  55.  
  56. procedure Register;
  57.  
  58. implementation
  59.  
  60. const
  61.   TTN_FIRST                = 0-520;
  62.   TTN_NEEDTEXTW            = TTN_FIRST - 10;
  63.  
  64. procedure TTreeViewEx.WMNotify(var Message: TWMNotify);
  65. begin
  66.   if Message.NMHdr^.Code = TTN_NEEDTEXTW then
  67.     Message.Result := 1
  68.   else
  69.     inherited;
  70. end;
  71.  
  72. procedure Register;
  73. begin
  74.   RegisterComponents('Michael Haller', [TTreeViewEx]);
  75. end;
  76.  
  77. end.
  78.