LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Pane Colour

Hi all,

 

I started playing around with trying to change the front VI window colour and found a way to do it programatically, however when I try and replicate this code, I cannot select the correct VI property as shown in the attached picture.

 

In the picture, the refnum from the VI property 'Panel' is fed into another property node. This property is then chosen to be 'colour' and the box has gone red. A colour box control has then been added.

 

On my VI, on the second property node, I cannot select colour anywhere and the box does not go red no matter what I select. Also the only colour selection box that I can select from the front panel does not look the same as the one in the picture; the one I can select places a coloured in version on the block diagram but this may just be because Im manually selected it rather than having the ability to right click the property node and select create->control.

 

You might need to open the file in MS paint as when I try to view it in normal MS viewer it gets compressed.

 

Cheers for looking

 

Mitch

0 Kudos
Message 1 of 12
(3,328 Views)

The default value for a VI property node is "This VI."   Just pass a VI server referance to the VI you want to change the color of to the code you've shown so the property node knows which panel to color.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 12
(3,320 Views)

You've lost me, what have I done wrong?

 

If I only have one VI open in the whole project, does it not just point at that VI?

 

Cheers

0 Kudos
Message 3 of 12
(3,314 Views)

 


@Mitch85 wrote:

You've lost me, what have I done wrong?

 

If I only have one VI open in the whole project, does it not just point at that VI?

 

Cheers


In a word no.  It points to the vi supplied by the referance into the vi panel property node.  (if left unwired it points to the FP of the vi it is on)

Heres an example in 2010.  run it and see what happens.

 

1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 12
(3,307 Views)

Hi Jeff,

 

Please follow these two links:

 

http://digital.ni.com/public.nsf/allkb/0DDBDB2FE2F54A5286256918006D7BB9  which was from the NI knowledge base

 

and

 

http://zone.ni.com/devzone/cda/epd/p/id/794 which is a downloadable .vi from the developer zone.

 

I have been trying to write the .vi from scratch but cannot get it to look, nor run the same but as you can cleary see from running, it works?

 

 

Cheers

 

Mitch

0 Kudos
Message 5 of 12
(3,280 Views)

GOT IT.

the red background on the property node.  Guess what.   It means a demoted property (no longer available)  the example was written in LabVIEW version 6.0 before they had panes.  This was changed in LabVIEW 8.0 when splitters and subpanels were introduced so a current panel is a collection of panes.  You are way beyond the times!  (and NI should probably re-link the example code to the newer method or at least add a disclaimer that the method works for Version 6.0 - 7.1)  For backward compatability NI wrote a red paneled property node that hides the Panes property node and loop this can only be used by the version converter when opening 6.0 code in 2010.  (well I bet you COULD get to it in vi.lib but I would not advise it)


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 12
(3,270 Views)

So should the example in the link that I put down to the NI knowledge base work then?

0 Kudos
Message 7 of 12
(3,260 Views)

Tried the example, works a treat, however, a few more questions.

 

So you have a main panel which is the main screen that you see, then panes within the panel? If so, how do you display panes and what are the benefits of having panels?

 

Is there a way to make the initial colour that the colour box is set to the current panel colour as every time I run the VI, the panel is changed to black?

 

Is there a way to use this method on different tabs? I know I can just set a tab colour, just interested in if its possible.

0 Kudos
Message 8 of 12
(3,255 Views)

@Mitch85 wrote:

Tried the example, works a treat, however, a few more questions.

 

So you have a main panel which is the main screen that you see, then panes within the panel? Yes the panel is an array of panes.  For most VIs the array size is 1.  Adding a vertical or horizontal splitter divides the panel into two panes which can then be treated differently.  Also adding a sub panel adds a new pane.   If so, how do you display panes and what are the benefits of having panels? They allow sub panels and splitters very useful for resizeing controls or displaying another vi's FP within the main VI's front panel

 

Is there a way to make the initial colour that the colour box is set to the current panel colour as every time I run the VI, the panel is changed to black?  Read the property first! or change the color box control's default value

 

Is there a way to use this method on different tabs? I know I can just set a tab colour, just interested in if its possible. Tabs are not panes and while they have a BG color property it is not of the same class (Vi server>Vi>VI)


 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 12
(3,251 Views)

Jeff, last one before I go to bed as my eyes are getting screen burn.

 

How do I add splitters and how do I show other vi FP's?

 

How would I read the colour box colour property first then make the colour box display the current panel colour? I've tried a couple of ways and I though I would just need to make the colour box a read property then put this into a write colour box property node but there are broken wires I cannot seem to get rid of.

 

On the picture of the block diagram you posted earlier, what does the bottom part do where it does the state maximized and pane colour 2?

 

Sorry if I'm asking basic questions or if it seems like I'm being lazy. Im really not meaning to be, I've just got so many questions and not enough time to try everything out one by one; plus when I do try, I run into many issues

 

Cheers again Jeff

 

Mitch

 

 

0 Kudos
Message 10 of 12
(3,241 Views)