LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

A Control in a panel sometimes cannot show

In my panel, there are some tables using Zplane to arrange, there is another control, a ring control in the panel, when loading and display panel, sometimes the ring control can be displayed, sometimes it can not be displayed, but I can see an imprint of the ring. In this case, is there a way to redraw the panel or the control?

 

David

 

 

0 Kudos
Message 1 of 11
(4,898 Views)

Hi David,

 

what do you mean by 'it can not be displayed'? You have a panel built in the UI editor which is then loaded with LoadPanel, right? Do you check for or receive any error with LoadPanel? Did you change z-plane position after loading or only in the UI editor? What happens if you try changing the z-plane position programmatically (ATTR_ZPLANE_POSITION) to move the ring to the front?

0 Kudos
Message 2 of 11
(4,890 Views)

Hi Wolfgang,

 

I can describe the basic frame of my application as follows:

 

In the main function, I make a UIR as the parent panel, in the parent panel, it will load some child panel to perform the specifying function. For example, if it is need to show some data in a table, the application will use LoadPanel(parent, ...) to load the child panel and display it. The child panel include the ring control, the raised frame decoration  and a table. Only using one RunInterface()  in the main function to maintain events. But I found  when displaying the child panel, sometimes the decration, the ring control can be seen, sometimes they can not be shown fully. I'd like to know is there anyway to redraw the panel?

 

 

David

0 Kudos
Message 3 of 11
(4,883 Views)

DisplayPanel: Calling DisplayPanel when a panel is already displayed causes the  panel to be completely redrawn.

0 Kudos
Message 4 of 11
(4,879 Views)

Hi Wolfgang,

 

I have tried the DisplayPanel(), it does not have any effect. I have to make a right click event and using set visiable attribute to reload the control.

 

David

 

0 Kudos
Message 5 of 11
(4,847 Views)

David,

can you post a small example project that shows this behavior?



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 6 of 11
(4,840 Views)

This is a big project, it is difficult to get the all code phase. Just simplly describe the architecture of the app. as follows:

 

Arragged some picture button in the main panel, using RunUserInterface () to maintain the running and events. all of the panel color are  (R:49, G:55, B:38). Of course, in the main function initializing stage, it will also do some  works such as spawn threads, install control callback etc. Then the app run a monitor process in a child panel and wait user interact. PS---All the child panels' style is the classic, hidden mode. Once user pressed a button (picture button) in the main frame panel, it will load the relative child panel. In the child panel, it is placed a table, a ring  and a tree control using UIR editor. The child panel will be manipulated by the main function, so it just returns its panel handle to the main panel, but not using RunUserInterface() individually. The Pseudo-code can be this:

 

//main frame:

int main()

{

     mainpanel = loadpanel();

    

     //initialize something

...

      //wat user press button

 

     RunUserinterface();

 

}

 

 

ButtonPressCallback()

{

    if (pressed)

    {

        childPanel = loadChild();

         insertTableitem;

         insertTreeitems;

        DisplayChild(childPanel);   

    }

    if (hideFlag)

    {

        HidePanel(childPanel);

    }

}

...

 

So, sometimes the child panel can not show controls fully, but in most cases it can show controls fully. I don't know why it will appear such a problem.

 

 

David

 

 

0 Kudos
Message 7 of 11
(4,832 Views)

PS---The behaviour is: sometimes the control label cannot show, sometimes the tree items cannot show (using mouse to click can active its shows) fully...

0 Kudos
Message 8 of 11
(4,825 Views)

The problem appears again, I post a screenshot as follows:

 

figure_1.png

0 Kudos
Message 9 of 11
(4,819 Views)

I just don't understand how many chid panels are nested in your application! In the screenshot you showed us there is no evidence on the main panel: does this means that you have:

a main panel,

a child panel inside the main panel with some picture buttons

the picture button loads a child panel of that child panel.

 

Right?

 

Apart from this, I do not understand how you detect user actions in the main () before RunUserInterface ()?

int main()
{
     mainpanel = loadpanel();
    
     //initialize something
     ...
     //wait user press button    <<==== HOW ?? ? ?
 
     RunUserinterface();
 
}

 



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 10 of 11
(4,807 Views)