PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Keeping TAB sequence on one CHILD form  (Read 1878 times)

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Keeping TAB sequence on one CHILD form
« on: June 24, 2018, 05:50:52 AM »

HI all

I am fiddling with an old program which uses Child Forms and Tab Control on some of those Child forms.
I want the user to TAB between the different controls on the current form, but the tab "leaves" the form and tabs right through all the other forms before it comes back to the first control on the form.
[On TAB Pages & Child forms, the TAB sequence follows the normal TAB process, but then it moves to the other child forms and follow the TAB sequence on them first, and then return to your first Tab item on your current form]
Can one bind the tab sequence to s specific number of controls on a form? E.g. the Text boxes and the buttons only?
With Child forms this messes around very much.

Thanks - Peter

« Last Edit: June 24, 2018, 07:43:05 AM by Petrus Vorster »
Logged

Eddy Van Esch

  • Senior Member
  • ***
  • Posts: 246
  • FF3 User
    • DevOTechS
Re: Keeping TAB sequence on one form
« Reply #1 on: June 24, 2018, 05:56:57 AM »

Have you tried playing with "Tab Order"?
Right-click on a form --> Form Properties --> Tab Order

Enable / disable tab on controls and change the tab order of the controls ...

Logged
Eddy

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Re: Keeping TAB sequence on one form
« Reply #2 on: June 24, 2018, 07:36:06 AM »

Hi Eddy

Tab order works fine on normal forms, but on Tab forms and Child forms it has a different sequence.
If first follows the Tab sequence for the current form, but once it passes the last control it does NOt return to the first item as usual.
It then goes to the other child forms or tab pages and follow through the sequence there before it comes back to the current form.

The order works fine, but like i mentioned i want to "lock" the sequence on the current form as is the usual case with normal forms.
I find it difficult to think of some code i can write to keep the sequence to the current child form.

-Thanks

Peter
Logged

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Re: Keeping TAB sequence on one CHILD form
« Reply #3 on: June 24, 2018, 07:52:09 AM »

My explanation reads unclear.

I use the normal Tab editor on all the forms.
Enabling and disabling tab for certain controls.

Normally, on a normal form, Tab starts at the first control you set and then tabs through, setting the focus until you reach the last items in your queue.
Then it simply goes back to the first control, creating a visual "loop or circle" when you press TAB or Shift-tab.

However, if one uses Child Forms of Tab Controls with child forms the whole story changes.
The program still follows your Tab sequence as set, BUT it will loop through ALL the child forms as ONE BIG continuous circle and finally after tabbing through 20 odd forms and all their controls, it finally comes back to the first control.

This is very annoying, but i still cannot figure out something i can do to manually control that process which i understand is just how Windows does it.

Hope this is more clear now.
Logged

Eddy Van Esch

  • Senior Member
  • ***
  • Posts: 246
  • FF3 User
    • DevOTechS
Re: Keeping TAB sequence on one CHILD form
« Reply #4 on: June 24, 2018, 08:40:58 AM »

Petrus,
Your question was clear to me in your first post ...  :)
Maybe there is some programmatical way to influence the tab sequence. There must be ..
But I can't help you with that ...

Maybe WS_GROUP or something ...?
Logged
Eddy

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Re: Keeping TAB sequence on one CHILD form
« Reply #5 on: June 24, 2018, 12:05:09 PM »

Hi Eddy

Thanks my good man, appreciate the input!

I really need the user to work with the Keyboard for speed sake.
I never finished this project because of the Tab issue bugging me.
[It's the only one I ever made with this child-forms, hence i never got over this tab going all over the place.]

There has to be a way one can temporarily "deactivate" the hidden child forms so they cannot get the tab focus in the background.
i will give Paul a shout, i know he worked with this Child-forms.

-Peter
Logged

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Re: Keeping TAB sequence on one CHILD form
« Reply #6 on: June 24, 2018, 12:11:38 PM »

You see, all this program does is using child forms like you would use a tabcontrol.
It aligns the child form within the parameters of the Frame on page 1.
Then it creates a "ONE PAGE" program although it simply draw the one from on top of another and hides (not close) the others in the background.
This does give a visual appearance of one drawing controls on the main form while you are actually drawing them one on top of another and sizing them within the Frame.

This then unfortunately creates the problem with the TAB sequence jumping forms.
Example 1 is with Mainform, displaying form SMSNOTICE
Example 2 is Mainform, Displaying Form Settings

There will be many others, eventually.

Seems i creates a Pickle for myself.
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3187
Re: Keeping TAB sequence on one CHILD form
« Reply #7 on: June 24, 2018, 01:19:35 PM »

> Then it creates a "ONE PAGE" program although it simply draw the one from on top of another and hides (not close) the others in the background.

Hiding is not enough. You need to disable them too.

Klaas Holland

  • Junior Member
  • **
  • Posts: 104
  • FF3 User
Re: Keeping TAB sequence on one CHILD form
« Reply #8 on: June 25, 2018, 03:54:58 AM »

How about this when you leave the the last TAB-stop on that Form?

'----------------------------------------------------------------------------------------------------
Function FORM1_TEXT3_EN_KILLFOCUS ( ControlIndex   As Long,       _                 ' index in Control Array
                                                              hWndForm       As Dword,   _                 ' handle of Form
                                                              hWndControl    As Dword,   _                 ' handle of Control
                                                              idTextControl    As Long      ) As Long     ' identifier of text control
                                   
    FF_Control_SetFocus HWND_FORM1_TEXT1

End Function
Logged

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Re: Keeping TAB sequence on one CHILD form
« Reply #9 on: June 26, 2018, 04:42:39 PM »

Hi All

Yes, JosŤ that makes sense. It just hides the others and not disable them.
It then creates obviously one big page program.

Thanks everyone.
Logged

Petrus Vorster

  • Senior Member
  • ***
  • Posts: 432
Re: Keeping TAB sequence on one CHILD form
« Reply #10 on: June 26, 2018, 04:49:20 PM »

Klaas, i also went that way on the killfocus at first on the last control, but then it messes around on shift-tab when the use wants to go backwards.

I think the secret lies in just having a control code for enabling and hiding + disabling hidden forms.
the visual effect is very cool, but it does bring along its own challenges.

-Thanks all for the input.
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8822
  • Windows 10
    • PlanetSquires Software
Re: Keeping TAB sequence on one CHILD form
« Reply #11 on: June 26, 2018, 07:12:41 PM »

Hi Peter,

I am replying here so that others can benefit from the answer. Based on the code that you sent to me privately, I could easily see that you are not "hiding" a form with the definition that myself or others are intending. Your code seems to be simply hiding the form by setting the size of it to 0 height and 0 width.

Your current code:
FF_Control_SetSize(hwnd_settings,0,0)

A better approach:
FF_Control_ShowState(hwnd_settings,%SW_HIDE)

And then to subsequently show the form:
FF_Control_ShowState(hwnd_settings,%SW_SHOW)

If that does not work... as Jose has pointed out you may need to disable the hidden form as well. This is easily done with the following functions:
FF_Control_Disable(hwnd_settings)
FF_Control_Enable(hwnd_settings)

So the sequence could be...
(1) Hide the non-active forms
FF_Control_ShowState(hwnd_settings,%SW_HIDE)
FF_Control_Disable(hwnd_settings)

(2) Show the current active forms
FF_Control_ShowState(hwnd_settings,%SW_SHOW)
FF_Control_Enable(hwnd_settings)

Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3187
Re: Keeping TAB sequence on one CHILD form
« Reply #12 on: June 26, 2018, 07:31:26 PM »

> Your code seems to be simply hiding the form by setting the size of it to 0 height and 0 width.

That explains it. Hiding the child dialogs should be enough. I suggested to disable them because he said that "hiding" was not working. In my "tab" code for the Cwindow class I simply use ShowWindow with SW_SHOW and SW_HIDE.

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8822
  • Windows 10
    • PlanetSquires Software
Re: Keeping TAB sequence on one CHILD form
« Reply #13 on: June 26, 2018, 08:14:49 PM »

> Your code seems to be simply hiding the form by setting the size of it to 0 height and 0 width.

That explains it. Hiding the child dialogs should be enough. I suggested to disable them because he said that "hiding" was not working. In my "tab" code for the Cwindow class I simply use ShowWindow with SW_SHOW and SW_HIDE.

...and with FireFly's generated code for switching between child pages in a Tab Control, I do the same thing.... simply show/hide the pages.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8822
  • Windows 10
    • PlanetSquires Software
Re: Keeping TAB sequence on one CHILD form
« Reply #14 on: June 26, 2018, 09:12:40 PM »

Using FireFly again just reminded me and reinforced just how ugly it is on high dpi monitors. My system is running a display at 3840 x 2160 and that shows FireFly's glaring lack of proper high dpi support.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer
Pages: [1] 2