03-01-2012 04:48 AM
Bug:
The SetPanelAttribute with attribute ATTR_WINDOWS_ZOOM set to VAL_MAXIMAL displays the panel even without calling the function displayPanel.
To fix this we can first call displayPanel then setPanelAttribute, but this makes ugly the way panels appear.
Any hope National Instruments fix it?
By the way, this bug is also linked to another one: if SetPanelAttribute with attribute ATTR_WINDOWS_ZOOM set to VAL_MAXIMAL is called before displayPanel, when the user returns to the desk, the application running can be lost.
Thanks.
Cyrille
Labwindows/CVI 2010
03-01-2012 04:59 AM
This is not a bug but rather the expected behaviour. As you can see in the online help for ATTR_WINDOW_ZOOM attribute (bold is mine):
Setting the ATTR_WINDOW_ZOOM attribute always makes the panel visible. If the attribute is set to VAL_NO_ZOOM or VAL_MAXIMIZE, the panel is always activated. If the attribute is set to VAL_MINIMIZE, the panel is deactivated. Making the panel invisible automatically resets the ATTR_WINDOW_ZOOM attribute to VAL_NO_ZOOM.
I am using this attribute to display the panel instead of DisplayPanel when I need it maximized. Couldn't you do so as well?
I am not sure to understant your second item: can you explain it in detail?
03-01-2012 06:29 AM
Thanks for your reply and sorry if it's not a bug.
I'll try to explain it.
That was the 2nd part of my post (from LabWindows™/CVI™ 2010 and 2010 SP1 Known Issues) :
37666 3TJ0IB7K Return |
Panels displayed with ATTR_WINDOW_ZOOM set to VAL_MAXIMIZE will not restore after showing the desktop.You can show the desktop by pressing <Windows Key-D> or by selecting the Show Desktop button on the task bar. Workaround: Call SetPanelAttribute with ATTR_WINDOW_ZOOM after calling DisplayPanel .
|
So to avoid this bug you must first call displayPanel then setpanelattribute with attr_window_zoom.
The fact is the bahavior is quite ugly when you do this, because your new panel is first displayed in it's original size then maximized. Any way to avoid this?
Kinds.
Cyrille
03-07-2012 02:04 AM
I've faced a similar problem with an application of mine that the user wants to iconize and is next unable to restore. I've found that if the panel title bar is not shown (I'm actually calling SetPanelAttribute (panelHandle, ATTR_TITLEBAR_VISIBLE, 0); immediately after LoadPanel) the application can then be iconozed and restored without problems. The panel is actually shown with SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
Tested on CVI 2009SP1 running on Win XP Pro SP2.
03-07-2012 04:26 AM
For what it's worth, I have succesfully tested this solution on an old Win 2k SP4 machine and on a new Win7 PRO SP1 box, both with RTE 2009 SP1 installed.
03-29-2012 07:47 AM
Thanks again for your Help, and sorry for the time I took to answer, a lot of work here.
I tried to hide the titleBar and it works, except I want to have on my application the minimize and close controls of the titleBar cause it's running on a tablet.
It looks like i won't solve this problem easily.
Thanks again.
Cyrille
03-29-2012 09:06 AM - edited 03-29-2012 09:06 AM
One possible workaround is to call SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 0); at program start: with this option, panels are minimized on the desktop, i.e. a minimal window with a small titlebar and min/max buttons will remain at the bottom left of the screen. This way minimizing and restore happen regularly, but you are left with that small element on the screen.