FontSelectPopup
- Updated2023-02-21
- 4 minute(s) read
FontSelectPopup
int FontSelectPopup (char title[], char sampleText[], int monospacedFontsOnly, char typefaceName[], int *bold, int *underline, int *strikeOut, int *italic, int *justification, int *textColor, int *fontSize, int minimumFontSize, int maximumFontSize, int showDefaultButton, int allowMetaFonts);
Purpose
![]() |
Note This function has been superseded by FontSelectPopupEx. Use FontSelectPopupEx to include Angle and Character Set options in the pop-up dialog box. |
Opens a pop-up dialog box in which a user can specify font settings.
If the user cancels out of the pop-up dialog box or an error occurs, the function does not modify any of the input or output parameters.
![]() |
Note You can pass 0 to any of the output parameters to hide the selection of that parameter in the font pop-up dialog box. |
Parameters
Input | ||||
Name | Type | Description | ||
title | char [] | Title of the dialog box. | ||
sampleText | char [] | Sample text to display in the pop-up dialog box as demonstration of how the settings affect the appearance of text. | ||
monospacedFontsOnly | int | Specify a nonzero value or select On in the function panel to list only monospaced, fixed width fonts. Specify 0 or select Off in the function panel to list all fonts. |
||
minimumFontSize | int | Minimum value allowed in the Size control. | ||
maximumFontSize | int | Maximum value allowed in the Size control. | ||
showDefaultButton | int | Specifies whether to add a default button to the font pop-up dialog box. When the user presses the Default button, the controls on the font pop-up dialog box change to the values you specified in your most recent call to SetFontPopupDefaults or SetFontPopupDefaultsEx. Specify a nonzero value or select On in the function panel to add a default button. Specify 0 or select Off in the function panel to omit the default button. |
||
allowMetaFonts | int | Specify a nonzero value or select On in the function panel to list the NI-supplied metafonts in the font pop-up dialog box. Specify 0 or select Off in the function panel to omit the metafonts from the font pop-up dialog box. |
||
Output | ||||
Name | Type | Description | ||
typefaceName | char [] | On input, the typeface name, such as Courier, that initially appears in the Font ring control. On output, the typeface name the user selects. The buffer must be at least 256 bytes long. Pass 0 to hide the Font ring control and prevent the user from changing the typeface. |
||
bold | int | On input, the value that initially appears in the Bold checkbox. On output, the final value in the Bold checkbox. Pass 0 to hide the Bold checkbox. |
||
underline | int | On input, the value that initially appears in the Underline checkbox. On output, the final value in the Underline checkbox. Pass 0 to hide the Underline checkbox. |
||
strikeOut | int | On input, the value that initially appears in the Strikeout checkbox. On output, the final value in the Strikeout checkbox. Pass 0 to hide the Strikeout checkbox. |
||
italic | int | On input, the value that initially appears in the Italic checkbox. On output, the final value in the Italic checkbox. Pass 0 to hide the Italic checkbox. |
||
justification | int | On input, the value that initially appears in the Justification ring control. On output, the final value in the Justification ring control. Valid values for this parameter are as follows: VAL_LEFT_JUSTIFIED VAL_RIGHT_JUSTIFIED VAL_CENTER_JUSTIFIED
Pass 0 to hide the Justification ring control. |
||
textColor | int | On input, the value that initially appears in the Text Color control. On output, the final value in the Text Color control. textColor is a 4-byte RGB value. An RGB value is an integer in the hexadecimal format 0x00RRGGBB, where RR, GG, and BB are the respective red, green, and blue components of the color value. Pass 0 to hide the Text Color control. |
||
fontSize | int | On input, the value that initially appears in the Size control. On output, the final value in the Size control. Specify fontSize in units of points. Pass 0 to hide the Size control. |
Return Value
Name | Type | Description | ||||
selectionStatus | int | The selection status or error codes generated during the function call.
Negative values indicate that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later
Example
Refer to userint\graphlegend.cws for an example of using the FontSelectPopup function.