[DUG] TPageControl Interesting Observation D2007
Rohit Gupta
rohit at cfl.co.nz
Tue Aug 28 12:09:54 NZST 2007
Hi Steve,
I came across that earlier. There are many other stupidities in it. If
I had realised they were there, I would not have switched all my
notebooks from orpheus to tpagectrl.
The last frustrating one was if a tabsheet is visible and you set its
Visible property to true, the focus switches to it. We have a situation
where in insert mode certain tabs are made invisble. When the user
finishes, they are made visible again.. but the blasted focus changes.
A major failing is that it has no way of telling you which page it is
going to switch to in the Change event. I had to add another event in
that does support it.
There are more gotchas.... when you are making the tabs invisible.
Pages property has physical pages, the Tabs property has the visible
pages... Wait for it... Tabs [2] is not the same as Pages [2] if there
are some invisible pages. So if there are pages 1 2 and 3 and all are
visible then index 2 gets the middle page. If you now make the middle
page/tab invisible, index 2 fetches the last page. Great fun for coding
when I was writing the OnDrawTab.
Steve Peacocke wrote:
> Searching the newsgroups and web came up with a blank on this one so I
> thought I'd throw it to you people to see if any of you are having
> this problem as well.
>
> I have a TPageControl with 8 separate tabs. Three of those tabs are
> made invisible on startup, to be made visible on certain conditions.
>
> I have noted that if I compile the application with the main
> (starting) tab selected, then the tab will be blank - i.e. nothing
> will appear on the tab. It's like everything isset to invisible,
> except that items on that tab are never invisible. When I click on
> another tab and click back to the main tab, then everything appears as
> it should.
>
> However, when I compile the application with another tab selected,
> then on starting, I simply change to the main tab (in code, e.g. :
> pcCfg.ActivePage := tsMain), then all is displayed as it should.
>
> Puzzling. Is this a bug? can anyone else duplicate that?
>
> The interesting thing about it is that it ocurs in 2 of the
> applications that I look after, and it has only just started occuring
> recently (may be after update #2).
>
> Steve
>
>
--
*Rohit Gupta*
* B.E. Elec. M.E. Mem IEEE Associate IEE*
*Technical Manager*
*Computer Fanatics Limited*
**
*Tel* +64 9 4892280
*Fax* +64 9 4892290
*Email *rohit at cfl.co.nz <mailto:rohit at cfl.co.nz>**
*Web *www.cfl.co.nz <http://www.cfl.co.nz/>
------------------------------------------------------------------------
This email and any attachments contain information, which is
confidential and may be subject to legal privilege and copyright. If you
are not the intended recipient, you must not use, distribute or copy
this email or attachments. If you have received this in error, please
notify us immediately by return email and then delete this email and any
attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20070828/6d1e8a39/attachment.html
More information about the Delphi
mailing list