Visibility condition inside itemlayout/focusedlayout problem
#1
Hi!

I currently have a visibility condition inside a panel-container looking something like this:

<itemlayout>
....
<visible>ControlGroup(2000).HasFocus()</visible>
...
</itemlayout>

Everything works fine, except when opening the context-menu: The visibility-condition inside the itemlayout becomes false for some reason (The same visibility condition does not become false for items outside the panel-container in question...).

I cant figure it out, is there some problem with having visibility-conditions inside an itemlayout?

Cheers,
Reply
#2
When the context menu is open, does it not take the focus away fron your control group? (if you set debugging to true in your addon.xml file, you can see what has focus at any one time).

If so I guess this would work, but you might run into the same problem with all the other dialog windows.

xml:

<visible>ControlGroup(2000).HasFocus | Window.IsActive(contextmenu)</visible>

But you said the visibility condition works as you want for everything outside of <itemlayout> so it might be a limitation of <itemlayout>. I find that focus is always lost when a dialog window is open on top, so I try to stick to Control.IsVisible or include specific conditions based which dialog windows are open.
Reply
#3
(2020-02-10, 11:54)QuizKid Wrote: When the context menu is open, does it not take the focus away fron your control group? (if you set debugging to true in your addon.xml file, you can see what has focus at any one time).

If so I guess this would work, but you might run into the same problem with all the other dialog windows.

xml:

<visible>ControlGroup(2000).HasFocus | Window.IsActive(contextmenu)</visible>

But you said the visibility condition works as you want for everything outside of <itemlayout> so it might be a limitation of <itemlayout>. I find that focus is always lost when a dialog window is open on top, so I try to stick to Control.IsVisible or include specific conditions based which dialog windows are open.
Ah sorry, i meant that the visibility condition is something like ControlGroup(2000).HasFocus(2001) - Which can be true even if ControlGroup(2000) does not have focus. I guess the problem is with the dialog - But anyways, i fixed my code by updating a window property with the current focus of that grouplist, and checking for that instead. Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Visibility condition inside itemlayout/focusedlayout problem0