Dear guest !

Welcome to Team Developer Community Forum. A place created by the community, for the community !

This is a resource for Q & A and discussion about everything related to OpenText Gupta Team Developer, SqlBase, TD Mobile and Report Builder.
It is the alternative for the OpenText customer forums which can only be accessed with an active support contract.

Please register your account now. It will make you part of the active community.
Also, this guest message will not be displayed for registered users.

Having an account gives you the opportunity to ask questions and get help from others.
We hope this free gathering will help you and the community getting forward!

Best regards,
The forum site admins.

FYI: VisWinSetTabOrder

General discussion forum about all things Team Developer 5.x
Post Reply
Charlie
Canada
Posts: 23
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

FYI: VisWinSetTabOrder

Post by Charlie » 22 Mar 2017, 11:29

"The Problem"

I needed to take a field out of the keyboard-tabbing sequence (that field's value automagically defaulted to a value, and requiring a user to click on the field to change the value.)

Too easy, I said.

Then I spent the better part of an hour figuring out why VisWinSetTabOrder(hWndItem, hWndNULL) wasn't taking the field out of the tab order.

Duh. Timing...

During SAM_Create processing of the window and child objects and during SAM_CreateComplete processing of the window, keyboard-tabbing sequence hasn't been applied to the child objects yet. The application of the sequence numbers (or "tab order" positions set via the "Layout" menu) happens only after SAM_CreateComplete of the winow.

"The Solution"

So, I created a custom "PM_CreateComplete" message, and on SAM_Create of the field, I call SalPostMsg( hWndItem, PM_CreateComplete, 0, 0 ). and in the "On PM_CreateComplete" processing for the field, that's where I call VisWinSetTabOrder(hWndItem, hWndNULL).

I've been working with SQLWindows and Team Developer long enough that I should have thought of that tout-de-suite.

For newbies, it would be a good thing for the function's documentation to include this "wee by-the-way heads-up" on usage.
Last edited by Charlie on 27 Mar 2017, 10:36, edited 1 time in total.
A little trick to help direct folk from old Gupta forum to this one: Link to post

Jeff Luther
Site Admin
United States of America
Posts: 43
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California
Contact:

Re: FYI: VisWinSetTabOrder

Post by Jeff Luther » 22 Mar 2017, 15:31

Interesting to read that the SAM_CreateComplete msg. sent to the parent form wasn't late enough to (re)set tab order for the child control, Charlie. I always thought that the complete msg. was just that: Any create/init/setup for the form and children was in fact done.

So this didn't work?

Code: Select all

Form Window: ...
    On SAM_CreateComplete
        Call VisWinSetTabOrder(<field name/handle>, hWndNULL)
I have myself written and seen this coded in by others as well, often defined within a form's class for this msg:

Code: Select all

Form Window...
    On SAM_CreateComplete
        .... any other code
        ! this would be the last line in this create complete msg
        Call SalSendMsgToChildren( hWndForm, PM_CreateComplete, 0, 0 )
And then in any individual child control, trap PM_CreateComplete and do any last-minute/final processing on a per child control basis:

Code: Select all

Data Field:...
    PM_CreateComplete
        Call VisWinSetTabOrder( hWndItem, hWndNULL )
That's a good generic way to guarantee that the msg. is really sent last and late enough that any internal init. and setup of the form and its children is complete.

Thanks for the heads-up, and good to know about what you found out and for future reference.
Jeff Luther @ PC Design
Palm Springs, California
TD info. & samples: http://www.jeffluther.net/TD/

Charlie
Canada
Posts: 23
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: FYI: VisWinSetTabOrder

Post by Charlie » 22 Mar 2017, 19:00

That's right. Upon SAM_CreateComplete of the form window, a call to VisWinSetTabOrder had no effect.

Maybe something fixed beyond TD5.2SP3, or something that just exists with TD5.2SP3, or I'm possibly delusional (it might not be a bad idea for somebody else to do a little sanity check. Insanity check ???)
A little trick to help direct folk from old Gupta forum to this one: Link to post

Jeff Luther
Site Admin
United States of America
Posts: 43
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California
Contact:

Re: FYI: VisWinSetTabOrder

Post by Jeff Luther » 26 Mar 2017, 20:39

Maybe something fixed beyond TD5.2SP3, or something that just exists with TD5.2SP3
I can't say, not without a test case, Charlie. I have 5.2 SP5 installed and could try that there. In any event, if it's a bug with SP3 other or otherwise, the workaround would seem to be 1 of the options I suggested. Did you code any of those and try it?
Jeff Luther @ PC Design
Palm Springs, California
TD info. & samples: http://www.jeffluther.net/TD/

Charlie
Canada
Posts: 23
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: FYI: VisWinSetTabOrder

Post by Charlie » 27 Mar 2017, 10:35

Jeff Luther wrote:
26 Mar 2017, 20:39
Maybe something fixed beyond TD5.2SP3, or something that just exists with TD5.2SP3
... Did you code any of those and try it?
I already had my "PM_CreateComplete" solution in my first post. That resolves the "timing issue" A-1.

I'm adding "Solution" in my first post to better highlight it.
A little trick to help direct folk from old Gupta forum to this one: Link to post

Charlie
Canada
Posts: 23
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: FYI: VisWinSetTabOrder

Post by Charlie » 27 Mar 2017, 10:44

Jeff Luther wrote:
26 Mar 2017, 20:39
Maybe something fixed beyond TD5.2SP3, or something that just exists with TD5.2SP3
... if it's a bug with SP3 other or otherwise ...
I don't know if I would necessarily call it a bug with Team Developer. I'd call it a bug with the documentation.

Maybe tab order assignment should be done before SAM_CreateComplete, but then again: maybe it shouldn't (who knows what kind of problems a "fix" would create ?

Reminds me of a great story:

There is a Taoist story of an old farmer who had worked his crops for many years.
One day his horse ran away.
Upon hearing the news, his neighbors came to visit.
"Such bad luck," they said sympathetically.
Maybe," the farmer replied.
The next morning the horse returned, bringing with it three other wild horses.
"How wonderful," the neighbors exclaimed.
"Maybe," replied the old man.
The following day, his son tried to ride one of the untamed horses, was thrown, and broke his leg.
The neighbors again came to offer their sympathy on his misfortune.
"Maybe," answered the farmer.
The day after, military officials came to the village to draft young men into the army.
Seeing that the son's leg was broken, they passed him by.
The neighbors congratulated the farmer on how well things had turned out.
"Maybe," said the farmer.
A little trick to help direct folk from old Gupta forum to this one: Link to post

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest