LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

2 Questions - Run as administriator & change in text size

Solved!
Go to solution

Hello everyone!

 

I have developed a software using CVI, could you please answer 2 questions?

1. When I installed it on other computers the text messages looks different (the font became larger) and in my computer it looks fine.I think it happens when one choose to change the size of the text in windows thorugh: control panel -> apperance and personalizations -> medium(125%)/large(150%) instead of small(defualt, 100%). Can I prevent the change in the size of text in the panels?

 2. In other computers the software could not create a file for writing unless one run it with "Run as administriator" option. Why?

I hope you understood my questions, thank you!

0 Kudos
Message 1 of 7
(3,575 Views)

Hey RaVen,

 

This is Ali from National Instrument's applications engineering. To answer your first question, is this a normal application? If so, have you manually changed your font size in runtime like this link? Additionally, you can go in the registry and force text standardization over there as seen in this post.

 

For your second question, are you writing a TDMS file on a system file or similar? If that's the case, then it does ask for administrator privileges because it has to Reserve Size (basically asking the computer for pointer access). There's more information on the help page here. Other system write commands asks for similar permissions when writing files (I'd recommend glossing over the help pages for those files, I've found them to be very helpful in the past).

 

Hope that helps or clarifies your questions!

Regards,

Ali S.
Applications Engineering
National Instruments
Message 2 of 7
(3,543 Views)

 

I am not sure you understood me, just in case I will try to explain much better this time (sorry!!):

This is a normal application.

 

In Windows 7, I usually work in: Control Panel -> Apperance and Personalizations -> Display -> (chage the size of text)  small (100%). 

However, some users may choose to change the display mode (the size of the text) by: control panel -> apperance and personalizations -> Display  -> (chage the size of text) medium(125%)  

 As a result, the size of the message texts in the panel (uir) increased from 11 to 13 automatically no matter what and all the text get out of proportion. In large (150%) mode it is much worse beacuse the size of the font became 16.  Moreover, the size of the text in the tables and the buttons in the panel are also affected as you can see in the photos (small, large differences) 😕
The question is how to make the panel looks exactly the same in any windows display mode.

I tried to change the font size through the link you sent me and choose and it did not work.

Maybe I could force the text standardization over my computer, but I want that the program will work in every computer..so I can't do it manually each time someone want to install it (did I understand correctly?).

 

I am trying to write results to a regular text file (*.txt) with FILE *.. = fopen("....","w"), fprintf(...) and fclose().

The default installed directory is c\program files x86\ and I think that's the problem - when i write files to this place i can't see them regulary, but only through the software loading panel - it looks like document with a key there (very strange for me). However, when I try to write to a different location or "run as admin" it works fine.

 

Download All
0 Kudos
Message 3 of 7
(3,533 Views)

With reference to writing files, it's true that c:\program files folder is somewhat protected by the system. In this respect, it seems to me that we are encouraged to use other folders instead. You may find useful reading this thread where retrieving common folders is discussed:

A better way to get AppData location?



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 4 of 7
(3,512 Views)
Solution
Accepted by topic author RaVen88

As far as the text size is concerned, if you don't use one of the predefined metafonts for your control text and labels, you shouldn't have that problem. The metafonts are designed to take on the characteristics (in both size and style) of the default settings of the computer in which you're running your program. Also, by default, all new controls that you create use one of these metafonts, specifically NIDialogMetaFont, which is an alias for a variable-size font that might become larger or smaller depending on the computer settings.

 

To avoid this, you can change the typeface completely to something else (Arial, etc...), or you can even keep the same typeface, but make sure you pick a different point size that will result in it not being the predefined metafont. For example, in my computer, if I use point size 11, I'm using the metafont. But if I change the point size to anything else, then I won't, and that point size should then stay the same in any computer.

 

Point size 11 (metafont):

 

dialog11.png

 

Point size 12 (no metafont):

 

dialog12.png

Message 5 of 7
(3,445 Views)

Thank you for your helpful replay!

Actually just before I saw your replay I changed all the fonts to Arial and it indeed solved the problem 🙂

One thing I wasn't able to do is to change the font and the size of the panels' title . When I double click a panel, I can choose between only two title bar styles; "Classic" which is in my opinion looks awful, but it allows me to change the font and the size of the text, and "Windows Style" which looks really good, but there is no option to change the size or font.

Are there any ways to control the font of the Windows Style? or at least make the title dynamic so it could be seen in case that the title is larger than the panel width? 

0 Kudos
Message 6 of 7
(3,431 Views)

There are two issues here: one is top-level panels versus child panels. The other is "Windows Style" titlebars versus "classic" titlebars.

 

Unfortunately, you cannot change the font attributes (or the titlebar style, for that matter) for top-level panels. You can only change them for child panels.

 

The reason the UI editor lets you change the font of your panel (if you use the classic titlebar style, that is) is because the editor doesn't know if that panel will be loaded as a child panel or as top-level panel by your program.

 

If you bring up the documentation of each panel attribute, it tells you if it's restricted to child panels or not:

 

childpanel.png

 

As for the titlebar style, as you've noticed you're not able to change the font settings of any child panel for which the titlebar style is set to Window Style. This is because for this titlebar style, it's really Windows that is drawing the child panel's titlebar, not CVI, and Windows uses the default system font for Windows titlebars.

0 Kudos
Message 7 of 7
(3,414 Views)