Sign in Join

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

Mailing lists / lazarus / 2015-01

PageControl tabs not showing

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Werner Pamler

The are two postings in the forum in which tabs of a pagecontrol do not show up if a TsSpreadsheetGrid or a TlzRichEdit are placed on the preceding tab at design-time:
- forum.lazarus.freepascal.org/index.php/topic,27088.msg167251.html (TsSpreadsheetGrid)
- forum.lazarus.freepascal.org/index.php/topic,26834.msg166016.html (TlzRichEdit)

I can confirm this issue on Laz trunk / fpc 2.6.4 on Win, the OP use Laz 1.2.6 on Win/Ubuntu: Create a new form with a pagecontrol containing three tabs. Add a TsWorksheetGrid (or TlzRichEdit) on the first tab. Run -> there is only the first tab with the component added. Save and reload the project. Now again, there is only 1 tab
the WorksheetGrid/RichEdit, save and reload --> the three tabs are back.

If these controls are added at runtime, everything is ok.

Since other controls work fine on a PageControl these two components seem to miss something which prevents the other tabs to show up. Any idea what could be wrong?

Reply by email

luiz americo pereira camara
to Werner Pamler

2015-01-18 18:07 GMT-03:00 Werner Pamler :

Show quoted text 7 lines
Since other controls work fine on a PageControl these two components seem to miss something which prevents the other tabs to show up. Any idea what could be wrong?

Yes. Those controls are forcing handle creation earlier, e.g., in Loaded.

I looked TsCustomWorksheetGrid. Try to move NewWorkbook from Loaded to InitializeWnd

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150119/324def7a/attachment.html>

Reply by email

Werner Pamler

Thanks Luiz. Unfortunately, after I removed "Loaded" and added a new method "InitializeWnd" containing the "NewWorksheet" call there is no improvement. Your answer, however, guided me to the "Setup" method in which the column and rows are prepared. At its beginning I added an "if csLoading in ComponentState then exit" - and now the issue is gone even with the old "Loaded" in place.

Reply by email

luiz americo pereira camara
to Werner Pamler

2015-01-19 14:21 GMT-03:00 Werner Pamler :

Show quoted text 8 lines
Thanks Luiz. Unfortunately, after I removed "Loaded" and added a new method "InitializeWnd" containing the "NewWorksheet" call there is no improvement. Your answer, however, guided me to the "Setup" method in which the column and rows are prepared. At its beginning I added an "if csLoading in ComponentState then exit" - and now the issue is gone even with the old "Loaded" in place.

Good you got the tip.

I hope the other control get fixed also.

A more precise way to know what is forcing the Handle creation is add an override of CreateHandle method and put a breakpoint there. Than follow the callstack.

Luiz

Show quoted text 6 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150119/bf9868a7/attachment.html>

Reply by email