Re: Creating a button dynamically (C++)
Hi Michael,
Is the problem present if you take the official LeadWerks wrappers and change the default by the one you are using?
I am looking for an easy way to debug this here because we are not able to reproduce it.
Is the problem present if you take the official LeadWerks wrappers and change the default by the one you are using?
I am looking for an easy way to debug this here because we are not able to reproduce it.
Re: Creating a button dynamically (C++)
Hi,
I JUST found the problem: since there are multiple pages on an MFD (navigation, weapons, etc, etc), each update I would hide all the page sub-canvases at the beginning of my MFD update method, and then un-hide the proper one a bit further down in a switch/case. While this allowed the page to render, it did NOT allow it to update (even if I set the enabled property to true).
I changed this so that, in each case, I would show what was needed and hide the others. This allows the shown page to update properly--I guess because I'm not toggling the visibility flag from off to on each frame?
In any case, it now works. That said (without knowing the underlying framework obviously), I would think toggling visible from off to on in one frame should not cause this behavior. However, now that I know how to handle it it's a non-issue on this end
Thanks for the help...
I JUST found the problem: since there are multiple pages on an MFD (navigation, weapons, etc, etc), each update I would hide all the page sub-canvases at the beginning of my MFD update method, and then un-hide the proper one a bit further down in a switch/case. While this allowed the page to render, it did NOT allow it to update (even if I set the enabled property to true).
I changed this so that, in each case, I would show what was needed and hide the others. This allows the shown page to update properly--I guess because I'm not toggling the visibility flag from off to on each frame?
In any case, it now works. That said (without knowing the underlying framework obviously), I would think toggling visible from off to on in one frame should not cause this behavior. However, now that I know how to handle it it's a non-issue on this end

Thanks for the help...
Re: Creating a button dynamically (C++)
Thanks for the information Michael! It seems that there is something wrong at our side. We are investigating it to be fixed in the next version.
-
-
sfernandez
Site Admin
- Posts: 3203
- Joined:
Re: Creating a button dynamically (C++)
What do you mean for each Update? Every frame? Or only on response to a button click?Hi,
I JUST found the problem: since there are multiple pages on an MFD (navigation, weapons, etc, etc), each update I would hide all the page sub-canvases at the beginning of my MFD update method, and then un-hide the proper one a bit further down in a switch/case. While this allowed the page to render, it did NOT allow it to update (even if I set the enabled property to true).
I changed this so that, in each case, I would show what was needed and hide the others. This allows the shown page to update properly--I guess because I'm not toggling the visibility flag from off to on each frame?
In any case, it now works. That said (without knowing the underlying framework obviously), I would think toggling visible from off to on in one frame should not cause this behavior. However, now that I know how to handle it it's a non-issue on this end
Thanks for the help...
What are you exactly doing with the sub-canvases? First SetVisibility(Visibility_Hidden) for all of them, then SetVisibility(Visibility_Visible) for the one visible canvas?
I was trying to reproduce the error without luck

Re: Creating a button dynamically (C++)
Yes, I WAS setting all sub-canvases to SetVisibility(Visibility_Hidden) , and then SetVisibility(Visibility_Visible) for the valid sub-canvas representing the selected MFD mode. Yes, I was doing this each frame. It obviously wasn't the most optimized method but I don't code for optimization on my "brainstorming" pass 
Anyway, it was setting a sub-canvas to invisible and then visible each frame that was causing the problem. Once I changed this so that they only change when a different mode was selected (hence not each frame) everything worked fine...
I'm not too concerned about this really now that I know what causes it. Still seems like abnormal behavior, so thanks for taking a look

Anyway, it was setting a sub-canvas to invisible and then visible each frame that was causing the problem. Once I changed this so that they only change when a different mode was selected (hence not each frame) everything worked fine...
I'm not too concerned about this really now that I know what causes it. Still seems like abnormal behavior, so thanks for taking a look

-
-
sfernandez
Site Admin
- Posts: 3203
- Joined:
Re: Creating a button dynamically (C++)
I finally understood what was happening. Button mouse capture was instantly released when setting the visibility of the container to hidden. This causes that the Button.IsPressed property was set to false, so MouseUp event was not raising the corresponding Click event.
This problem will be fixed for the next version.
This problem will be fixed for the next version.
Re: Creating a button dynamically (C++)
Excellent. Thanks for sticking with it 

Who is online
Users browsing this forum: Ahrefs [Bot] and 8 guests