On Wed, 11 Mar 2009 11:30:52 +0100 Roland Turcan <k...@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. Have you tried to register the class TNoBackPage earlier, for example in a Register procedure? Mattias _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus