03-05-2009 03:45 AM
In Edit Panel window I can see a list of Attributes for child panel, that I set as following:
I put on my Panel a picture control large as the whole panel, without borders, and when I display the panel with the DisplayPanel everything is OK.
But if I call InstallPopUp, I can see an ugly white border all around my panel (4 pixels wide). I use InstallPopUp because I don't want other panels active while this one is visible.
I read in this thread that Popups are always top-level panels, and some attributes are taken from the OS settings.
Is this the reason for this behaviour?
Is there a way to overtake this limitation?
For this project I've been working with the new CVI 9.0
Thanks
03-10-2009 06:02 AM
I did some tests at Operating System level:
but a border around my panel when I display it with InstallPopUp() is always present.
Is there a way to avoid it?
Or, is there another way to have a custom panel with a pop-up behaviour (always on top, other panels disabled, ...) without using InstallPopup() ?
03-10-2009 11:50 AM
Ciao Vix,
unfortunately the properties you need to set (expecially frame thickness) can be accessed only on Child Panels.
The only workaround I can think about is to reproduce the modal behavior of the popup to the Panel you're working with. In order to do this you can set the following attributes just before loading the pane with LoadPanel() statement:
SetPanelAttribute (panel, ATTR_FLOATING, VAL_FLOAT_ALWAYS);
SetPanelAttribute (hparent, ATTR_DIMMED, 1);
SetPanelAttribute (hparent, ATTR_DIMMED, 1);
SetPanelAttribute (hparent, ATTR_MOVABLE, 0);
SetPanelAttribute (hparent, ATTR_SIZABLE, 0);
SetPanelAttribute (hparent, ATTR_CAN_MINIMIZE, 0);
SetPanelAttribute (hparent, ATTR_CLOSE_ITEM_VISIBLE, 0);
DisplayPanel (panel);
SetActivePanel (panel);
where panel is the handle of the popup-like panel while hparent is the handle of the Parent panel
When you're going to close the panel on the DiscardPanel() statement, just set such attributes to theire default values.
Hope this helps,
Fabio
03-10-2009 12:06 PM
Hello Vix,
As you've found out already, there is no way, using the CVI User Interface Library, to configure the window frame for a popup (for a non-popup top-level window, you have some control, using the ATTR_TITLEBAR_VISIBLE, ATTR_SIZABLE and ATTR_CONFORM_TO_SYSTEM_THEME attributes). But for a popup window, you have even less control.
The only suggestion I can make is that you experiment with the low-level window style of the panel, after you've installed it as a popup. You can get the low-level window handle by calling:
GetPanelAttribute (gPanel, ATTR_SYSTEM_WINDOW_HANDLE, &winHandle);
You can then experiment with various combinations of window styles, by changing them using GetWindowLong and SetWindowLong (you must include windows.h):
SetWindowLong (winHandle, GWL_STYLE, ...);
You can look through this page for documentation on what each flag does. But keep in mind that this is something that's not really supported in CVI, and it will be very easy to end up with even worse results. And when all is said and done, you might not even be able to get the effect you want (the best you might be able to do is a 1-pixel border).
Luis
03-12-2009 02:13 AM - edited 03-12-2009 02:14 AM
Chuck_81 wrote:
The only workaround I can think about is to reproduce the modal behavior of the popup to the Panel you're working with. In order to do this you can set the following attributes just before loading the pane with LoadPanel() statement:
...
Unfortunately if I set ATTR_DIMMED to 1 for a whole panel I see the panel becoming dimmed from the top to the bottom: this is an heavy operation, I think, especially for a 1280x1024 panel...
LuisG wrote:
As you've found out already, there is no way, using the CVI User Interface Library, to configure the window frame for a popup (for a non-popup top-level window, you have some control, using the ATTR_TITLEBAR_VISIBLE, ATTR_SIZABLE and ATTR_CONFORM_TO_SYSTEM_THEME attributes). But for a popup window, you have even less control.
...
You can look through this page for documentation on what each flag does. But keep in mind that this is something that's not really supported in CVI, and it will be very easy to end up with even worse results. And when all is said and done, you might not even be able to get the effect you want (the best you might be able to do is a 1-pixel border).
I read the documentation you suggested, and I think I will be able to obtain a 1-pixel border (as I get with the "borderless" theme)..
I think I'll have to accept a compromise, anyway
Do you think I could make a feature request for future CVI releases?
03-12-2009 11:29 AM
You're always welcome to file a suggestion, but keep in mind that in this case, since CVI is built on top of the Win32 API (in the Windows version), it is limited by what the Win32 API allows. And it might not be possible to have a completely borderless top-level window. But we will consider it.
Luis