LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Confinement region for tool bar

Solved!
Go to solution

Hello All,

 

I'm using the Tool Bar Instrument for the first time and I am not succeeding keeping the tool bar free from "child" windows.

I'd like to have a tool bar in a parent window that is not overlappable by a child window. In other words I'm looking for a situation similar to CVI environment behaviuor, where the "child" windows are blocked below the tool bar and have no chance to overlap it.

Any suggestion?

 

Thank you

Sergio

0 Kudos
Message 1 of 2
(2,998 Views)
Solution
Accepted by topic author Laser

The CVI IDE window design is slightly different. In your case, you can restrict the child panels from obtruding into the toolbar regions in the panel callback, as follows:

 

static int CVICALLBACK ChildPanelCallback(int panel, int e, void *cb, int e1, int e2)
{
#define MY_TOOLBAR_HEIGHT 50
 
 if (e == EVENT_PANEL_MOVING || e == EVENT_PANEL_SIZING)
 {
  Rect r;
  GetPanelEventRect(e2, &r);
  if (r.top < MY_TOOLBAR_HEIGHT)
  {
   r.top = MY_TOOLBAR_HEIGHT;
   SetPanelEventRect(e2, r);
  }
 }
 return 0;
}

0 Kudos
Message 2 of 2
(2,982 Views)