[Lazarus] Adding and hiding TPageControl tabs
stdreamer
stdreamer at freemail.gr
Sat Sep 28 01:37:03 CEST 2013
On 26/09/2013 6:19 μμ, Mark Morgan Lloyd wrote:
>>> I've got a TPageControl with a single design-time page, on which
>>> there's a Synedit which is used (a) as a splash when there's no other
>>> tabs and (b) as a template for design-time properties.
>>>
>>> I can add an extra tab and put a Synedit in it under program control,
>>> and load it with text. What I can't do is hide the original (index
>>> zero) tab: if I do, the Synedit vanishes:
> >> PageControl in 1.0 has many bugs.
> >>
> > Please try 1.0.13 not released, you can get from svn fixes branch
> > using svn.
> > Or 1.3 (also not released)
> > Or 1.1.99 from sourceforge
> >
> > 1.0.13 should be stable.
> >
> > The other 2 are work in progress
>
> Thanks, I'll investigate upgrades.
>
> > Also those fixes are Gtk2, Win and QT. No idea about the other
> > widgetsets.
> >
> > And:
> > I do not know if all widgetsets suppord displaying a page, when the
> > tab is hidden. (You can hide all tabs, via ShowTabs)
>
> I'm not trying to hide the tab but still see the page, I'm trying to
> hide the entire page+tab+content (index zero) and only leave the
> newly-created one (again, page+tab+content). But the last time I did any
> of this was around about the time that the old TNotebook etc. was
> deprecated, and I'm assuming that the rather convoluted sequence I was
> using in those days is no longer appropriate.
>
> > This may indeed hide the page :
> > fTntPageControl.Pages[0].TabVisible := false; // Trouble
>
> It hides everything at [0], but also hides the content of [1].
>
That's because you should not hide the tabsheet, just make the [1] the
active tabsheet (AKA the selected and visible one) and the user will not
be able to select the [0] that has the tab hidden until you show the
hidden tab.
More information about the Lazarus
mailing list