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
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 ...
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
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.
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 ...?
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
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.
> 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.
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
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.
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.
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)
> 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.
Quote from: José Roca on June 26, 2018, 08:01: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.
...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.
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.
Now you know why I insisted so much about the subject. Some PBer's that have begin to use 4K monitors are now looking for my posts about DPI.
Quote from: José Roca on June 26, 2018, 10:12:32 PM
Now you know why I insisted so much about the subject. Some PBer's that have begin to use 4K monitors are now looking for my posts about DPI.
You're a man who's ahead of his time :D
Hey guys, its always good to ask here.
Thanks for the help, busy making the changes!
And as soon as the Firefly for Freebasic is there, i will most definitely enjoy using your high dpi controls!!
Thanks a million.
-Peter
Yes, a simple FF_control_disable on the forms hiding and a simple FF_control_enable on the form you see keeps the Tab sequence nicely on one form.
Seems logical now.... :-[
thanks for the advice.