Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-11

Fix for bug in TTabcontrol/TPageControl/TNotebook

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

The TNBPages(TStrings) class does not implement the GetObect and PutObject calls of TStrings correctly.

That is, If I do a
  MyNoteBook.Pages.AddObject('SomeString',SomeObject);

the SomeObject is simply lost. (logical, PutObject is not implemented) Instead, the MyNoteBook.Pages.Objects returns a reference to the TCustomPage used by the notebook. This is of course horribly wrong :(

It's easy enough to fix this by correctly implementing TNBPages.PutObject and fixing TNBPages.GetObject. I can do this, but before I do this, I would like to know if there is LCL code that relies on the fact that Pages.Objects return references to the actual TCustomPage instances ?

Michael.

Reply by email

Vincent Snijders
to Michael Van Canneyt

2008/11/4 Michael Van Canneyt :

Show quoted text 17 lines
Hi, The TNBPages(TStrings) class does not implement the GetObect and PutObject calls of TStrings correctly. That is, If I do a MyNoteBook.Pages.AddObject('SomeString',SomeObject); the SomeObject is simply lost. (logical, PutObject is not implemented) Instead, the MyNoteBook.Pages.Objects returns a reference to the TCustomPage used by the notebook. This is of course horribly wrong :( It's easy enough to fix this by correctly implementing TNBPages.PutObject and fixing TNBPages.GetObject. I can do this, but before I do this, I would like to know if there is LCL code that relies on the fact that Pages.Objects return references to the actual TCustomPage instances ?

I don't know. A quick scan indicates that this is not the case.

Vincent

Reply by email

Michael Van Canneyt
to Vincent Snijders
Vincent Snijders wrote 20 lines
2008/11/4 Michael Van Canneyt : > > Hi, > > The TNBPages(TStrings) class does not implement the GetObect and PutObject > calls of TStrings correctly. > > That is, If I do a > MyNoteBook.Pages.AddObject('SomeString',SomeObject); > > the SomeObject is simply lost. (logical, PutObject is not implemented) > Instead, the MyNoteBook.Pages.Objects returns a reference to the > TCustomPage used by the notebook. This is of course horribly wrong :( > > It's easy enough to fix this by correctly implementing TNBPages.PutObject > and fixing TNBPages.GetObject. I can do this, but before I do this, I would > like to know if there is LCL code that relies on the fact that > Pages.Objects return references to the actual TCustomPage instances ? I don't know. A quick scan indicates that this is not the case.

So I can go ahead and fix the actual bug ?

Michael.

Reply by email

Vincent Snijders
to Michael Van Canneyt

2008/11/5 Michael Van Canneyt :

Show quoted text 27 lines
On Wed, 5 Nov 2008, Vincent Snijders wrote: > 2008/11/4 Michael Van Canneyt : > > > > Hi, > > > > The TNBPages(TStrings) class does not implement the GetObect and PutObject > > calls of TStrings correctly. > > > > That is, If I do a > > MyNoteBook.Pages.AddObject('SomeString',SomeObject); > > > > the SomeObject is simply lost. (logical, PutObject is not implemented) > > Instead, the MyNoteBook.Pages.Objects returns a reference to the > > TCustomPage used by the notebook. This is of course horribly wrong :( > > > > It's easy enough to fix this by correctly implementing TNBPages.PutObject > > and fixing TNBPages.GetObject. I can do this, but before I do this, I would > > like to know if there is LCL code that relies on the fact that > > Pages.Objects return references to the actual TCustomPage instances ? > > I don't know. A quick scan indicates that this is not the case. So I can go ahead and fix the actual bug ?

Yes, and if it breaks something, we can try to fix that.

Vincent

Reply by email