LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Re-doing colors and fonts in a UI

I have a UIR file that has growth over the years with 10's of panels and hundreds of controls. Small differences evolved, such as some NI fonts and similar meta fonts, and slightly difference shades of the same color.

Now it is time to standardize on a one good font and a standard palette of colors. I would like to go for a very standard TrueType font like Ariel or Tahoma, and colors that will translate well down to 8-bit color depth. (Better scaling under different DPI screen settings and fonts sizes hoped for, but not expected!)

I would appreciate advice on:

a) Fonts - This is a Windows-only app, so should I avoid things like NIDialog and NIDialogMetaFont in favor of standard TrueType fonts? Or not?

b) Palettes - How can I ea
sily establish my palette? Do I always click "More" when choosing a color, and then select from the basic colors? (How can I tell what the current color is? i.e. what RBG combination it is or whether it is in fact one of the squares that appear on the standard palette.)

c) How can I make bulk changes to one thing like typeface, but not size? Can I save the uir as a text file and do a find and replace on "NIDialogMetaFont"?

Thanks in advance for any input!
(I have CVI 6.0).
0 Kudos
Message 1 of 11
(4,838 Views)
a) I always stick to the NI fonts as they get installed with your distributions in any case. I find them better with various scalings although I'm aware that there is various opinions about this.

b) As far as colors are concerned, I also do what you suggested, I pick more and choose the standard colors. This eliminates suttle changes when you scale down the colors. I also use a graphical editor package to determine color codes. I use Paintshop Pro. I make screendumps and take the color cloner and moving over the colors exposes their RGB codes.

c) In terms of bulk changes the only way that I know of doing this is to export your GUI to a txt file, do a search and replace in the text file (.tui format I think) and import the text file agian into the GUI.

Ho
pe this helps.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 11
(4,843 Views)
Ian,


a) You can use any font that you like; then you can include it in your distribution kit; that way you can assure that the exact font that you are using is in the system. While creating the distribution kit you can create a new file group, add the font that you need and set it to be installed in the system font directory.

b) The best way to determine the RGB value of a color that you select is by placing a color picker control double-click on it and select a color, you'll se the color value in the value indicator there. As you can see in design time it's hard to find a specific color, sometimes is better if you create a function that sets all the colors at run-time. You can then #define your colors, pass them to the functions and automate your U
I standardization.

c) In design time the text file is the only way to do batch editing, however going back to the idea of run-time editing you can create 1 single big function to take care of the fonts as well. you create you UIs with any font and color scheme and then a function would standardize the fonts and color of your app.

I have created a small example for you on this. It asks the user to pick a color and a font, then based on those parameters formats the panel.

Please take a look at the example here and let me know if you have any further questions.

Regards,

Juan Carlos
N.I.

PS: This is a CVI 7.0 project, but regardless of the warnings you should have no problem vieweing it.
0 Kudos
Message 3 of 11
(4,843 Views)
Thanks Juan Carlos & Jattie for the very helpful responses. The programmatic method is attractive.

I do have a remaining color question and a font question:

Color:
I still can't see the RGB of an existing control. (Is it a version 6 vs 7 issue?) Whenever I click "More" to get the panel with RGB values, it always defaults to 255,255,255. If I choose one of the basic or custom colors, then it shows RGB values for that choice, but I have no idea how it relates to the original color of the control I'm editing. Not a big issue as I standardize things, but it would be nice to figure this out.

Fonts:
It seems that we see different font appearances on some machines. Are fonts like NIDialog supposed to be the same from computer to computer, or are they the r
esult of some call to Windows for a font? (See KB article 0DO804TL that gave me this idea.)

If they can vary, I can see this being a good reason to use (and include in the distribution kit) a TrueType font like Ariel.

I suppose my question on fonts is "What are those NI____ fonts, really?"

Thanks again!
0 Kudos
Message 4 of 11
(4,843 Views)
Color:

Open some .uir file and select color brush tool.
Move the cursor over the color you want to see.
Hold down ctl (cursor changes to color dripper) and left click with mouse.
Rigt click on same area and color box appears and click on
The selected color values should now be in the RGB boxes.

Fonts:
Fonts should all display in the same way but fonts are controlled by windows and this setting can be varied from PC to PC and the user specific configureation. This settings is controlled in the display properties panel.

Commandline to launch this panel on win2k:
<>

On the settings tab select "advanced" and see the displayed font size option. This option can b
e set to large fonts, small fonts and a custom setting and this option messes up your display as this scales all your fonts and might pick the next available bigger font to use in your application regardless of your selection of fonts for your application.

As far as I know this function is directly controlling the way the display card properties so this section impacts diffirent regestry key entries and your only easy solution is the manually check these settings from machine to machine. There micght be some easy to use SDK tools but I never went down there, the effort to achieve the objective was just too much.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 5 of 11
(4,843 Views)
Thanks, Jattie, for the quick reply.

Using CVI version 6.0.0(105) and following your instructions exactly (several times!), I still always get RGB of 255,255,255 (or HSL of 160,0,240). I can only assume that it is a version issue.

As far as the fonts go, the settings on XP's Display Properties "Appearance" tab don't seem to be our primary issue. It seems more like a typeface issue, and perhaps related to the the font smoothing settings, or Win 95/98/Me/2000/XP differences.

Do the "Appearence - Advanced" settings (i.e. font for menus, text etc) propagate through to the NI fonts I can choose in the UI editor (NIApp, NIDialog, NIMenu, NIEditor etc, and their "meta" versions), or are the NI fonts identical across all computers regardless
of the Appearance settings (DPI scaling aside)?

Thanks in advance to anyone with insights on the NI fonts!
0 Kudos
Message 6 of 11
(4,843 Views)
Hi,

The NI fonts NIApp, NIDialog, NIMenu, NIEditor and their corresponding meta fonts can vary from system to system. that is actually a feature; using those fonts allows your application to look integrated into the environment. Those fonts will grab the font settings fro the Os appearance configuration and include that in you application. This creates the effect of an application that integrates well with the OS and looks uniform with other apps.

In some cases this is not the effect that you need. you need to have consistent fonts across machines. In that case you use an specific fixed font and included it in your distribution kit.

About the color I was checking this out and I keept getting 255,255,255 until I realized
my mistake...there is a bar on the right side that set the intensity and by default is all the way up allways setting the color to white; so i was seeing just 255 all the time. I did not teste this in CVI 6.0, but I think it should be the same.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 7 of 11
(4,843 Views)
Thanks, Juan Carlos - that definitely helps. I will first ensure that I have selected consistently within the NI___ fonts and have also been consistent on size.

I notice that the actual size on-screen is not always unique for each point size specified, so as long as I'm consistent with the specified point size I should be fine.

In case it helps others, I have attached a program to display a panel with a variety of fonts.

For the record, it appears that (at least in XP) "NIMenu" and "NIMessageBox" are linked to the user's settings under Display Properties - Appearance - Advanced for the "Menu" item and the "MessageBox" item, respectively. The other NI___ fonts do not seem to be affected by any Appe
arance settings.

Thanks for your help.
Download All
0 Kudos
Message 8 of 11
(4,843 Views)
I am running the axact same version of CVi that you're running, so it must me something else than versions.

Just to double check, with the GUI open:
color picker selected
left click
then right click
select more
and I see the rgb codes

I tried varying my display resolution but it always work. Must be another oneof those Windoze issues!
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 9 of 11
(4,843 Views)
Yep - those are the steps I follow. I have XP Pro.

The ctrl key changes the cursor from a brush to a dropper. I pick up a color by ctrl-left-clicking, then when I right-click to see the "More" button, I also see that the color I just picked is added into the last row of the palette above the More button. Clicking "More" gives the color pop-up with 255,255,255 as shown in the attached file.

I see that yours has a "Custom color" in focus (outlined), whereas mine always has the white "Basic color" outlined.

I tried XP & Classic appearance styles, and reduced (16 bit) color depth - same result.

I also checked UI editor preferences. I get the same result with or without "Use System Colors as Defaults".

If I use
Paint program (v5.1), and pick a color, and choose Colors - Edit Colors - Define Custom Colors, I do get the RGB value of the color selected!

Juan Carlos - were you able to do something to fix that slider position you noticed, or were you stuck with it like I am?

Thx,
Ian
0 Kudos
Message 10 of 11
(4,843 Views)