07-18-2016 09:03 AM - edited 07-18-2016 09:04 AM
Hi,
I've got a problem while UI-programming:
On my window are severel controls, some of them are system checkboxes. All of them should get the key focus while tabbing through them.
Now the problem: one of them doesn't show visibly the focus.
See the following pictures:
Am I missing an option to hide the focus?
I became curios about that and experimented a little bit. Newly inserted checkboxes are working how expected, but if I replace the checkbox against a radio button, it also doesn't visualize the focus.
Once, the code modifies the focus programmatically, the focus starts working how it is expected, but why does that happen?
Edit: I'm using LV 2011
Solved! Go to Solution.
07-18-2016 09:06 AM
Can you ensure that the checkboxes are "front most"? Does that change things?
Norbert
07-18-2016 06:51 PM - edited 07-18-2016 07:00 PM
Nope, doesn't change anything.
Anyway, the checkbox is in empty space.
By the way, in my first post, I guessed, it may have to do something with programmatic setting the focus. That was wrong. It depends on which control had focus before. The programmatic access just activated an additional button control. So, this happens: Listbox --> checbox - focus invisible, Button --> checkbox - focus draws frame.
Also, sometimes it depends on if the VI runs as standalone (the example above) or it is inserted into a subpanel (I've got working and not working examples for that case).
07-19-2016 02:41 AM
Does the issue also occur when using tabbing to move focus from element to element?
Norbert
07-21-2016 07:41 PM
Sorry, I don't understand Your question properly.
The checkboxes are controls, which are not part of a container, so I'm not sure about, what means moving focus from element to element. Tabbing moves the focus from a control to the next control. Also, I can't test another situation, because some existing controls spread around in my application seem to have lost their ability to visualize the focus, but newly inserted are working just fine.
07-22-2016 02:25 AM
@gerh wrote:
[...], but newly inserted are working just fine.
Have you tried "Replace" on this checkbox?
My question regarding tabbing is that you can use the tab key to jump from element to element. Each element has the option to disable tabbing so it will not be active when cycling through with tab.
You can modify tab ordering of a panel by selecting Edit >> Set Tabbing Order.
Norbert
07-22-2016 09:03 AM - edited 07-22-2016 09:06 AM
Hi,
@Norbert_B wrote:
My question regarding tabbing is that you can use the tab key [...]
yes, I tried to replace. But You're right, changing the tabbing order changes the behavior of the controls. It is always the first system checkbox or system radio button which gets focus after the system listbox. Seems the issue has something to do with the listbox. If I insert a new listbox the focus is OK. But if I edit it, the focus stops working.
Now I'm up to check which step causes the issue.
edit: I forgot to answer: the main issue belongs to the tab key.
07-22-2016 09:58 AM
Hi again,
I've found it!
@Norbert_B wrote:Can you ensure that the checkboxes are "front most"? Does that change things?
Norbert
against to your advice, "move to back" does the trick.
It is a quite strange behavior. Both, the Listbox and the checkbox are in empty space (directly placed in the pane of the VI's front panel), not overlapping each other. Furthermore, there is a disabled button in between them (located and in tabbing order).
If the checkbox is in a layer above the listbox and the listbox is at the background (lowest layer of the focusable objects), then the checkbox is not able to display it's focus state, but only if tabbing moves the focus directly from the listbox to the checkbox. So, if the listbox is the frontmost object, and the other controls (checkbox, radio button,...) behind it, then it works. By the way, the listbox always shows the focus properly, or if the button is enabled all controls are working as expected.
Thanks to Norbert_B for leading me onto the right track.
Has anybody an idea, what causes this focus issue? Is it possibly a bug in the Qt code? If not, I'll mark this post as answer.
Cheers,
Gerhard