[DUG] TPageControl Interesting Observation D2007
Stephen Barker
Steve at webdata.co.nz
Tue Aug 28 14:24:43 NZST 2007
Hi,
While we're on the subject - I've just had a request to allow the user to
modify the tab positions on a pagecontrol at runtime.
Any easy way to do this or would I need to search for a replacement
component?
Project is d5 but soon to be d2007.
thanks,
Steve
_____
From: Rohit Gupta [mailto:rohit at cfl.co.nz]
Sent: Tuesday, 28 August 2007 12:10 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] TPageControl Interesting Observation D2007
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 <mailto:rohit at cfl.co.nz> rohit at cfl.co.nz
Web <http://www.cfl.co.nz/> 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.
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.9/975 - Release Date: 26/08/2007
9:34 p.m.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20070828/a746325b/attachment.html
More information about the Delphi
mailing list