stephen23 0 Newbie Poster

Please could some one help me i am trying to create a new component inherated from previous and I am totaly lost.

All objects opf the component will be on a panel. With a Label and two buttons. And a timer

The component is a Ticker tape were the user can input a message and have it scroll across the screen in the label. one button for left and another for back. Please could some one help me i have coded this so far but have a feeling that it is completly wrong and i dont know were to go from here. I have coded it in an aplication with the loops but have no idea how to do this,

unit Ticker;

interface

uses
  SysUtils, Classes, Controls, StdCtrls, Buttons, Forms, ExtCtrls;

type
  TTicker = class(TCustomPanel)
  private
    TLabelMessage1: TLabel;
    TTickerTimer1: TTimer;
    LeftBtn1: TButton;
    RightBtn2: TButton;
    TSpeed : integer;


    procedure TTicker1Timer(Sender:TObject);
    function GetCaption.: TCaption;

    { Private declarations }
  protected

  procedure SetLabelCaption (ALabelCaption : char);
  procedure
    { Protected declarations }
  public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;

    { Public declarations }
  published

  property LabelCaption : TLabelMessage1.Caption read LabelCaption
                                              write SetLabelCaption
                                              default 'Enter Message';

  property Enabled;
  property Font;
  property Color;
  property OnClick;

  property Speed : integer read TSpeed
                        write SetSpeed
                        default 200;

    { Published declarations }
  end;

procedure Register;

implementation


constructor TTicker.Create(AOwner: TComponent);

begin
  inherited Create(AOwner);
  Left := 48;
  Top := 104;
  Width := 241;
  Height := 169;
  TabOrder := 0;

  LeftBtn1 := TButton.Create(Self);
  with LeftBtn1 do begin
  Left := 24;
  Top := 136;
  Width := 75;
  Height := 25;
  Caption := 'Faster';
  TabOrder := 1;
  Onclick := Onclick;
  end;


  RightBtn2 := TButton.Create(Self);
  with RightBtn2 do begin
  Left := 136;
  Top := 136;
  Width := 75;
  Height := 25;
  Caption := 'Right';
  TabOrder := 2;
  Onclick := Onclick2;
  end;


    TTickerTimer1 := TTimer.Create(Self);
    TSpeed := 200;
    with TTimer do begin

    end;

     destructor TTicker.destroy;
 begin
  TLabelMessage1.free;
  inherited destroy;
 end;




end;


procedure Register;
begin
  RegisterComponents('Samples', [TTicker]);
end;

end.

Thanks Please help me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.