Hi
I've just created a simple extension to TMemo, to provide a GETNextLine
(to hide the numeric indicies) as a demo of the OO way of doing things.
It's trivial, compiles OK, installs OK, shows up the COMPONENT/Configure
Palette list, in the COMPONENT/INSTALL Packages it shows up as a
component in the package - BUT NOT IN THE PALETTE !!! That' not quite
true - it has appeared and then vanished again :-( 

Everything is exactly as it should be, but the installed component
doesn't show up on the SAMPLES palette. It's doing everything except
being visible so I can't drag'n'drop it.

Any thoughts as to why? I get the horrible feeling it's something silly
- Code is appended below.  I'm using Delphi 7 Enterprise.

Thanks 
Giovanni
========================================================================
 Giovanni Moretti  |  Institute of Information Sciences and Technology
 Senior Lecturer   |  Massey University, Palmerston North, New Zealand
 Computer Science  |  Ph 64-6-3505799x2474 == Fax 64-6-3502259 == ZL2BOI

------------------------------------------------------------------------
 http://www-ist.massey.ac.nz/moretti      mailto:[EMAIL PROTECTED]


unit QMyMemo;  // Extend TMemo to add a Line Iterator by
[EMAIL PROTECTED]

INTERFACE

uses SysUtils, Classes, QControls, QStdCtrls;

type
  TMyMemo = class(TMemo)
  private
    NextLine : integer;                 // The line cursor that will be
returned
  public
    procedure StartScan;                  // Reset Iteration Cursor
    function  AnyMoreLines : boolean;     // Will GetNextLine succeed?
    function  GetNextLine  : string;      // There are more lines, get
next one
  end;

procedure Register;

IMPLEMENTATION

procedure TMyMemo.StartScan;             // Reset Iteration Cursor
begin
  nextLine:= 0;
end;

function TMyMemo.AnyMoreLines : Boolean; // Will GetNextLine succeed?
begin
  result:= (NextLine < Lines.Count);
end;

function TMyMemo.GetNextLine : string;   // There are more lines, get
next one
var line: string;
begin
  line:= lines[nextLine];
  inc(nextline);
  result:= line;
end;

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

end.

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to