Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Need your suggestion/opinion
Tue, Sep 29 2015 2:05 PMPermanent Link

Walter Matte

Tactical Business Corporation


On a TPagePanel currently when you changes the pages in code

Pagepanel1.ActivatePage := Page3;

Page3 shows but does not get focused.  So if you then close the form, and later show the form again, while you closed the form with Page3 showing - it will not show Page3 unless you had clicked somewhere on Page3 and thus set the focus there.

Question - do you think changing the PagePanel's Page in code should set focus automatically to that Page?

Pagepanel1.ActivatePage := Page3;


Also - if my ActivePage is Page1 and I show the Form - the Page1.OnShow event fires (even though there was no page changing) is this expected behaviour?

Walter
Wed, Sep 30 2015 4:06 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> Question - do you think changing the PagePanel's Page in code should
> set focus automatically to that Page?

Hmm, interesting one. I'd say it should not automatically change the
focus, or at least it should be optional. Imagine a page where you are
entering text, and some other display in a page is updating, and
changes to show you an emergency. You don't want the focus to be stolen
from you.

--

Matthew Jones
Wed, Sep 30 2015 6:02 AMPermanent Link

Walter Matte

Tactical Business Corporation


Thinking about this again.....  I changed the page in code, setting the activepage.  Whether it gets focus or not, why should the page change back to something else the user (or developer) never asked it to.

I set the activepage in code and close the form.  Show the form, and it is not on the page I set.

It the user had clicked the Tab before closing the form, then when you show the form again it is on that page.

Walter
Wed, Sep 30 2015 11:08 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Walter,

<< Thinking about this again.....  I changed the page in code, setting the activepage.  Whether it gets focus or not, why should the page change back to something else the user (or developer) never asked it to.

I set the activepage in code and close the form.  Show the form, and it is not on the page I set.

It the user had clicked the Tab before closing the form, then when you show the form again it is on that page. >>

Well, I looked at this again this morning with fresh eyes, and I figured out what the issue is.  The base TControl was setting the last active control for a container form for non-focusable controls (TPage), and that was the issue.  It's now fixed without requiring any special focus calls.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Sep 30 2015 11:44 AMPermanent Link

Walter Matte

Tactical Business Corporation

Thanks Tim - I really need to describe the scenario better.  My first attempt did not do anyone justice.

Walter
Thu, Oct 1 2015 8:15 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Walter,

<< Thanks Tim - I really need to describe the scenario better.  My first attempt did not do anyone justice. >>

Actually, your description/example project was fine.  I just came at the problem with an incorrect assumption: that the TPage control accepts focus, when it obviously doesn't because it's a container. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image