[Lazarus] Unable to find the unit if the component class "TNoBackPage"

Roland Turcan konf at rotursoft.sk
Wed Mar 11 14:09:23 CET 2009


Hello Mattias,

MG> Have you tried to register the class TNoBackPage earlier, for example
MG> in a Register procedure?

I have ported this code from Delphi 7, where the register procedure
contains:

PROCEDURE Register;
BEGIN
  RegisterComponents ('rotursoft', [TNoBackNotebook]);
END;

Shall I add registration of TNoBackPage too?

Thanks.

TRoland;

<<< 11.3.2009 12:27 - Mattias Gaertner "nc-gaertnma at netcologne.de" >>>
MG> On Wed, 11 Mar 2009 11:30:52 +0100
MG> Roland Turcan <konf at rotursoft.sk> wrote:

>> Hello lazarus project!
>> 
>> I have my own component, which successfully installed into Lazarus.
>> When I use this component on any form after reopening/reloading form
>> it reports an error. That is a simple notebook implementation with no
>> background to get pages transparent.
>> 
>> That component's unit contains:
>> 
>> unit NoBackNotebook;
>> 
>> INTERFACE
>> 
>> USES  LMessages, SysUtils, Classes, Graphics, Controls, Forms,
>> Dialogs, ExtCtrls, LCLType;
>> 
>> TYPE
>>   TNoBackPage = class(TCustomControl)
>>   private
>>   ...
>> 
>>   TNoBackNotebook = class(TCustomControl)
>>   private
>>     FPageList: TList;
>>     FAccess: TStrings;
>>     FPageIndex: Integer;
>>   ...
>> 
>> IMPLEMENTATION
>> 
>> type
>>   TNoBackPageAccess = class(TStrings)
>>   private
>>     PageList: TList;
>>     Notebook: TNoBackNotebook;
>> 
>> constructor TNoBackNotebook.Create(AOwner: TComponent);
>> const SDefault = 'Default';
>> begin
>>   inherited Create(AOwner);
>>   Width := 150;
>>   Height := 150;
>>   FPageList := TList.Create;
>>   FAccess := TNoBackPageAccess.Create(FPageList, Self);
>>   FPageIndex := -1;
>>   FAccess.Add(SDefault);
>>   PageIndex := 0;
>>   Exclude(FComponentStyle, csInheritable);
>>   if not Registered then
>>   begin
>>     Classes.RegisterClasses([TNoBackPage]);
>>     Registered := True;
>>   end;
>> end;
>> 
>> --------------------------
>> 
>> LFM file contains of form contains:
>> 
>> ...
>>   object NoBackNotebook1: TNoBackNotebook
>>     Left = 184
>>     Height = 150
>>     Top = 104
>>     Width = 150
>>     TabOrder = 1
>>     object TNoBackPage
>>       Left = 0
>>       Top = 0
>>       Caption = 'Default'
>>     end
>>   end
>> ...
>> 
>> ---------------------------
>> 
>> When Lazarus starts this is reported:
>> 
>> TMainIDE.ParseCmdLineOptions:
>>   PrimaryConfigPath="/Users/test/.lazarus"
>>   SecondaryConfigPath="/etc/lazarus"
>> NOTE: help options config file not found - using defaults
>> TMainIDE.DoLoadLFM
>> A /usr/local/share/lazarus/rotursoft/tests/components/unit1.pas
>> IsPartOfProject=True QuickCheckLFMBuffer
>> LFMBuffer=/usr/local/share/lazarus/rotursoft/tests/components/unit1.lfm
>> FindMissingClass :TNoBackPage IsInherited=False TMainIDE.DoLoadLFM
>> loading nested class TNoBackPage needed
>> by /usr/local/share/lazarus/rotursoft/tests/components/unit1.pas
>> TMainIDE.DoLoadComponentDependencyHidden /usr/local/share/lazarus/rotursoft/tests/components/unit1.pas
>> AComponentClassName=TNoBackPage AComponentClass=nil
>> TCarbonBitBtn.SetFocus Error: SetKeyboardFocus  failed with result
>> -30585 TCarbonBit
>> 
>> 
>> -------
>> 
>> The fact is, that this component was working in October 2008 when I
>> used my project, but latest build I am using not.
>> 
>> Thanks for all ideas what I can change.

MG> Have you tried to register the class TNoBackPage earlier, for example
MG> in a Register procedure?

MG> Mattias

MG> _______________________________________________
MG> Lazarus mailing list
MG> Lazarus at lazarus.freepascal.org
MG> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus




-- 
Best regards, TRoland
http://www.rotursoft.sk
http://exekutor.rotursoft.sk




More information about the Lazarus mailing list