LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring slide changes on panel resize

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

0 Kudos
Message 1 of 5
(4,168 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(4,163 Views)

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

0 Kudos
Message 3 of 5
(4,160 Views)

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 🙂

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 5
(4,144 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(4,132 Views)