Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab stops on a page frame

Status
Not open for further replies.

sdocker

IS-IT--Management
Aug 12, 2010
218
GB
Is there a way to have the tab stops wrap around the page on a page frame without out stopping on the PageFrame tab.
If I set the PageFrame.TabStop to .F., it doesn't go back to the first tab stop.
The TAB key moves it forward and CTRL-TAB moves it backwards.

Thanks,
Sam
 
Are you sure you are talking about pages in a pageframe? As far as I know, the Page object doesn't have a Tabstop property, and you don't normally use the Tab key to move from page to page. The PageFrame object has a TabStop property, but that doesn't control the tabbing within the pageframe, but rather between the pageframe itself and the other controls.

And I've never heard of CTRL+B being used to tab between pages.

If I've misunderstood the question, my apologies.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
My apologies. I should have written it more clearly.

Is there a way to have it cycle through the controls? I'm talking about TABBING through the controls on a page of the PageFrame and when it gets past the last control, start again at the first one.

Sam

 
OK, so I think I get what you are saying now, Sam.

The problem is that, when you are tabbing through the controls within a page of the pageframe, when you tab away from the last control, focus moves to the next control outside the pageframe. You want the focus go to the first control on the same page. Have I understood that correctly?

If so, this is of course the expected behaviour. There is no single property or setting that would prevent it. The only solution that comes to mind is to disable tabbing to every control on the form except those on the current page. And the easiest way to do that would be to set the Tabstop property to .F. for every control on the form that has that property, and then to set it to .T. just for the controls on the current pageframe.

So, in the page's Activate, you could do something like this:
[tt]
THISFORM.SetAll("TabStop", .F.)
THIS.SetAll("TabStop", .T.)[/tt]

Then, in the page's Deactivate, set all the tab stops to .T.

That would achieve what you want. When you hit Tab on the last control, focus will go to the first control on the page (and hitting Shift+Tab moves focus in the opposite direction). But it's a rather crude approach because it doesn't take account of any controls that were previously set to non-tabbable. But at least it will give you something to work on.

Personally, I would not want to do this, because it establishes a behaviour which is different from what the user is expecting. But I suppose you have a good reason for wanting to do it.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

Your suggestion not to do it is very sensible. It's simply not worth the trouble.

Thank you.
 
As Mike said if you have a reason for it, you have a reason for it. A click on any control outside of the pageframe causes page deactivate, so there you could add back tabstop to .T. for all outside controls.
If users (or you) want to stick inside the pageframe, the need to get out there should be acceptable. It's just logic you cant stay on a page and move out at the same time, so the rarely necessary action can be made more complicated. ESC would be an idea for that. Within drawing software it's not unusual to have esc as end key of a current tool like drawing a path or polygon, which are tools in a mode you are stuck do repeated steps until going back to point one or ESC. So that wouldn't be too unusual. At least it would make sense, but we don't know the reasoning for your wish about this tab behaviour. I could imagine a multi page form automatically stepping forward a page one you hit a confirm button on pageX, but keeping you in the loop of specifically just the page controls.

The only thing that speaks against ESC is it is the standard key for a button with button.Cancel=.T. just like ENTER is for a button with button.Default = .T., but you might make use of that, if the cancel button is outside the pageframe, for example in a footer area of the form underneath the pageframe, you a) automatically set focus outside of the pageframe and b) can detect in the cancel buttons when event, that it gets triggered for pageframe cancelling and not form cancelling, as it's tabstop is still .F. in that moment.

Bye, Olaf.

Olaf Doschke Software Engineering
 
And also keep in mind that, just because a control outside the pageframe has its Tabstop set to .F., that doesn't mean it can't receive focus. It just means that you can't use Tab (or Shift+Tab) to move focus to it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top