Sign in Join

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

Mailing lists / lazarus / 2002-12

Notebook pages LM_SETITEMINDEX

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Vincent Snijders

Hi all,

I am working on the notebook pages in win32 and I have a question.

In line 662 of CustomNotebook.inc (part of TCustomNotebook.SetPageIndex) FPageIndex is set to 0 if it is smaller than zero, just before sending the LM_SETITEMINDEX message to the interface.

The problem is that this message is also send on destroying pages and now it is difficult to see, if the interface needs to show the a tabpage. Why isn't -1 not a valid value for a PageIndex? Why can't -1 be sent as a page index? I seem to have no way of detecting an empty notebook, because Pages.Count is still 1.

Regards,
Vincent Snijders.

Reply by email

Mattias Gaertner
to Vincent Snijders
Show quoted text 9 lines
Hi all, I am working on the notebook pages in win32 and I have a question. In line 662 of CustomNotebook.inc (part of TCustomNotebook.SetPageIndex) FPageIndex is set to 0 if it is smaller than zero, just before sending the LM_SETITEMINDEX message to the interface. The problem is that this message is also send on destroying pages

I changed that.

and now it is difficult to see, if the interface needs to show the a tabpage. Why isn't -1 not a valid value for a PageIndex?

IMO, if a notebook has pages, then there is also a top page. Gtk thinks the same (it will select the last as default). I didn't know, that Delphi and win32 supports no active page. For compatibility I removed the auto selection.

Why can't -1 be sent as a page index? I seem to have no way of detecting an empty notebook, because Pages.Count is still 1.

Mattias

Reply by email

Vincent Snijders

Thanks, Mattias.

At least now I don't have to worry about getting a message to select a page which is about to be deleted, that was the main reason for the question.

I do think it is good that there is always a selected page, except when there are no pages, then pageindex has to get another value (i.e. -1).

Attached is another patch. Lazarus is still crashing, but both notebook examples work now, except for redrawing a page after a page is deleted. I leave this for now.

Next I am going to look at menus, because LCL doesn't seem to get any click events for them. Unless somebody else has claimed them.

At the moment Martin Smat is looking into the toolbar buttons. If somebody else is working on the win32 interface, please let us know, so that double work is avoided.

Regards,
Vincent Snijders.

Show quoted text 46 lines
-----Oorspronkelijk bericht----- Van: Mattias Gaertner Verzonden: maandag 16 december 2002 10:26 Aan: Onderwerp: Re: [lazarus] Notebook pages LM_SETITEMINDEX On Sun, 15 Dec 2002 23:45:25 +0100 "Vincent Snijders" wrote: > Hi all, > > I am working on the notebook pages in win32 and I have a question. > > In line 662 of CustomNotebook.inc (part of TCustomNotebook.SetPageIndex) > FPageIndex is set to 0 if it is smaller than zero, just before sending the > LM_SETITEMINDEX message to the interface. > > The problem is that this message is also send on destroying pages I changed that. > and now it > is difficult to see, if the interface needs to show the a tabpage. Why > isn't -1 not a valid value for a PageIndex? IMO, if a notebook has pages, then there is also a top page. Gtk thinks the same (it will select the last as default). I didn't know, that Delphi and win32 supports no active page. For compatibility I removed the auto selection. > Why can't -1 be sent as a page > index? I seem to have no way of detecting an empty notebook, because > Pages.Count is still 1. Mattias _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00006.zip
Type: application/octet-stream
Size: 1074 bytes
Desc: "diff.page.zip"
Url : http://localhost/pipermail/lazarus/attachments/20021216/126d0e5d/zip00006.obj

Reply by email

Karl Brandt
to Vincent Snijders
Vincent Snijders wrote 20 lines
Thanks, Mattias. At least now I don't have to worry about getting a message to select a page which is about to be deleted, that was the main reason for the question. I do think it is good that there is always a selected page, except when there are no pages, then pageindex has to get another value (i.e. -1). Attached is another patch. Lazarus is still crashing, but both notebook examples work now, except for redrawing a page after a page is deleted. I leave this for now. Next I am going to look at menus, because LCL doesn't seem to get any click events for them. Unless somebody else has claimed them. At the moment Martin Smat is looking into the toolbar buttons. If somebody else is working on the win32 interface, please let us know, so that double work is avoided.

I'll try to terminate TListBox and TComboBox,
after i'll take a look in TFont

Karl Brandt

Reply by email