LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView and System Colors

Hi everyone 🙂

I am currently developing some small application in LabView 8.0.1. Until now, I've always used the default colors. I usually develop either in MFC (C++) oder .NET (C#). I am completely used to the standard color scheme of Windows - that light grey.
I want to achieve, that my applications look like they were coded in some of the other languages. LabView usually gives me quite a dark grey, which is ... not exactely beautiful and doesn't fit to all the other applications (it's darker).
Is there some way, I can make my application look like some C# Application? Do I have to set the colors manually or can I tell LabView to use Windows' colors.

Thanks, for your help.

Thomas Linder

0 Kudos
Message 1 of 12
(5,323 Views)
You use the coloring tool on the Tools palette. Select the tool and then right click to get the color palette. Pick the system color. The controls.indicators on the dialog controls palette use the system colors automatically.
0 Kudos
Message 2 of 12
(5,311 Views)

The color palette includes some system colors (in the bottom right corner).

Additionally, there is a dialog controls palette, which will give you controls which adapt to the OS and there is the dialog font, which will also adapt to the OS.

Using these will ensure that your application looks "at home" whereever you take it.

Some cons:

1. You can't use property nodes to change the appearance of dialog controls.

2. Some controls (like graphs) don't have an equivalent dialog control and integrating them into your dialog UI is a problem because you can't anticipate exactly what it will look like.

3. The users can play around with this, for example by using large system fonts, and screw around with the way the application looks.

4. You have to do some further testing and make sure that you set everything to use dialog controls and colors or you might find out that your users have black text on a black background and so on.


___________________
Try to take over the world!
0 Kudos
Message 3 of 12
(5,305 Views)
Ah
Thanks to both of you.
That color palette (Panel & Object) was what I've been looking for all the time. Integrating Graphs is not an issue in this application, maybe it will become one, but I'll still enjoy to deal with that than with that ugly dark grey 🙂

Concerning playing around: Why should someone do this. If they mess it up, they need to call us, which means money. You can almost mis-use any application if you're just willing to, so I don't see why I should pay extra care to that.


Just one more question:
I know of a "Select Path" Dialog in other languages which shows the normal Select a Path Dialog Window, where only folders are shown (no files like in the "Select File Dialog"). Is that one available in LabView or do I have to deal with this "Use this folder" button in the "Select File Dialog" ?

Thanks to both of you anyway 🙂
0 Kudos
Message 4 of 12
(5,297 Views)
Unless I'm misunderstanding your question...

There's a function called "Open/Create/Replace" file, which will bring up the system dialog.  This of course assumes that you're looking to work on a file in LV, and not just to look at it.

Why are you looking for this dialog?
0 Kudos
Message 5 of 12
(5,287 Views)


@Somnatic wrote:

Concerning playing around: Why should someone do this. If they mess it up, they need to call us, which means money. You can almost mis-use any application if you're just willing to, so I don't see why I should pay extra care to that.

The thing is that they might not mess "it" up, but something seemingly unrelated like the system colors or fonts, which might be hard to troubleshoot. I agree that normally users don't play around with this, but you should hope not to run into this in a case where they do. Anyway, as long as you're using only standard dialog controls, colors and fonts you should be alright.

As for the dialog, LV has its own dialog because of its multi platform support and the need to be able to provide the same functionality and configurability in all platforms. You can make a call to a windows API function to get this dialog, as shown in the attached.

Note - you can easily get more functionality out of this (look at the link), but I did not write this, and I haven't had use for it yet, I haven't modified it.


___________________
Try to take over the world!
0 Kudos
Message 6 of 12
(5,285 Views)
@Novatron: tst got what I was thinking of 🙂

@tst: Ok, I get that point (remaining platform compatibility). The better way would be to maintain compatibility I think. Probably I'll stick to the built in dialog because of this. Thanks for your reply.

0 Kudos
Message 7 of 12
(5,275 Views)


@Somnatic wrote:

@tst: Ok, I get that point (remaining platform compatibility). The better way would be to maintain compatibility I think. Probably I'll stick to the built in dialog because of this. Thanks for your reply.

You can modify your code to call this dialog only on windows. If you're using LV 8, you can use the conditional disable structure to call the DLL if on windows or the file dialog on other platforms. If you're before LV 8, you can using the Application>>OS Name property to recognize the OS and then dynamically load a VI which calls the DLL or a VI which will call the file dialog. The reason for doing this dynamically is because the DLL call would not be compiled on other platforms and so can not be loaded at edit time. If you are planning on only using windows, you can of course call the API function, but I don't think that it gives you all the functionality of the LV file dialog.

___________________
Try to take over the world!
0 Kudos
Message 8 of 12
(5,269 Views)
Hmmm .. this sounds definitely interesting to me. I am currently working on 8.0.1. This specific dialog is interesting (for me) since it only exposes a really basic functionality. I do not need anything else - everything else would make life harder for the people I develop this for.  I'd like to use that little, that is left of Windows - Knowledge.
I understand the point in compiling on other platforms - been there, done that 😉

Thank you for your help tst, appreciate it.

Thomas
0 Kudos
Message 9 of 12
(5,260 Views)
Getting back to the original question, if you find the need for more colors than the six available in the color palette (unlikely, but it does happen), check out the Using System Colors tutorial.  It also explains how to put an opaque text label on a gradient background, such as the XP tab control (very useful for labels on borders).
0 Kudos
Message 10 of 12
(5,244 Views)