09-02-2010 07:37 AM
Using LabView 2009 SP1 - not brave enough to try 2010 yet.
Having looked at other postings (and asked NI through my support) I am not hopeful of a good outcome but here goes.
I want to have two front panel colour schemes - to be specific on the bridge of a ship they like to use 'red light' at night to maintan their night vision, under these conditions a 'normal' windows style display sticks out like a sore thumb, while turning down the screen brightness helps (dependant on screen), it is not enough and some further reduction in light level is required.
The effect I am after would be akin to sticking a red theatre lighting gel over the screen (we have actually seen this used onboard vessels and intend to try it ourselves as one solution). Display is LCD on laptop so fiddling with colour balance not really an option.
I believe that with enough effort I could use references panel>pane[]>all objects[]> to search out every control and with the 'type of control flag' property force each reference to the correct class and then use the appropriate color properties (label, text, background etc) to set what I want - tedious but when done once probably could be converted into a universal subVI. However there are items whose colours I cannot see how to set. Except by using the Windows (XP classic mode only) styles which seem preset and in some cases frankly odd. Such unchageables include the colours involved in scroll bars and the panel header and menu bars.
NI support suggested making the scroll bars invisible and overlaying them with a vertical progress bar to mimic the scroll bar functionality - passable but do I really have to do this for every scroll bar I have????
So any thoughts on how to change scroll bar colouring or apply a screen wash?
As an interesting aside - if I make my pane a funny colour (purple anyone) and then in the block diagram right click on an array wire and select create>indicator the background of the indicator (but not of the index box) is coloured as per the panel. This does not happen with other indicators created this way - e.g. creating from a string wire.
All suggestions welcome - Ian
09-02-2010 07:51 AM
Ian,
i am not 100% sure if i got your request. I take it like this:
You have an application with a certain user interface. Thiis user interface should supply two modes: night/day. The modes differ in color for all controls, but both have the same controls/layout.
So here is what i would probably do:
Decouple UI from the actual application. Create a dedicated interface between the application and the UI. Create a small "demon" which enables you to swap UIs. Create one UI for night-mode, one for day-mode.
Challenges:
- Proper interface between UI and application: You hacve to pass commands from UI to application and data back for display
- Demon tool: how does it know when it should change UIs? Does the new UI immediatly have to show the values the "old" UI had shown (how to handle this)?
Hints:
- Producer/Consumer framework does already a decoupling of UI interaction and functionality (application). This has to be split up into several VIs.
- User events come at hand for passing status/data to the UI
- VI Server is the key for the demon
hope this helps,
Norbert
PS: recoloring all your controls/indicators is of course also possible, but very cumbersome.....
09-02-2010 08:20 AM
Hi Ian,
What about this?
I've created a shape using powerpoint and set it to have partial transparency. Then just saved it as a picture (png format).
I dragged it onto the front panel and placed it inside a tab control.
By using the the visible property of the tab control you can red-out the screen in localised areas. The larger the tab, the more screen you can cover.
Does that work for you?
Ian
09-02-2010 08:39 AM
Good idea Ian.
Similarly, you can set the entire panel as transparent - see picture, I have overlaid the panel over my desktop to show the effect.
You can control transparency programatically with a property node if you need to.
09-02-2010 09:06 AM
Certainly a valid solution, just not too keen on duplicating (and maintaining both copies) what is already a complex UI but certainly worth thinking about. Thank you
09-02-2010 10:36 AM
Ian
thanks, that is clever. Sadly I already have a tab control (which I size to be the whole pane - used for its proper purpose. However I can copy the .png onto the tab and turn it off and on which has much the same effect but is cumbersome as I have to 'find' it - this I presently do by cycling through all the tab objects looking for a ClassID of 4 (decoration). When I find the one and only decoration I force its reference to be type decoration so I can turn it off and on. To work properly I would have to put this .png on every page of the tab (no great deal however?).
So my secondary question is - having pasted the transparent object onto the tab how can I get to its properties (i.e. 'name' it) instead of looping looking for decorations (I use one other) and is it possible to load the .png file programatically onto the panel and name it or save its reference? Or better even still could one create such a decoration from inside LabView - declare size/colour/%transparent and get the reference easily?
09-02-2010 11:03 AM
As far as I know, you can't get the properties of an image pasted onto the front panel. However, it is worth seeing if you could use a picture control instead - this will allow some of the properties to be accessed. I'll pass the baton onto someone who is a bit more experienced in this.... I've never really played with picture controls but you should be able to programmatically load the images into them. Can anyone else out there comment on this?
Possibly a simpler approach here would be to just create another larger tab control which sits over the top of your existing tab control. It won't matter that this tab is larger than the visible screen as it does not matter that the user can't see the edges. The new tab control that contains the png needs to be transparent so that it doesn't obscure the one below it.
One thought that has just occured to me is that when the 'red' tab is visible, you can't click through it to access the controls underneath. Depending on your application, this might make it a less than optimal solution.
09-03-2010 04:21 AM
Yes I noticed that when the overlay was visible controls were unreachable. I am tending towards the transparency option - if I clear the desk top and set the windows screen colour to black with a slider to control the VI transparency I get a reasonable effect. Note, even an all black LCD is quite bright but if I use the monitor brightness control as well the overall result is good. You get some wonderful colours if you use screen colours other than black - e.g. some charming shades of pink with a red screen. Of course I will have to clear everything off the desktop otherwise the icons show through. Now back to the windowless room with the lights off.
04-19-2022 09:56 AM - edited 04-19-2022 10:01 AM
Hi IanR99,
Did you end up with satisfactory results from the tab control strategy mentioned above, or did you find a better solution?
I have the same problem, trying to create a "night mode" for my GUI front page.
04-19-2022 09:29 PM
Not sure if this is useful, but maybe interesting...
Some time ago I was trying to replicate an old LabVIEW example I found somewhere that would overlay a semi-transparent image on a VI front panel to block the controls while it displayed a dialog that it moved on to the front panel.
I recently tried to replicate this feature.
I found a post somewhere that showed how to "tag" a decoration so it could be found by name. I could then search the array of decorations for the tagged decorations and create a reference to show or hide the decoration. The "user tag" VIs can be found in vi.lib in the UserTags folder. Tagging the right decoration is the only tricky part. Probably best to get the current number of decorations, add a new one, then tag the last one in the array.