Código Fonte : MULTIHINT.PAS


unit MultiHint;

{**********************************************************************
- Componente MultiHint criado por Fúlvio C. Albuquerque, disponøvel
juntamente com uma matéria na Delphi@Brasil Magazine. Pode ser usado
livremente peço apenas que qualquer tenha referência ao meu nome ou da
revista.
- Caso deseja entrar em contacto, para acréscimos ao código, correções
etc... faça-o por meio de [email protected] ou (081)961-6981

                                             Fúlvio Caraciolo Albuquerque

**********************************************************************}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TMultiHint = class(TComponent)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
    Constructor Create(AOwner : TComponent); Override;
  published
    { Published declarations }
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('FCA', [TMultiHint]);
end;

Constructor TMultiHint.Create(AOwner : TComponent);
Var
   X : Integer;
   cStr : String;
begin
     Inherited;
     try
        For X := 0 to AOwner.ComponentCount - 1 do
            if AOwner.Components[X] IS TControl then
            begin
                 if Not (AOwner.Components[X] AS TControl).ShowHint then
                    Continue;
                     
                 cStr := TControl(AOwner.Components[X]).Hint;
                 if Pos('|',cStr) > 0 then
                 begin
                      cStr := Copy(cStr,1,Pos('|',cStr)-1) + #13 + Copy(cStr,Pos('|',cStr)+1,length(cStr));
                      TControl(AOwner.Components[X]).Hint := cStr;
                 end;
            end;
     except
           exit;
     end;
end;

end.

Parte integrante da edição de Maio-98 da Revista Delphi@Brasil Magazine

Hosted by www.Geocities.ws

1