11-27-2015 03:16 AM
Hi all!
I start the app with a maximized panel. When I bring the panel to normal size using the minimize button, a ring slide with three positions changes his state to the topmost. The underlaying variable who's representing the ring slide position is not touched (so the callback is not executed). Everything works fine until I read the position of the ring slide in a different callback. How can this happen? How can I prevent the controls of beeing changes while a simple resize of the panel?
Best regards,
Thomas
11-27-2015 04:38 AM
This is an unexpected behaviour: controls normally do not change their value / position when maximizing or restoring the panel. A simple project I made with two sliders only does not expose such anomaly, but your code will obviously be far richer than this!
You could try putting a breakpoint at the very beginning of the slide callback to understand whether it is called and which event is sent to it, so that you can see if some unwanted code is executed.
Alternatively, you could try stripping down the project to the minimal code that reproduces this behaviour, so that we can look at it and understand what's happening.
I am attaching the sample project I made: after running it, in the debug output window you will read all events that fired in panel callback and slides callback (EVENT_PANEL_MAXIMIZE is listed as Event 53 and EVENT_PANEL_RESTORE as Event 54). Project developed in CVI2012.
11-27-2015 05:13 AM
Hi Roberto,
The problem is, that the callback is called only when it should. And it happens only when I click the window restore button. I checked the code twice and there is also no codeline who change the slide programatically.
Best,
Thomas
11-27-2015 11:47 PM
Here is a workaround:
If you are keeping track of the current ring state, you can catch the panel size change callback (I didnt check but I believe there should be one) and set the value of your variable back to the control and correct its value.
Unfortunately, CVI GUI always had problems with ring controls. At least this is my experience.
The most famous one is the change of the ring slide pointer appearence and the disappearence of the arrow on the drop down ring.
This may be a similar issue. But we still love it 🙂
11-29-2015 04:33 AM
I must admit that I never observed odd behavior of ring controls. I am probably not allowing the problematic set of user actions.
ebalci ha scritto:
If you are keeping track of the current ring state, you can catch the panel size change callback (I didnt check but I believe there should be one) and set the value of your variable back to the control and correct its value.
EVENT_PANEL_MAXIMIZE and EVENT_PANEL_RESTORE events in the panel callback can be of help in this respect.