LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How To hide popup border?

In Edit Panel window I can see a list of Attributes for child panel, that I set as following:

  • Frame style              Hidden
  • Frame thickness      0
  • Title bar style           Classic
  • Title bar thickness   1
  • Size Title Bar Height to Font          non checked


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

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 6
(3,948 Views)

I did some tests at Operating System level:

  • I did some google searches for Windows borderless themes and I found this MIRO VS 2.0
  • I installed it, but I think it's not a real borderless theme: I'm afraid it has a narrow 1-pixel border coloured as hte window background
  • with SetSystemPopupsAttribute() I set attribute Conform to System Theme to TRUE

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() ?

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 2 of 6
(3,904 Views)

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

Fabio M.
NI
Principal Engineer
0 Kudos
Message 3 of 6
(3,893 Views)

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

 

 

0 Kudos
Message 4 of 6
(3,890 Views)

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?

Message Edited by vix on 03-12-2009 08:14 AM
Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 6
(3,854 Views)

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

0 Kudos
Message 6 of 6
(3,836 Views)